id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
141,300 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.getBody | public String getBody(int i) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_body == null)
jcasType.jcas.throwFeatMissing("body", "ch.epfl.bbp.uima.types.DataTable");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i);
return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i);} | java | public String getBody(int i) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_body == null)
jcasType.jcas.throwFeatMissing("body", "ch.epfl.bbp.uima.types.DataTable");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i);
return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i);} | [
"public",
"String",
"getBody",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_body",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"body\"",
",",
"\"ch.epfl.bbp.uima.types.DataTable\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_body",
")",
",",
"i",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getStringArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_body",
")",
",",
"i",
")",
";",
"}"
] | indexed getter for body - gets an indexed value - the body of the table that contains data
@generated
@param i index in the array to get
@return value of the element at index i | [
"indexed",
"getter",
"for",
"body",
"-",
"gets",
"an",
"indexed",
"value",
"-",
"the",
"body",
"of",
"the",
"table",
"that",
"contains",
"data"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L238-L242 |
141,301 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.setBody | public void setBody(int i, String v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_body == null)
jcasType.jcas.throwFeatMissing("body", "ch.epfl.bbp.uima.types.DataTable");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i);
jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i, v);} | java | public void setBody(int i, String v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_body == null)
jcasType.jcas.throwFeatMissing("body", "ch.epfl.bbp.uima.types.DataTable");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i);
jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).casFeatCode_body), i, v);} | [
"public",
"void",
"setBody",
"(",
"int",
"i",
",",
"String",
"v",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_body",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"body\"",
",",
"\"ch.epfl.bbp.uima.types.DataTable\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_body",
")",
",",
"i",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setStringArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_body",
")",
",",
"i",
",",
"v",
")",
";",
"}"
] | indexed setter for body - sets an indexed value - the body of the table that contains data
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"body",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"the",
"body",
"of",
"the",
"table",
"that",
"contains",
"data"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L249-L253 |
141,302 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.getReferenceText | public String getReferenceText() {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_referenceText == null)
jcasType.jcas.throwFeatMissing("referenceText", "ch.epfl.bbp.uima.types.DataTable");
return jcasType.ll_cas.ll_getStringValue(addr, ((DataTable_Type)jcasType).casFeatCode_referenceText);} | java | public String getReferenceText() {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_referenceText == null)
jcasType.jcas.throwFeatMissing("referenceText", "ch.epfl.bbp.uima.types.DataTable");
return jcasType.ll_cas.ll_getStringValue(addr, ((DataTable_Type)jcasType).casFeatCode_referenceText);} | [
"public",
"String",
"getReferenceText",
"(",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_referenceText",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"referenceText\"",
",",
"\"ch.epfl.bbp.uima.types.DataTable\"",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getStringValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_referenceText",
")",
";",
"}"
] | getter for referenceText - gets
@generated
@return value of the feature | [
"getter",
"for",
"referenceText",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L263-L266 |
141,303 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.setReferenceText | public void setReferenceText(String v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_referenceText == null)
jcasType.jcas.throwFeatMissing("referenceText", "ch.epfl.bbp.uima.types.DataTable");
jcasType.ll_cas.ll_setStringValue(addr, ((DataTable_Type)jcasType).casFeatCode_referenceText, v);} | java | public void setReferenceText(String v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_referenceText == null)
jcasType.jcas.throwFeatMissing("referenceText", "ch.epfl.bbp.uima.types.DataTable");
jcasType.ll_cas.ll_setStringValue(addr, ((DataTable_Type)jcasType).casFeatCode_referenceText, v);} | [
"public",
"void",
"setReferenceText",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_referenceText",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"referenceText\"",
",",
"\"ch.epfl.bbp.uima.types.DataTable\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setStringValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_referenceText",
",",
"v",
")",
";",
"}"
] | setter for referenceText - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"referenceText",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L272-L275 |
141,304 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.getPageNumber | public int getPageNumber() {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_pageNumber == null)
jcasType.jcas.throwFeatMissing("pageNumber", "ch.epfl.bbp.uima.types.DataTable");
return jcasType.ll_cas.ll_getIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_pageNumber);} | java | public int getPageNumber() {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_pageNumber == null)
jcasType.jcas.throwFeatMissing("pageNumber", "ch.epfl.bbp.uima.types.DataTable");
return jcasType.ll_cas.ll_getIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_pageNumber);} | [
"public",
"int",
"getPageNumber",
"(",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_pageNumber",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"pageNumber\"",
",",
"\"ch.epfl.bbp.uima.types.DataTable\"",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getIntValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_pageNumber",
")",
";",
"}"
] | getter for pageNumber - gets the number of the page where the table is located in
@generated
@return value of the feature | [
"getter",
"for",
"pageNumber",
"-",
"gets",
"the",
"number",
"of",
"the",
"page",
"where",
"the",
"table",
"is",
"located",
"in"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L285-L288 |
141,305 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.setPageNumber | public void setPageNumber(int v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_pageNumber == null)
jcasType.jcas.throwFeatMissing("pageNumber", "ch.epfl.bbp.uima.types.DataTable");
jcasType.ll_cas.ll_setIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_pageNumber, v);} | java | public void setPageNumber(int v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_pageNumber == null)
jcasType.jcas.throwFeatMissing("pageNumber", "ch.epfl.bbp.uima.types.DataTable");
jcasType.ll_cas.ll_setIntValue(addr, ((DataTable_Type)jcasType).casFeatCode_pageNumber, v);} | [
"public",
"void",
"setPageNumber",
"(",
"int",
"v",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_pageNumber",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"pageNumber\"",
",",
"\"ch.epfl.bbp.uima.types.DataTable\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setIntValue",
"(",
"addr",
",",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeatCode_pageNumber",
",",
"v",
")",
";",
"}"
] | setter for pageNumber - sets the number of the page where the table is located in
@generated
@param v value to set into the feature | [
"setter",
"for",
"pageNumber",
"-",
"sets",
"the",
"number",
"of",
"the",
"page",
"where",
"the",
"table",
"is",
"located",
"in"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L294-L297 |
141,306 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java | Token.getWordForms | public FSArray getWordForms() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms)));} | java | public FSArray getWordForms() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms)));} | [
"public",
"FSArray",
"getWordForms",
"(",
")",
"{",
"if",
"(",
"Token_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeat_wordForms",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"wordForms\"",
",",
"\"com.digitalpebble.rasp.Token\"",
")",
";",
"return",
"(",
"FSArray",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeatCode_wordForms",
")",
")",
")",
";",
"}"
] | getter for wordForms - gets A Token is related to one or more WordForm
@generated
@return value of the feature | [
"getter",
"for",
"wordForms",
"-",
"gets",
"A",
"Token",
"is",
"related",
"to",
"one",
"or",
"more",
"WordForm"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java#L87-L90 |
141,307 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java | Token.setWordForms | public void setWordForms(FSArray v) {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
jcasType.ll_cas.ll_setRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setWordForms(FSArray v) {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
jcasType.ll_cas.ll_setRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setWordForms",
"(",
"FSArray",
"v",
")",
"{",
"if",
"(",
"Token_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeat_wordForms",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"wordForms\"",
",",
"\"com.digitalpebble.rasp.Token\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefValue",
"(",
"addr",
",",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeatCode_wordForms",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | setter for wordForms - sets A Token is related to one or more WordForm
@generated
@param v value to set into the feature | [
"setter",
"for",
"wordForms",
"-",
"sets",
"A",
"Token",
"is",
"related",
"to",
"one",
"or",
"more",
"WordForm"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java#L96-L99 |
141,308 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java | Token.getWordForms | public WordForm getWordForms(int i) {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i);
return (WordForm)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i)));} | java | public WordForm getWordForms(int i) {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i);
return (WordForm)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i)));} | [
"public",
"WordForm",
"getWordForms",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"Token_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeat_wordForms",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"wordForms\"",
",",
"\"com.digitalpebble.rasp.Token\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeatCode_wordForms",
")",
",",
"i",
")",
";",
"return",
"(",
"WordForm",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeatCode_wordForms",
")",
",",
"i",
")",
")",
")",
";",
"}"
] | indexed getter for wordForms - gets an indexed value - A Token is related to one or more WordForm
@generated
@param i index in the array to get
@return value of the element at index i | [
"indexed",
"getter",
"for",
"wordForms",
"-",
"gets",
"an",
"indexed",
"value",
"-",
"A",
"Token",
"is",
"related",
"to",
"one",
"or",
"more",
"WordForm"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java#L106-L110 |
141,309 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java | Token.setWordForms | public void setWordForms(int i, WordForm v) {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i);
jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setWordForms(int i, WordForm v) {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_wordForms == null)
jcasType.jcas.throwFeatMissing("wordForms", "com.digitalpebble.rasp.Token");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i);
jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_wordForms), i, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setWordForms",
"(",
"int",
"i",
",",
"WordForm",
"v",
")",
"{",
"if",
"(",
"Token_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeat_wordForms",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"wordForms\"",
",",
"\"com.digitalpebble.rasp.Token\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeatCode_wordForms",
")",
",",
"i",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Token_Type",
")",
"jcasType",
")",
".",
"casFeatCode_wordForms",
")",
",",
"i",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | indexed setter for wordForms - sets an indexed value - A Token is related to one or more WordForm
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"wordForms",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"A",
"Token",
"is",
"related",
"to",
"one",
"or",
"more",
"WordForm"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/com/digitalpebble/rasp/Token.java#L117-L121 |
141,310 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AlignmentPredictionModel.java | AlignmentPredictionModel.trainOnAll | public boolean trainOnAll() {
List<Map<String, String>> trueLabels = loadLabels(_trueLabelsFile);
List<String> corpus = loadTrainingCorpus(_trainingCorpusFile);
List<List<Acronym>> trainingExtractedCandidates = new ArrayList<List<Acronym>>();
List<Map<String, String>> trueLabelsForTraining = new ArrayList<Map<String, String>>();
for (Integer docID = 0; docID < corpus.size(); ++docID) {
// Adds to training examples, all the extracted pairs from the
// current document.
trainingExtractedCandidates.add(extractCandidatePairs(corpus
.get(docID)));
trueLabelsForTraining.add(trueLabels.get(docID));
}
return _abbvHmm.train(trainingExtractedCandidates,
trueLabelsForTraining, true);
} | java | public boolean trainOnAll() {
List<Map<String, String>> trueLabels = loadLabels(_trueLabelsFile);
List<String> corpus = loadTrainingCorpus(_trainingCorpusFile);
List<List<Acronym>> trainingExtractedCandidates = new ArrayList<List<Acronym>>();
List<Map<String, String>> trueLabelsForTraining = new ArrayList<Map<String, String>>();
for (Integer docID = 0; docID < corpus.size(); ++docID) {
// Adds to training examples, all the extracted pairs from the
// current document.
trainingExtractedCandidates.add(extractCandidatePairs(corpus
.get(docID)));
trueLabelsForTraining.add(trueLabels.get(docID));
}
return _abbvHmm.train(trainingExtractedCandidates,
trueLabelsForTraining, true);
} | [
"public",
"boolean",
"trainOnAll",
"(",
")",
"{",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"trueLabels",
"=",
"loadLabels",
"(",
"_trueLabelsFile",
")",
";",
"List",
"<",
"String",
">",
"corpus",
"=",
"loadTrainingCorpus",
"(",
"_trainingCorpusFile",
")",
";",
"List",
"<",
"List",
"<",
"Acronym",
">",
">",
"trainingExtractedCandidates",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"Acronym",
">",
">",
"(",
")",
";",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"trueLabelsForTraining",
"=",
"new",
"ArrayList",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"(",
")",
";",
"for",
"(",
"Integer",
"docID",
"=",
"0",
";",
"docID",
"<",
"corpus",
".",
"size",
"(",
")",
";",
"++",
"docID",
")",
"{",
"// Adds to training examples, all the extracted pairs from the",
"// current document.",
"trainingExtractedCandidates",
".",
"add",
"(",
"extractCandidatePairs",
"(",
"corpus",
".",
"get",
"(",
"docID",
")",
")",
")",
";",
"trueLabelsForTraining",
".",
"add",
"(",
"trueLabels",
".",
"get",
"(",
"docID",
")",
")",
";",
"}",
"return",
"_abbvHmm",
".",
"train",
"(",
"trainingExtractedCandidates",
",",
"trueLabelsForTraining",
",",
"true",
")",
";",
"}"
] | Trains on full corpus | [
"Trains",
"on",
"full",
"corpus"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AlignmentPredictionModel.java#L115-L133 |
141,311 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AlignmentPredictionModel.java | AlignmentPredictionModel.trainOnCandidates | public boolean trainOnCandidates() {
List<String> corpus = loadTrainingCorpus(_trainingCorpusFile);
List<List<Acronym>> trainingExtractedCandidates = new ArrayList<List<Acronym>>();
for (Integer docID = 0; docID < corpus.size(); ++docID) {
// Adds to training examples, all the extracted pairs from the
// current document.
trainingExtractedCandidates.add(extractCandidatePairs(corpus
.get(docID)));
}
return _abbvHmm.train(trainingExtractedCandidates, null, true);
} | java | public boolean trainOnCandidates() {
List<String> corpus = loadTrainingCorpus(_trainingCorpusFile);
List<List<Acronym>> trainingExtractedCandidates = new ArrayList<List<Acronym>>();
for (Integer docID = 0; docID < corpus.size(); ++docID) {
// Adds to training examples, all the extracted pairs from the
// current document.
trainingExtractedCandidates.add(extractCandidatePairs(corpus
.get(docID)));
}
return _abbvHmm.train(trainingExtractedCandidates, null, true);
} | [
"public",
"boolean",
"trainOnCandidates",
"(",
")",
"{",
"List",
"<",
"String",
">",
"corpus",
"=",
"loadTrainingCorpus",
"(",
"_trainingCorpusFile",
")",
";",
"List",
"<",
"List",
"<",
"Acronym",
">",
">",
"trainingExtractedCandidates",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"Acronym",
">",
">",
"(",
")",
";",
"for",
"(",
"Integer",
"docID",
"=",
"0",
";",
"docID",
"<",
"corpus",
".",
"size",
"(",
")",
";",
"++",
"docID",
")",
"{",
"// Adds to training examples, all the extracted pairs from the",
"// current document.",
"trainingExtractedCandidates",
".",
"add",
"(",
"extractCandidatePairs",
"(",
"corpus",
".",
"get",
"(",
"docID",
")",
")",
")",
";",
"}",
"return",
"_abbvHmm",
".",
"train",
"(",
"trainingExtractedCandidates",
",",
"null",
",",
"true",
")",
";",
"}"
] | Trains on candidate pairs extracted from the corpus | [
"Trains",
"on",
"candidate",
"pairs",
"extracted",
"from",
"the",
"corpus"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AlignmentPredictionModel.java#L136-L150 |
141,312 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/POSVerb.java | POSVerb.getBiolexicon_id | public String getBiolexicon_id() {
if (POSVerb_Type.featOkTst && ((POSVerb_Type)jcasType).casFeat_biolexicon_id == null)
jcasType.jcas.throwFeatMissing("biolexicon_id", "ch.epfl.bbp.uima.types.POSVerb");
return jcasType.ll_cas.ll_getStringValue(addr, ((POSVerb_Type)jcasType).casFeatCode_biolexicon_id);} | java | public String getBiolexicon_id() {
if (POSVerb_Type.featOkTst && ((POSVerb_Type)jcasType).casFeat_biolexicon_id == null)
jcasType.jcas.throwFeatMissing("biolexicon_id", "ch.epfl.bbp.uima.types.POSVerb");
return jcasType.ll_cas.ll_getStringValue(addr, ((POSVerb_Type)jcasType).casFeatCode_biolexicon_id);} | [
"public",
"String",
"getBiolexicon_id",
"(",
")",
"{",
"if",
"(",
"POSVerb_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"POSVerb_Type",
")",
"jcasType",
")",
".",
"casFeat_biolexicon_id",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"biolexicon_id\"",
",",
"\"ch.epfl.bbp.uima.types.POSVerb\"",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getStringValue",
"(",
"addr",
",",
"(",
"(",
"POSVerb_Type",
")",
"jcasType",
")",
".",
"casFeatCode_biolexicon_id",
")",
";",
"}"
] | getter for biolexicon_id - gets
@generated
@return value of the feature | [
"getter",
"for",
"biolexicon_id",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/POSVerb.java#L86-L89 |
141,313 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/POSVerb.java | POSVerb.setBiolexicon_id | public void setBiolexicon_id(String v) {
if (POSVerb_Type.featOkTst && ((POSVerb_Type)jcasType).casFeat_biolexicon_id == null)
jcasType.jcas.throwFeatMissing("biolexicon_id", "ch.epfl.bbp.uima.types.POSVerb");
jcasType.ll_cas.ll_setStringValue(addr, ((POSVerb_Type)jcasType).casFeatCode_biolexicon_id, v);} | java | public void setBiolexicon_id(String v) {
if (POSVerb_Type.featOkTst && ((POSVerb_Type)jcasType).casFeat_biolexicon_id == null)
jcasType.jcas.throwFeatMissing("biolexicon_id", "ch.epfl.bbp.uima.types.POSVerb");
jcasType.ll_cas.ll_setStringValue(addr, ((POSVerb_Type)jcasType).casFeatCode_biolexicon_id, v);} | [
"public",
"void",
"setBiolexicon_id",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"POSVerb_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"POSVerb_Type",
")",
"jcasType",
")",
".",
"casFeat_biolexicon_id",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"biolexicon_id\"",
",",
"\"ch.epfl.bbp.uima.types.POSVerb\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setStringValue",
"(",
"addr",
",",
"(",
"(",
"POSVerb_Type",
")",
"jcasType",
")",
".",
"casFeatCode_biolexicon_id",
",",
"v",
")",
";",
"}"
] | setter for biolexicon_id - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"biolexicon_id",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/POSVerb.java#L95-L98 |
141,314 | BlueBrain/bluima | modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/model/Table.java | Table.setBody | public void setBody(String body)
{
String xbody = body;
String [] row = xbody.split("\n");
for(int i=0; i<row.length; i++){
this.m_xbody.add(row[i]);
}
} | java | public void setBody(String body)
{
String xbody = body;
String [] row = xbody.split("\n");
for(int i=0; i<row.length; i++){
this.m_xbody.add(row[i]);
}
} | [
"public",
"void",
"setBody",
"(",
"String",
"body",
")",
"{",
"String",
"xbody",
"=",
"body",
";",
"String",
"[",
"]",
"row",
"=",
"xbody",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"row",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"m_xbody",
".",
"add",
"(",
"row",
"[",
"i",
"]",
")",
";",
"}",
"}"
] | Sets the table body cells into an array
@param body
the table body content to set | [
"Sets",
"the",
"table",
"body",
"cells",
"into",
"an",
"array"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/model/Table.java#L231-L238 |
141,315 | BlueBrain/bluima | modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/model/Table.java | Table.setHeading | public void setHeading(String heading)
{
String m_heading = heading;
String [] preCol = m_heading.split("\n");
String [][] cells = new String[preCol.length][this.m_columnNumber];
for(int i=0; i<preCol.length; i++)
cells[i] = preCol[i].split(";", this.m_columnNumber);
for(int i=0; i<cells[0].length; i++)
{
String xhead = "";
for(int j=0; j<preCol.length; j++){
//if(cells[j][i]!=null)
xhead += (cells[j][i]+ " ");
}
this.m_xheading.add(xhead);
}
} | java | public void setHeading(String heading)
{
String m_heading = heading;
String [] preCol = m_heading.split("\n");
String [][] cells = new String[preCol.length][this.m_columnNumber];
for(int i=0; i<preCol.length; i++)
cells[i] = preCol[i].split(";", this.m_columnNumber);
for(int i=0; i<cells[0].length; i++)
{
String xhead = "";
for(int j=0; j<preCol.length; j++){
//if(cells[j][i]!=null)
xhead += (cells[j][i]+ " ");
}
this.m_xheading.add(xhead);
}
} | [
"public",
"void",
"setHeading",
"(",
"String",
"heading",
")",
"{",
"String",
"m_heading",
"=",
"heading",
";",
"String",
"[",
"]",
"preCol",
"=",
"m_heading",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"String",
"[",
"]",
"[",
"]",
"cells",
"=",
"new",
"String",
"[",
"preCol",
".",
"length",
"]",
"[",
"this",
".",
"m_columnNumber",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"preCol",
".",
"length",
";",
"i",
"++",
")",
"cells",
"[",
"i",
"]",
"=",
"preCol",
"[",
"i",
"]",
".",
"split",
"(",
"\";\"",
"",
",",
"this",
".",
"m_columnNumber",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cells",
"[",
"0",
"]",
".",
"length",
";",
"i",
"++",
")",
"{",
"String",
"xhead",
"=",
"\"\"",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"preCol",
".",
"length",
";",
"j",
"++",
")",
"{",
"//if(cells[j][i]!=null)\r",
"xhead",
"+=",
"(",
"cells",
"[",
"j",
"]",
"[",
"i",
"]",
"+",
"\" \"",
")",
";",
"}",
"this",
".",
"m_xheading",
".",
"add",
"(",
"xhead",
")",
";",
"}",
"}"
] | Sets the table heading rows
@param heading
the heading to set | [
"Sets",
"the",
"table",
"heading",
"rows"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/model/Table.java#L285-L307 |
141,316 | BlueBrain/bluima | modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/model/Table.java | Table.setValidTable | public void setValidTable(TableCandidate tc)
{
/**
* TODO [improve]: Table/TableCandidate not match
* */
this.setHeight(tc.getHeight());
this.setWidth(tc.getWidth());
this.setCaption(tc.getCaption());
this.setRowNumber(tc.getRows().size());
this.setColumnNumber(tc.getColumnNum_thisTable());
this.setRefTextList(tc.getRefText());
this.setFootNote(tc.getFootnoteText());
this.setHeading(tc.getColumnHeadings());
this.setBody(tc.getTableContent());
} | java | public void setValidTable(TableCandidate tc)
{
/**
* TODO [improve]: Table/TableCandidate not match
* */
this.setHeight(tc.getHeight());
this.setWidth(tc.getWidth());
this.setCaption(tc.getCaption());
this.setRowNumber(tc.getRows().size());
this.setColumnNumber(tc.getColumnNum_thisTable());
this.setRefTextList(tc.getRefText());
this.setFootNote(tc.getFootnoteText());
this.setHeading(tc.getColumnHeadings());
this.setBody(tc.getTableContent());
} | [
"public",
"void",
"setValidTable",
"(",
"TableCandidate",
"tc",
")",
"{",
"/**\r\n \t * TODO [improve]: Table/TableCandidate not match\r\n \t * */",
"this",
".",
"setHeight",
"(",
"tc",
".",
"getHeight",
"(",
")",
")",
";",
"this",
".",
"setWidth",
"(",
"tc",
".",
"getWidth",
"(",
")",
")",
";",
"this",
".",
"setCaption",
"(",
"tc",
".",
"getCaption",
"(",
")",
")",
";",
"this",
".",
"setRowNumber",
"(",
"tc",
".",
"getRows",
"(",
")",
".",
"size",
"(",
")",
")",
";",
"this",
".",
"setColumnNumber",
"(",
"tc",
".",
"getColumnNum_thisTable",
"(",
")",
")",
";",
"this",
".",
"setRefTextList",
"(",
"tc",
".",
"getRefText",
"(",
")",
")",
";",
"this",
".",
"setFootNote",
"(",
"tc",
".",
"getFootnoteText",
"(",
")",
")",
";",
"this",
".",
"setHeading",
"(",
"tc",
".",
"getColumnHeadings",
"(",
")",
")",
";",
"this",
".",
"setBody",
"(",
"tc",
".",
"getTableContent",
"(",
")",
")",
";",
"}"
] | Sets the metadata of a valid table
@param tc
TableCandidate | [
"Sets",
"the",
"metadata",
"of",
"a",
"valid",
"table"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/model/Table.java#L384-L399 |
141,317 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java | RelationMention.getLexical_condition | public String getLexical_condition() {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_lexical_condition == null)
jcasType.jcas.throwFeatMissing("lexical_condition", "de.julielab.jules.types.ace.RelationMention");
return jcasType.ll_cas.ll_getStringValue(addr, ((RelationMention_Type)jcasType).casFeatCode_lexical_condition);} | java | public String getLexical_condition() {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_lexical_condition == null)
jcasType.jcas.throwFeatMissing("lexical_condition", "de.julielab.jules.types.ace.RelationMention");
return jcasType.ll_cas.ll_getStringValue(addr, ((RelationMention_Type)jcasType).casFeatCode_lexical_condition);} | [
"public",
"String",
"getLexical_condition",
"(",
")",
"{",
"if",
"(",
"RelationMention_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeat_lexical_condition",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"lexical_condition\"",
",",
"\"de.julielab.jules.types.ace.RelationMention\"",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getStringValue",
"(",
"addr",
",",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeatCode_lexical_condition",
")",
";",
"}"
] | getter for lexical_condition - gets
@generated
@return value of the feature | [
"getter",
"for",
"lexical_condition",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java#L86-L89 |
141,318 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java | RelationMention.setLexical_condition | public void setLexical_condition(String v) {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_lexical_condition == null)
jcasType.jcas.throwFeatMissing("lexical_condition", "de.julielab.jules.types.ace.RelationMention");
jcasType.ll_cas.ll_setStringValue(addr, ((RelationMention_Type)jcasType).casFeatCode_lexical_condition, v);} | java | public void setLexical_condition(String v) {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_lexical_condition == null)
jcasType.jcas.throwFeatMissing("lexical_condition", "de.julielab.jules.types.ace.RelationMention");
jcasType.ll_cas.ll_setStringValue(addr, ((RelationMention_Type)jcasType).casFeatCode_lexical_condition, v);} | [
"public",
"void",
"setLexical_condition",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"RelationMention_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeat_lexical_condition",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"lexical_condition\"",
",",
"\"de.julielab.jules.types.ace.RelationMention\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setStringValue",
"(",
"addr",
",",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeatCode_lexical_condition",
",",
"v",
")",
";",
"}"
] | setter for lexical_condition - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"lexical_condition",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java#L95-L98 |
141,319 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java | RelationMention.getRelation_ref | public Relation getRelation_ref() {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_relation_ref == null)
jcasType.jcas.throwFeatMissing("relation_ref", "de.julielab.jules.types.ace.RelationMention");
return (Relation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((RelationMention_Type)jcasType).casFeatCode_relation_ref)));} | java | public Relation getRelation_ref() {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_relation_ref == null)
jcasType.jcas.throwFeatMissing("relation_ref", "de.julielab.jules.types.ace.RelationMention");
return (Relation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((RelationMention_Type)jcasType).casFeatCode_relation_ref)));} | [
"public",
"Relation",
"getRelation_ref",
"(",
")",
"{",
"if",
"(",
"RelationMention_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeat_relation_ref",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"relation_ref\"",
",",
"\"de.julielab.jules.types.ace.RelationMention\"",
")",
";",
"return",
"(",
"Relation",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeatCode_relation_ref",
")",
")",
")",
";",
"}"
] | getter for relation_ref - gets
@generated
@return value of the feature | [
"getter",
"for",
"relation_ref",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java#L152-L155 |
141,320 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java | RelationMention.setRelation_ref | public void setRelation_ref(Relation v) {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_relation_ref == null)
jcasType.jcas.throwFeatMissing("relation_ref", "de.julielab.jules.types.ace.RelationMention");
jcasType.ll_cas.ll_setRefValue(addr, ((RelationMention_Type)jcasType).casFeatCode_relation_ref, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setRelation_ref(Relation v) {
if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_relation_ref == null)
jcasType.jcas.throwFeatMissing("relation_ref", "de.julielab.jules.types.ace.RelationMention");
jcasType.ll_cas.ll_setRefValue(addr, ((RelationMention_Type)jcasType).casFeatCode_relation_ref, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setRelation_ref",
"(",
"Relation",
"v",
")",
"{",
"if",
"(",
"RelationMention_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeat_relation_ref",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"relation_ref\"",
",",
"\"de.julielab.jules.types.ace.RelationMention\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefValue",
"(",
"addr",
",",
"(",
"(",
"RelationMention_Type",
")",
"jcasType",
")",
".",
"casFeatCode_relation_ref",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | setter for relation_ref - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"relation_ref",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/RelationMention.java#L161-L164 |
141,321 | BlueBrain/bluima | modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java | ParseAnnotator.loadMappings | private void loadMappings() {
for (int i = 0; i < mappings.length; i++) {
String[] pair = mappings[i].split(";");
if (pair.length < 2) {
try {
throw new AnnotatorConfigurationException();
} catch (AnnotatorConfigurationException e) {
LOGGER.error("[OpenNLP Parser: ]" + e.getMessage());
e.printStackTrace();
}
} else {
String consTag = pair[0];
String casTag = pair[1];
mapTable.put(consTag, casTag);
}
}
} | java | private void loadMappings() {
for (int i = 0; i < mappings.length; i++) {
String[] pair = mappings[i].split(";");
if (pair.length < 2) {
try {
throw new AnnotatorConfigurationException();
} catch (AnnotatorConfigurationException e) {
LOGGER.error("[OpenNLP Parser: ]" + e.getMessage());
e.printStackTrace();
}
} else {
String consTag = pair[0];
String casTag = pair[1];
mapTable.put(consTag, casTag);
}
}
} | [
"private",
"void",
"loadMappings",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mappings",
".",
"length",
";",
"i",
"++",
")",
"{",
"String",
"[",
"]",
"pair",
"=",
"mappings",
"[",
"i",
"]",
".",
"split",
"(",
"\";\"",
")",
";",
"if",
"(",
"pair",
".",
"length",
"<",
"2",
")",
"{",
"try",
"{",
"throw",
"new",
"AnnotatorConfigurationException",
"(",
")",
";",
"}",
"catch",
"(",
"AnnotatorConfigurationException",
"e",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"[OpenNLP Parser: ]\"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"}",
"else",
"{",
"String",
"consTag",
"=",
"pair",
"[",
"0",
"]",
";",
"String",
"casTag",
"=",
"pair",
"[",
"1",
"]",
";",
"mapTable",
".",
"put",
"(",
"consTag",
",",
"casTag",
")",
";",
"}",
"}",
"}"
] | load mappings of constituent names | [
"load",
"mappings",
"of",
"constituent",
"names"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java#L285-L304 |
141,322 | BlueBrain/bluima | modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java | ParseAnnotator.annotate | private void annotate(Parse parse, JCas cas, Constituent parent)
throws SecurityException, IllegalArgumentException,
ClassNotFoundException, NoSuchMethodException,
InstantiationException, IllegalAccessException,
InvocationTargetException {
Constituent cons = null;
Span span = parse.getSpan();
String label = parse.getType();
String labelCat;
String[] funCatlabels = null;
if (!label.equals(ParserME.TOK_NODE)) {
int start = offsetMap.getMapping(span.getStart());
int end = offsetMap.getMapping(span.getEnd());
if (fun == true && label.contains("-")) {
funCatlabels = label.split("-");
labelCat = funCatlabels[0];
} else
labelCat = label;
String casLabel = mapTable.get(labelCat);
// if there is mapping between OpenNLP Parser constituent label and
// CAS label
if (casLabel != null) {
cons = (Constituent) AnnotationTools.getAnnotationByClassName(
cas, tagSet);
cons.setBegin(start);
cons.setEnd(end);
cons.setComponentId(COMPONENT_ID);
cons.setCat(casLabel);
Class c = cons.getClass();
makeFunAnnotations(cons, funCatlabels);
if (parent != null)
cons.setParent(parent);
cons.addToIndexes();
}
Parse[] children = parse.getChildren();
for (int i = 0; i < children.length; i++) {
annotate(children[i], cas, cons);
}
}
} | java | private void annotate(Parse parse, JCas cas, Constituent parent)
throws SecurityException, IllegalArgumentException,
ClassNotFoundException, NoSuchMethodException,
InstantiationException, IllegalAccessException,
InvocationTargetException {
Constituent cons = null;
Span span = parse.getSpan();
String label = parse.getType();
String labelCat;
String[] funCatlabels = null;
if (!label.equals(ParserME.TOK_NODE)) {
int start = offsetMap.getMapping(span.getStart());
int end = offsetMap.getMapping(span.getEnd());
if (fun == true && label.contains("-")) {
funCatlabels = label.split("-");
labelCat = funCatlabels[0];
} else
labelCat = label;
String casLabel = mapTable.get(labelCat);
// if there is mapping between OpenNLP Parser constituent label and
// CAS label
if (casLabel != null) {
cons = (Constituent) AnnotationTools.getAnnotationByClassName(
cas, tagSet);
cons.setBegin(start);
cons.setEnd(end);
cons.setComponentId(COMPONENT_ID);
cons.setCat(casLabel);
Class c = cons.getClass();
makeFunAnnotations(cons, funCatlabels);
if (parent != null)
cons.setParent(parent);
cons.addToIndexes();
}
Parse[] children = parse.getChildren();
for (int i = 0; i < children.length; i++) {
annotate(children[i], cas, cons);
}
}
} | [
"private",
"void",
"annotate",
"(",
"Parse",
"parse",
",",
"JCas",
"cas",
",",
"Constituent",
"parent",
")",
"throws",
"SecurityException",
",",
"IllegalArgumentException",
",",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"InstantiationException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Constituent",
"cons",
"=",
"null",
";",
"Span",
"span",
"=",
"parse",
".",
"getSpan",
"(",
")",
";",
"String",
"label",
"=",
"parse",
".",
"getType",
"(",
")",
";",
"String",
"labelCat",
";",
"String",
"[",
"]",
"funCatlabels",
"=",
"null",
";",
"if",
"(",
"!",
"label",
".",
"equals",
"(",
"ParserME",
".",
"TOK_NODE",
")",
")",
"{",
"int",
"start",
"=",
"offsetMap",
".",
"getMapping",
"(",
"span",
".",
"getStart",
"(",
")",
")",
";",
"int",
"end",
"=",
"offsetMap",
".",
"getMapping",
"(",
"span",
".",
"getEnd",
"(",
")",
")",
";",
"if",
"(",
"fun",
"==",
"true",
"&&",
"label",
".",
"contains",
"(",
"\"-\"",
")",
")",
"{",
"funCatlabels",
"=",
"label",
".",
"split",
"(",
"\"-\"",
")",
";",
"labelCat",
"=",
"funCatlabels",
"[",
"0",
"]",
";",
"}",
"else",
"labelCat",
"=",
"label",
";",
"String",
"casLabel",
"=",
"mapTable",
".",
"get",
"(",
"labelCat",
")",
";",
"// if there is mapping between OpenNLP Parser constituent label and",
"// CAS label",
"if",
"(",
"casLabel",
"!=",
"null",
")",
"{",
"cons",
"=",
"(",
"Constituent",
")",
"AnnotationTools",
".",
"getAnnotationByClassName",
"(",
"cas",
",",
"tagSet",
")",
";",
"cons",
".",
"setBegin",
"(",
"start",
")",
";",
"cons",
".",
"setEnd",
"(",
"end",
")",
";",
"cons",
".",
"setComponentId",
"(",
"COMPONENT_ID",
")",
";",
"cons",
".",
"setCat",
"(",
"casLabel",
")",
";",
"Class",
"c",
"=",
"cons",
".",
"getClass",
"(",
")",
";",
"makeFunAnnotations",
"(",
"cons",
",",
"funCatlabels",
")",
";",
"if",
"(",
"parent",
"!=",
"null",
")",
"cons",
".",
"setParent",
"(",
"parent",
")",
";",
"cons",
".",
"addToIndexes",
"(",
")",
";",
"}",
"Parse",
"[",
"]",
"children",
"=",
"parse",
".",
"getChildren",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"children",
".",
"length",
";",
"i",
"++",
")",
"{",
"annotate",
"(",
"children",
"[",
"i",
"]",
",",
"cas",
",",
"cons",
")",
";",
"}",
"}",
"}"
] | provide annotations from Parse result to CAS object | [
"provide",
"annotations",
"from",
"Parse",
"result",
"to",
"CAS",
"object"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java#L309-L361 |
141,323 | BlueBrain/bluima | modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java | ParseAnnotator.makeFunAnnotations | private void makeFunAnnotations(Constituent cons, String[] funCatLabels) {
if (funCatLabels != null && funCatLabels.length > 1) {
String labeltype;
for (int i = 1; i < funCatLabels.length; i++) {
labeltype = funTable.get(funCatLabels[i]);
if (labeltype != null) {
Class c = cons.getClass();
if (labeltype.equals("formFuncDisc")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons)
.setFormFuncDisc(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setFormFuncDisc(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons)
.setFormFuncDisc(funCatLabels[i]);
}
if (labeltype.equals("gramRole")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons)
.setGramRole(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setGramRole(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons)
.setGramRole(funCatLabels[i]);
}
if (labeltype.equals("adv")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons).setAdv(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setAdv(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons).setAdv(funCatLabels[i]);
}
if (labeltype.equals("misc")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons).setMisc(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setMisc(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons).setMisc(funCatLabels[i]);
}
if (labeltype.equals("syn")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons).setSyn(funCatLabels[i]);
}
}
}
}
} | java | private void makeFunAnnotations(Constituent cons, String[] funCatLabels) {
if (funCatLabels != null && funCatLabels.length > 1) {
String labeltype;
for (int i = 1; i < funCatLabels.length; i++) {
labeltype = funTable.get(funCatLabels[i]);
if (labeltype != null) {
Class c = cons.getClass();
if (labeltype.equals("formFuncDisc")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons)
.setFormFuncDisc(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setFormFuncDisc(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons)
.setFormFuncDisc(funCatLabels[i]);
}
if (labeltype.equals("gramRole")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons)
.setGramRole(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setGramRole(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons)
.setGramRole(funCatLabels[i]);
}
if (labeltype.equals("adv")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons).setAdv(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setAdv(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons).setAdv(funCatLabels[i]);
}
if (labeltype.equals("misc")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons).setMisc(funCatLabels[i]);
if (c.equals(PennBioIEConstituent.class))
((PennBioIEConstituent) cons)
.setMisc(funCatLabels[i]);
if (c.equals(PTBConstituent.class))
((PTBConstituent) cons).setMisc(funCatLabels[i]);
}
if (labeltype.equals("syn")) {
if (c.equals(GENIAConstituent.class))
((GENIAConstituent) cons).setSyn(funCatLabels[i]);
}
}
}
}
} | [
"private",
"void",
"makeFunAnnotations",
"(",
"Constituent",
"cons",
",",
"String",
"[",
"]",
"funCatLabels",
")",
"{",
"if",
"(",
"funCatLabels",
"!=",
"null",
"&&",
"funCatLabels",
".",
"length",
">",
"1",
")",
"{",
"String",
"labeltype",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"funCatLabels",
".",
"length",
";",
"i",
"++",
")",
"{",
"labeltype",
"=",
"funTable",
".",
"get",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"labeltype",
"!=",
"null",
")",
"{",
"Class",
"c",
"=",
"cons",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"labeltype",
".",
"equals",
"(",
"\"formFuncDisc\"",
")",
")",
"{",
"if",
"(",
"c",
".",
"equals",
"(",
"GENIAConstituent",
".",
"class",
")",
")",
"(",
"(",
"GENIAConstituent",
")",
"cons",
")",
".",
"setFormFuncDisc",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PennBioIEConstituent",
".",
"class",
")",
")",
"(",
"(",
"PennBioIEConstituent",
")",
"cons",
")",
".",
"setFormFuncDisc",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PTBConstituent",
".",
"class",
")",
")",
"(",
"(",
"PTBConstituent",
")",
"cons",
")",
".",
"setFormFuncDisc",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"}",
"if",
"(",
"labeltype",
".",
"equals",
"(",
"\"gramRole\"",
")",
")",
"{",
"if",
"(",
"c",
".",
"equals",
"(",
"GENIAConstituent",
".",
"class",
")",
")",
"(",
"(",
"GENIAConstituent",
")",
"cons",
")",
".",
"setGramRole",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PennBioIEConstituent",
".",
"class",
")",
")",
"(",
"(",
"PennBioIEConstituent",
")",
"cons",
")",
".",
"setGramRole",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PTBConstituent",
".",
"class",
")",
")",
"(",
"(",
"PTBConstituent",
")",
"cons",
")",
".",
"setGramRole",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"}",
"if",
"(",
"labeltype",
".",
"equals",
"(",
"\"adv\"",
")",
")",
"{",
"if",
"(",
"c",
".",
"equals",
"(",
"GENIAConstituent",
".",
"class",
")",
")",
"(",
"(",
"GENIAConstituent",
")",
"cons",
")",
".",
"setAdv",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PennBioIEConstituent",
".",
"class",
")",
")",
"(",
"(",
"PennBioIEConstituent",
")",
"cons",
")",
".",
"setAdv",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PTBConstituent",
".",
"class",
")",
")",
"(",
"(",
"PTBConstituent",
")",
"cons",
")",
".",
"setAdv",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"}",
"if",
"(",
"labeltype",
".",
"equals",
"(",
"\"misc\"",
")",
")",
"{",
"if",
"(",
"c",
".",
"equals",
"(",
"GENIAConstituent",
".",
"class",
")",
")",
"(",
"(",
"GENIAConstituent",
")",
"cons",
")",
".",
"setMisc",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PennBioIEConstituent",
".",
"class",
")",
")",
"(",
"(",
"PennBioIEConstituent",
")",
"cons",
")",
".",
"setMisc",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"if",
"(",
"c",
".",
"equals",
"(",
"PTBConstituent",
".",
"class",
")",
")",
"(",
"(",
"PTBConstituent",
")",
"cons",
")",
".",
"setMisc",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"}",
"if",
"(",
"labeltype",
".",
"equals",
"(",
"\"syn\"",
")",
")",
"{",
"if",
"(",
"c",
".",
"equals",
"(",
"GENIAConstituent",
".",
"class",
")",
")",
"(",
"(",
"GENIAConstituent",
")",
"cons",
")",
".",
"setSyn",
"(",
"funCatLabels",
"[",
"i",
"]",
")",
";",
"}",
"}",
"}",
"}",
"}"
] | make Fun annotations | [
"make",
"Fun",
"annotations"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java#L366-L428 |
141,324 | BlueBrain/bluima | modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java | ParseAnnotator.initBracketMap | private void initBracketMap() {
escMap.put("(", "-LRB-");
escMap.put(")", "-RRB-");
escMap.put("{", "-LCB-");
escMap.put("}", "-RCB-");
escMap.put("[", "-LSB-");
escMap.put("]", "-RSB-");
} | java | private void initBracketMap() {
escMap.put("(", "-LRB-");
escMap.put(")", "-RRB-");
escMap.put("{", "-LCB-");
escMap.put("}", "-RCB-");
escMap.put("[", "-LSB-");
escMap.put("]", "-RSB-");
} | [
"private",
"void",
"initBracketMap",
"(",
")",
"{",
"escMap",
".",
"put",
"(",
"\"(\"",
",",
"\"-LRB-\"",
")",
";",
"escMap",
".",
"put",
"(",
"\")\"",
",",
"\"-RRB-\"",
")",
";",
"escMap",
".",
"put",
"(",
"\"{\"",
",",
"\"-LCB-\"",
")",
";",
"escMap",
".",
"put",
"(",
"\"}\"",
",",
"\"-RCB-\"",
")",
";",
"escMap",
".",
"put",
"(",
"\"[\"",
",",
"\"-LSB-\"",
")",
";",
"escMap",
".",
"put",
"(",
"\"]\"",
",",
"\"-RSB-\"",
")",
";",
"}"
] | init table with charactets to be escaped | [
"init",
"table",
"with",
"charactets",
"to",
"be",
"escaped"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java#L434-L441 |
141,325 | BlueBrain/bluima | modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java | ParseAnnotator.initFunMap | private void initFunMap() {
funTable.put("ADV", "formFuncDisc");
funTable.put("NOM", "formFuncDisc");
funTable.put("DTV", "gramRole");
funTable.put("LGS", "gramRole");
funTable.put("PRD", "gramRole");
funTable.put("PUT", "gramRole");
funTable.put("SBJ", "gramRole");
funTable.put("VOC", "gramRole");
funTable.put("BNF", "adv");
funTable.put("DIR", "adv");
funTable.put("EXT", "adv");
funTable.put("LOC", "adv");
funTable.put("MNR", "adv");
funTable.put("PRP", "adv");
funTable.put("TMP", "adv");
funTable.put("CLR", "misc");
funTable.put("CLF", "misc");
funTable.put("HLN", "misc");
funTable.put("TTL", "misc");
funTable.put("COOD", "syn");
} | java | private void initFunMap() {
funTable.put("ADV", "formFuncDisc");
funTable.put("NOM", "formFuncDisc");
funTable.put("DTV", "gramRole");
funTable.put("LGS", "gramRole");
funTable.put("PRD", "gramRole");
funTable.put("PUT", "gramRole");
funTable.put("SBJ", "gramRole");
funTable.put("VOC", "gramRole");
funTable.put("BNF", "adv");
funTable.put("DIR", "adv");
funTable.put("EXT", "adv");
funTable.put("LOC", "adv");
funTable.put("MNR", "adv");
funTable.put("PRP", "adv");
funTable.put("TMP", "adv");
funTable.put("CLR", "misc");
funTable.put("CLF", "misc");
funTable.put("HLN", "misc");
funTable.put("TTL", "misc");
funTable.put("COOD", "syn");
} | [
"private",
"void",
"initFunMap",
"(",
")",
"{",
"funTable",
".",
"put",
"(",
"\"ADV\"",
",",
"\"formFuncDisc\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"NOM\"",
",",
"\"formFuncDisc\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"DTV\"",
",",
"\"gramRole\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"LGS\"",
",",
"\"gramRole\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"PRD\"",
",",
"\"gramRole\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"PUT\"",
",",
"\"gramRole\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"SBJ\"",
",",
"\"gramRole\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"VOC\"",
",",
"\"gramRole\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"BNF\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"DIR\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"EXT\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"LOC\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"MNR\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"PRP\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"TMP\"",
",",
"\"adv\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"CLR\"",
",",
"\"misc\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"CLF\"",
",",
"\"misc\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"HLN\"",
",",
"\"misc\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"TTL\"",
",",
"\"misc\"",
")",
";",
"funTable",
".",
"put",
"(",
"\"COOD\"",
",",
"\"syn\"",
")",
";",
"}"
] | init table wit fun tags and corresponfing attributes of a Constituent | [
"init",
"table",
"wit",
"fun",
"tags",
"and",
"corresponfing",
"attributes",
"of",
"a",
"Constituent"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/de/julielab/jules/ae/opennlp/ParseAnnotator.java#L447-L473 |
141,326 | BlueBrain/bluima | modules/bluima_bbp/src/main/java/ch/epfl/bbp/uima/ae/ExtractBrainregionsCoocurrences2.java | ExtractBrainregionsCoocurrences2.getLoadline | private String[] getLoadline(Pair<BrainRegion, BrainRegion> pair, int pmId) {
BrainRegion br1 = pair.getKey();
BrainRegion br2 = pair.getValue();
return new String[] {
pmId + "",//
br1.getCoveredText().replaceAll("(\\r|\\n|\\t)", ""),
br1.getBegin() + "",
br1.getEnd() + "",//
br2.getCoveredText().replaceAll("(\\r|\\n|\\t)", ""),
br2.getBegin() + "", br2.getEnd() + "" };
} | java | private String[] getLoadline(Pair<BrainRegion, BrainRegion> pair, int pmId) {
BrainRegion br1 = pair.getKey();
BrainRegion br2 = pair.getValue();
return new String[] {
pmId + "",//
br1.getCoveredText().replaceAll("(\\r|\\n|\\t)", ""),
br1.getBegin() + "",
br1.getEnd() + "",//
br2.getCoveredText().replaceAll("(\\r|\\n|\\t)", ""),
br2.getBegin() + "", br2.getEnd() + "" };
} | [
"private",
"String",
"[",
"]",
"getLoadline",
"(",
"Pair",
"<",
"BrainRegion",
",",
"BrainRegion",
">",
"pair",
",",
"int",
"pmId",
")",
"{",
"BrainRegion",
"br1",
"=",
"pair",
".",
"getKey",
"(",
")",
";",
"BrainRegion",
"br2",
"=",
"pair",
".",
"getValue",
"(",
")",
";",
"return",
"new",
"String",
"[",
"]",
"{",
"pmId",
"+",
"\"\"",
",",
"//",
"br1",
".",
"getCoveredText",
"(",
")",
".",
"replaceAll",
"(",
"\"(\\\\r|\\\\n|\\\\t)\"",
",",
"\"\"",
")",
",",
"br1",
".",
"getBegin",
"(",
")",
"+",
"\"\"",
",",
"br1",
".",
"getEnd",
"(",
")",
"+",
"\"\"",
",",
"//",
"br2",
".",
"getCoveredText",
"(",
")",
".",
"replaceAll",
"(",
"\"(\\\\r|\\\\n|\\\\t)\"",
",",
"\"\"",
")",
",",
"br2",
".",
"getBegin",
"(",
")",
"+",
"\"\"",
",",
"br2",
".",
"getEnd",
"(",
")",
"+",
"\"\"",
"}",
";",
"}"
] | `pubmed_id`,`region_1_name,`region_1_start`,`region_1_end`,`region_2_name
`,` region_2_start`,`region_2_end` | [
"pubmed_id",
"region_1_name",
"region_1_start",
"region_1_end",
"region_2_name",
"region_2_start",
"region_2_end"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_bbp/src/main/java/ch/epfl/bbp/uima/ae/ExtractBrainregionsCoocurrences2.java#L93-L105 |
141,327 | BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GISTrainer.java | GISTrainer.eval | public void eval(int[] context, double[] outsums) {
for (int oid = 0; oid < numOutcomes; oid++) {
outsums[oid] = iprob;
numfeats[oid] = 0;
}
int[] activeOutcomes;
double[] activeParameters;
for (int i = 0; i < context.length; i++) {
Context predParams = params[context[i]];
activeOutcomes = predParams.getOutcomes();
activeParameters = predParams.getParameters();
for (int j = 0; j < activeOutcomes.length; j++) {
int oid = activeOutcomes[j];
numfeats[oid]++;
outsums[oid] += constantInverse * activeParameters[j];
}
}
double SUM = 0.0;
for (int oid = 0; oid < numOutcomes; oid++) {
outsums[oid] = Math.exp(outsums[oid]);
if (_useSlackParameter) {
outsums[oid] += ((1.0 - ((double) numfeats[oid] / constant)) * correctionParam);
}
SUM += outsums[oid];
}
for (int oid = 0; oid < numOutcomes; oid++)
outsums[oid] /= SUM;
} | java | public void eval(int[] context, double[] outsums) {
for (int oid = 0; oid < numOutcomes; oid++) {
outsums[oid] = iprob;
numfeats[oid] = 0;
}
int[] activeOutcomes;
double[] activeParameters;
for (int i = 0; i < context.length; i++) {
Context predParams = params[context[i]];
activeOutcomes = predParams.getOutcomes();
activeParameters = predParams.getParameters();
for (int j = 0; j < activeOutcomes.length; j++) {
int oid = activeOutcomes[j];
numfeats[oid]++;
outsums[oid] += constantInverse * activeParameters[j];
}
}
double SUM = 0.0;
for (int oid = 0; oid < numOutcomes; oid++) {
outsums[oid] = Math.exp(outsums[oid]);
if (_useSlackParameter) {
outsums[oid] += ((1.0 - ((double) numfeats[oid] / constant)) * correctionParam);
}
SUM += outsums[oid];
}
for (int oid = 0; oid < numOutcomes; oid++)
outsums[oid] /= SUM;
} | [
"public",
"void",
"eval",
"(",
"int",
"[",
"]",
"context",
",",
"double",
"[",
"]",
"outsums",
")",
"{",
"for",
"(",
"int",
"oid",
"=",
"0",
";",
"oid",
"<",
"numOutcomes",
";",
"oid",
"++",
")",
"{",
"outsums",
"[",
"oid",
"]",
"=",
"iprob",
";",
"numfeats",
"[",
"oid",
"]",
"=",
"0",
";",
"}",
"int",
"[",
"]",
"activeOutcomes",
";",
"double",
"[",
"]",
"activeParameters",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"context",
".",
"length",
";",
"i",
"++",
")",
"{",
"Context",
"predParams",
"=",
"params",
"[",
"context",
"[",
"i",
"]",
"]",
";",
"activeOutcomes",
"=",
"predParams",
".",
"getOutcomes",
"(",
")",
";",
"activeParameters",
"=",
"predParams",
".",
"getParameters",
"(",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"activeOutcomes",
".",
"length",
";",
"j",
"++",
")",
"{",
"int",
"oid",
"=",
"activeOutcomes",
"[",
"j",
"]",
";",
"numfeats",
"[",
"oid",
"]",
"++",
";",
"outsums",
"[",
"oid",
"]",
"+=",
"constantInverse",
"*",
"activeParameters",
"[",
"j",
"]",
";",
"}",
"}",
"double",
"SUM",
"=",
"0.0",
";",
"for",
"(",
"int",
"oid",
"=",
"0",
";",
"oid",
"<",
"numOutcomes",
";",
"oid",
"++",
")",
"{",
"outsums",
"[",
"oid",
"]",
"=",
"Math",
".",
"exp",
"(",
"outsums",
"[",
"oid",
"]",
")",
";",
"if",
"(",
"_useSlackParameter",
")",
"{",
"outsums",
"[",
"oid",
"]",
"+=",
"(",
"(",
"1.0",
"-",
"(",
"(",
"double",
")",
"numfeats",
"[",
"oid",
"]",
"/",
"constant",
")",
")",
"*",
"correctionParam",
")",
";",
"}",
"SUM",
"+=",
"outsums",
"[",
"oid",
"]",
";",
"}",
"for",
"(",
"int",
"oid",
"=",
"0",
";",
"oid",
"<",
"numOutcomes",
";",
"oid",
"++",
")",
"outsums",
"[",
"oid",
"]",
"/=",
"SUM",
";",
"}"
] | Use this model to evaluate a context and populate the specified outsums array with the
likelihood of each outcome given that context.
@param context The integers of the predicates which have been
observed at the present decision point. | [
"Use",
"this",
"model",
"to",
"evaluate",
"a",
"context",
"and",
"populate",
"the",
"specified",
"outsums",
"array",
"with",
"the",
"likelihood",
"of",
"each",
"outcome",
"given",
"that",
"context",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GISTrainer.java#L349-L379 |
141,328 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java | DocumentBlock.getHasBold | public boolean getHasBold() {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasBold == null)
jcasType.jcas.throwFeatMissing("hasBold", "ch.epfl.bbp.uima.types.DocumentBlock");
return jcasType.ll_cas.ll_getBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasBold);} | java | public boolean getHasBold() {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasBold == null)
jcasType.jcas.throwFeatMissing("hasBold", "ch.epfl.bbp.uima.types.DocumentBlock");
return jcasType.ll_cas.ll_getBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasBold);} | [
"public",
"boolean",
"getHasBold",
"(",
")",
"{",
"if",
"(",
"DocumentBlock_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeat_hasBold",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"hasBold\"",
",",
"\"ch.epfl.bbp.uima.types.DocumentBlock\"",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getBooleanValue",
"(",
"addr",
",",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeatCode_hasBold",
")",
";",
"}"
] | getter for hasBold - gets
@generated
@return value of the feature | [
"getter",
"for",
"hasBold",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java#L85-L88 |
141,329 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java | DocumentBlock.setHasBold | public void setHasBold(boolean v) {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasBold == null)
jcasType.jcas.throwFeatMissing("hasBold", "ch.epfl.bbp.uima.types.DocumentBlock");
jcasType.ll_cas.ll_setBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasBold, v);} | java | public void setHasBold(boolean v) {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasBold == null)
jcasType.jcas.throwFeatMissing("hasBold", "ch.epfl.bbp.uima.types.DocumentBlock");
jcasType.ll_cas.ll_setBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasBold, v);} | [
"public",
"void",
"setHasBold",
"(",
"boolean",
"v",
")",
"{",
"if",
"(",
"DocumentBlock_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeat_hasBold",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"hasBold\"",
",",
"\"ch.epfl.bbp.uima.types.DocumentBlock\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setBooleanValue",
"(",
"addr",
",",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeatCode_hasBold",
",",
"v",
")",
";",
"}"
] | setter for hasBold - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"hasBold",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java#L94-L97 |
141,330 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java | DocumentBlock.getHasManyFontsizes | public boolean getHasManyFontsizes() {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasManyFontsizes == null)
jcasType.jcas.throwFeatMissing("hasManyFontsizes", "ch.epfl.bbp.uima.types.DocumentBlock");
return jcasType.ll_cas.ll_getBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasManyFontsizes);} | java | public boolean getHasManyFontsizes() {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasManyFontsizes == null)
jcasType.jcas.throwFeatMissing("hasManyFontsizes", "ch.epfl.bbp.uima.types.DocumentBlock");
return jcasType.ll_cas.ll_getBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasManyFontsizes);} | [
"public",
"boolean",
"getHasManyFontsizes",
"(",
")",
"{",
"if",
"(",
"DocumentBlock_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeat_hasManyFontsizes",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"hasManyFontsizes\"",
",",
"\"ch.epfl.bbp.uima.types.DocumentBlock\"",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getBooleanValue",
"(",
"addr",
",",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeatCode_hasManyFontsizes",
")",
";",
"}"
] | getter for hasManyFontsizes - gets
@generated
@return value of the feature | [
"getter",
"for",
"hasManyFontsizes",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java#L107-L110 |
141,331 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java | DocumentBlock.setHasManyFontsizes | public void setHasManyFontsizes(boolean v) {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasManyFontsizes == null)
jcasType.jcas.throwFeatMissing("hasManyFontsizes", "ch.epfl.bbp.uima.types.DocumentBlock");
jcasType.ll_cas.ll_setBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasManyFontsizes, v);} | java | public void setHasManyFontsizes(boolean v) {
if (DocumentBlock_Type.featOkTst && ((DocumentBlock_Type)jcasType).casFeat_hasManyFontsizes == null)
jcasType.jcas.throwFeatMissing("hasManyFontsizes", "ch.epfl.bbp.uima.types.DocumentBlock");
jcasType.ll_cas.ll_setBooleanValue(addr, ((DocumentBlock_Type)jcasType).casFeatCode_hasManyFontsizes, v);} | [
"public",
"void",
"setHasManyFontsizes",
"(",
"boolean",
"v",
")",
"{",
"if",
"(",
"DocumentBlock_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeat_hasManyFontsizes",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"hasManyFontsizes\"",
",",
"\"ch.epfl.bbp.uima.types.DocumentBlock\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setBooleanValue",
"(",
"addr",
",",
"(",
"(",
"DocumentBlock_Type",
")",
"jcasType",
")",
".",
"casFeatCode_hasManyFontsizes",
",",
"v",
")",
";",
"}"
] | setter for hasManyFontsizes - sets
@generated
@param v value to set into the feature | [
"setter",
"for",
"hasManyFontsizes",
"-",
"sets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentBlock.java#L116-L119 |
141,332 | BlueBrain/bluima | modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/AppGroup.java | AppGroup.getAppOrRefList | public java.util.List<Object> getAppOrRefList() {
if (appOrRefList == null) {
appOrRefList = new ArrayList<Object>();
}
return this.appOrRefList;
} | java | public java.util.List<Object> getAppOrRefList() {
if (appOrRefList == null) {
appOrRefList = new ArrayList<Object>();
}
return this.appOrRefList;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"Object",
">",
"getAppOrRefList",
"(",
")",
"{",
"if",
"(",
"appOrRefList",
"==",
"null",
")",
"{",
"appOrRefList",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"}",
"return",
"this",
".",
"appOrRefList",
";",
"}"
] | Gets the value of the appOrRefList property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the appOrRefList property.
<p>
For example, to add a new item, do as follows:
<pre>
getAppOrRefList().add(newItem);
</pre>
<p>
Objects of the following type(s) are allowed in the list
{@link App }
{@link RefList } | [
"Gets",
"the",
"value",
"of",
"the",
"appOrRefList",
"property",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/AppGroup.java#L269-L274 |
141,333 | BlueBrain/bluima | modules/bluima_jsre/src/main/java/org/itc/irst/tcc/sre/data/SentenceSet2VectorSet.java | SentenceSet2VectorSet.getHelp | private static String getHelp()
{
StringBuffer sb = new StringBuffer();
// SRE
sb.append("\njSRE: Simple Relation Extraction V1.10\t 30.08.06\n");
sb.append("developed by Claudio Giuliano (giuliano@itc.it)\n\n");
// License
sb.append("Copyright 2005 FBK-irst (http://www.fbk.eu)\n");
sb.append("\n");
sb.append("Licensed under the Apache License, Version 2.0 (the \"License\");\n");
sb.append("you may not use this file except in compliance with the License.\n");
sb.append("You may obtain a copy of the License at\n");
sb.append("\n");
sb.append(" http://www.apache.org/licenses/LICENSE-2.0\n");
sb.append("\n");
sb.append("Unless required by applicable law or agreed to in writing, software\n");
sb.append("distributed under the License is distributed on an \"AS IS\" BASIS,\n");
sb.append("WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n");
sb.append("See the License for the specific language governing permissions and\n");
sb.append("limitations under the License.\n\n");
// Usage
sb.append("Usage: java org.itc.irst.tcc.sre.SentenceSet2VectorSet [options] example-file model-file output-file\n\n");
// Arguments
sb.append("Arguments:\n");
sb.append("\ttest-file\t-> file with test data (SRE format)\n");
sb.append("\tmodel-file\t-> file from which to load the learned model\n");
sb.append("\toutput-file\t-> file in which to store resulting output\n");
sb.append("Options:\n");
sb.append("\t-h\t\t-> this help\n");
return sb.toString();
} | java | private static String getHelp()
{
StringBuffer sb = new StringBuffer();
// SRE
sb.append("\njSRE: Simple Relation Extraction V1.10\t 30.08.06\n");
sb.append("developed by Claudio Giuliano (giuliano@itc.it)\n\n");
// License
sb.append("Copyright 2005 FBK-irst (http://www.fbk.eu)\n");
sb.append("\n");
sb.append("Licensed under the Apache License, Version 2.0 (the \"License\");\n");
sb.append("you may not use this file except in compliance with the License.\n");
sb.append("You may obtain a copy of the License at\n");
sb.append("\n");
sb.append(" http://www.apache.org/licenses/LICENSE-2.0\n");
sb.append("\n");
sb.append("Unless required by applicable law or agreed to in writing, software\n");
sb.append("distributed under the License is distributed on an \"AS IS\" BASIS,\n");
sb.append("WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n");
sb.append("See the License for the specific language governing permissions and\n");
sb.append("limitations under the License.\n\n");
// Usage
sb.append("Usage: java org.itc.irst.tcc.sre.SentenceSet2VectorSet [options] example-file model-file output-file\n\n");
// Arguments
sb.append("Arguments:\n");
sb.append("\ttest-file\t-> file with test data (SRE format)\n");
sb.append("\tmodel-file\t-> file from which to load the learned model\n");
sb.append("\toutput-file\t-> file in which to store resulting output\n");
sb.append("Options:\n");
sb.append("\t-h\t\t-> this help\n");
return sb.toString();
} | [
"private",
"static",
"String",
"getHelp",
"(",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// SRE",
"sb",
".",
"append",
"(",
"\"\\njSRE: Simple Relation Extraction V1.10\\t 30.08.06\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"developed by Claudio Giuliano (giuliano@itc.it)\\n\\n\"",
")",
";",
"// License",
"sb",
".",
"append",
"(",
"\"Copyright 2005 FBK-irst (http://www.fbk.eu)\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"you may not use this file except in compliance with the License.\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"You may obtain a copy of the License at\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\" http://www.apache.org/licenses/LICENSE-2.0\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"Unless required by applicable law or agreed to in writing, software\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"See the License for the specific language governing permissions and\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"limitations under the License.\\n\\n\"",
")",
";",
"// Usage",
"sb",
".",
"append",
"(",
"\"Usage: java org.itc.irst.tcc.sre.SentenceSet2VectorSet [options] example-file model-file output-file\\n\\n\"",
")",
";",
"// Arguments",
"sb",
".",
"append",
"(",
"\"Arguments:\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\ttest-file\\t-> file with test data (SRE format)\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\tmodel-file\\t-> file from which to load the learned model\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\toutput-file\\t-> file in which to store resulting output\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"Options:\\n\"",
")",
";",
"sb",
".",
"append",
"(",
"\"\\t-h\\t\\t-> this help\\n\"",
")",
";",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] | Returns a command-line help.
return a command-line help. | [
"Returns",
"a",
"command",
"-",
"line",
"help",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_jsre/src/main/java/org/itc/irst/tcc/sre/data/SentenceSet2VectorSet.java#L262-L298 |
141,334 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.clear | public void clear(String what)
{
if (what.equals("blockers")) blockers.clear();
else if (what.equals("datasets")) datasets.clear();
else if (what.equals("learners")) learners.clear();
else if (what.equals("all")) {
clear("blockers"); clear("datasets"); clear("learners");
} else {
System.out.println("usage: clear blockers|datasets|learners|all");
}
} | java | public void clear(String what)
{
if (what.equals("blockers")) blockers.clear();
else if (what.equals("datasets")) datasets.clear();
else if (what.equals("learners")) learners.clear();
else if (what.equals("all")) {
clear("blockers"); clear("datasets"); clear("learners");
} else {
System.out.println("usage: clear blockers|datasets|learners|all");
}
} | [
"public",
"void",
"clear",
"(",
"String",
"what",
")",
"{",
"if",
"(",
"what",
".",
"equals",
"(",
"\"blockers\"",
")",
")",
"blockers",
".",
"clear",
"(",
")",
";",
"else",
"if",
"(",
"what",
".",
"equals",
"(",
"\"datasets\"",
")",
")",
"datasets",
".",
"clear",
"(",
")",
";",
"else",
"if",
"(",
"what",
".",
"equals",
"(",
"\"learners\"",
")",
")",
"learners",
".",
"clear",
"(",
")",
";",
"else",
"if",
"(",
"what",
".",
"equals",
"(",
"\"all\"",
")",
")",
"{",
"clear",
"(",
"\"blockers\"",
")",
";",
"clear",
"(",
"\"datasets\"",
")",
";",
"clear",
"(",
"\"learners\"",
")",
";",
"}",
"else",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"usage: clear blockers|datasets|learners|all\"",
")",
";",
"}",
"}"
] | Clear datasets, blockers, or learners. | [
"Clear",
"datasets",
"blockers",
"or",
"learners",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L64-L74 |
141,335 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.show | public void show(String what)
{
if (what.equals("blockers")) showList("blockers",blockerNames);
else if (what.equals("datasets")) showList("datasets", datasetNames);
else if (what.equals("learners")) showList("learners", learnerNames);
else if (what.equals("all")) {
show("blockers"); show("datasets"); show("learners");
} else {
System.out.println("usage: show blockers|datasets|learners|all");
}
} | java | public void show(String what)
{
if (what.equals("blockers")) showList("blockers",blockerNames);
else if (what.equals("datasets")) showList("datasets", datasetNames);
else if (what.equals("learners")) showList("learners", learnerNames);
else if (what.equals("all")) {
show("blockers"); show("datasets"); show("learners");
} else {
System.out.println("usage: show blockers|datasets|learners|all");
}
} | [
"public",
"void",
"show",
"(",
"String",
"what",
")",
"{",
"if",
"(",
"what",
".",
"equals",
"(",
"\"blockers\"",
")",
")",
"showList",
"(",
"\"blockers\"",
",",
"blockerNames",
")",
";",
"else",
"if",
"(",
"what",
".",
"equals",
"(",
"\"datasets\"",
")",
")",
"showList",
"(",
"\"datasets\"",
",",
"datasetNames",
")",
";",
"else",
"if",
"(",
"what",
".",
"equals",
"(",
"\"learners\"",
")",
")",
"showList",
"(",
"\"learners\"",
",",
"learnerNames",
")",
";",
"else",
"if",
"(",
"what",
".",
"equals",
"(",
"\"all\"",
")",
")",
"{",
"show",
"(",
"\"blockers\"",
")",
";",
"show",
"(",
"\"datasets\"",
")",
";",
"show",
"(",
"\"learners\"",
")",
";",
"}",
"else",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"usage: show blockers|datasets|learners|all\"",
")",
";",
"}",
"}"
] | Show datasets, blockers, or learners. | [
"Show",
"datasets",
"blockers",
"or",
"learners",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L77-L87 |
141,336 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.dataset | public void dataset(String dataFile) throws MatchData.InputFormatException
{
datasets.add( new MatchData(dataFile) );
datasetNames.add( dataFile );
expt = null;
} | java | public void dataset(String dataFile) throws MatchData.InputFormatException
{
datasets.add( new MatchData(dataFile) );
datasetNames.add( dataFile );
expt = null;
} | [
"public",
"void",
"dataset",
"(",
"String",
"dataFile",
")",
"throws",
"MatchData",
".",
"InputFormatException",
"{",
"datasets",
".",
"add",
"(",
"new",
"MatchData",
"(",
"dataFile",
")",
")",
";",
"datasetNames",
".",
"add",
"(",
"dataFile",
")",
";",
"expt",
"=",
"null",
";",
"}"
] | Load a dataset. | [
"Load",
"a",
"dataset",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L103-L108 |
141,337 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.learner | public void learner(String learnerClass)
{
learners.add( DistanceLearnerFactory.build( learnerClass ));
learnerNames.add( learnerClass );
expt = null;
} | java | public void learner(String learnerClass)
{
learners.add( DistanceLearnerFactory.build( learnerClass ));
learnerNames.add( learnerClass );
expt = null;
} | [
"public",
"void",
"learner",
"(",
"String",
"learnerClass",
")",
"{",
"learners",
".",
"add",
"(",
"DistanceLearnerFactory",
".",
"build",
"(",
"learnerClass",
")",
")",
";",
"learnerNames",
".",
"add",
"(",
"learnerClass",
")",
";",
"expt",
"=",
"null",
";",
"}"
] | Load a learner. | [
"Load",
"a",
"learner",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L111-L116 |
141,338 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.blocker | public void blocker(String blockerClass)
throws ClassNotFoundException,InstantiationException,IllegalAccessException
{
blockers.add( Class.forName(BLOCKER_PACKAGE+blockerClass).newInstance() );
blockerNames.add( blockerClass );
expt = null;
} | java | public void blocker(String blockerClass)
throws ClassNotFoundException,InstantiationException,IllegalAccessException
{
blockers.add( Class.forName(BLOCKER_PACKAGE+blockerClass).newInstance() );
blockerNames.add( blockerClass );
expt = null;
} | [
"public",
"void",
"blocker",
"(",
"String",
"blockerClass",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"blockers",
".",
"add",
"(",
"Class",
".",
"forName",
"(",
"BLOCKER_PACKAGE",
"+",
"blockerClass",
")",
".",
"newInstance",
"(",
")",
")",
";",
"blockerNames",
".",
"add",
"(",
"blockerClass",
")",
";",
"expt",
"=",
"null",
";",
"}"
] | Load a blocker. | [
"Load",
"a",
"blocker",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L127-L133 |
141,339 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.blocker | public void blocker(String blockerClass, String param, String value)
throws ClassNotFoundException,InstantiationException,IllegalAccessException,
InvocationTargetException,NoSuchMethodException
{
Blocker blocker = (Blocker)Class.forName(BLOCKER_PACKAGE+blockerClass).newInstance();
// upperCase the first letter of param
param = param.substring(0,1).toUpperCase() + param.substring(1,param.length());
Method m = blocker.getClass().getMethod("set"+param, new Class[] { Boolean.class });
m.invoke( blocker, new Object[]{ Boolean.valueOf(value) } );
blockers.add( blocker );
blockerNames.add( blockerClass );
expt = null;
} | java | public void blocker(String blockerClass, String param, String value)
throws ClassNotFoundException,InstantiationException,IllegalAccessException,
InvocationTargetException,NoSuchMethodException
{
Blocker blocker = (Blocker)Class.forName(BLOCKER_PACKAGE+blockerClass).newInstance();
// upperCase the first letter of param
param = param.substring(0,1).toUpperCase() + param.substring(1,param.length());
Method m = blocker.getClass().getMethod("set"+param, new Class[] { Boolean.class });
m.invoke( blocker, new Object[]{ Boolean.valueOf(value) } );
blockers.add( blocker );
blockerNames.add( blockerClass );
expt = null;
} | [
"public",
"void",
"blocker",
"(",
"String",
"blockerClass",
",",
"String",
"param",
",",
"String",
"value",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"NoSuchMethodException",
"{",
"Blocker",
"blocker",
"=",
"(",
"Blocker",
")",
"Class",
".",
"forName",
"(",
"BLOCKER_PACKAGE",
"+",
"blockerClass",
")",
".",
"newInstance",
"(",
")",
";",
"// upperCase the first letter of param",
"param",
"=",
"param",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")",
"+",
"param",
".",
"substring",
"(",
"1",
",",
"param",
".",
"length",
"(",
")",
")",
";",
"Method",
"m",
"=",
"blocker",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"set\"",
"+",
"param",
",",
"new",
"Class",
"[",
"]",
"{",
"Boolean",
".",
"class",
"}",
")",
";",
"m",
".",
"invoke",
"(",
"blocker",
",",
"new",
"Object",
"[",
"]",
"{",
"Boolean",
".",
"valueOf",
"(",
"value",
")",
"}",
")",
";",
"blockers",
".",
"add",
"(",
"blocker",
")",
";",
"blockerNames",
".",
"add",
"(",
"blockerClass",
")",
";",
"expt",
"=",
"null",
";",
"}"
] | Load a blocker, with optional boolean value | [
"Load",
"a",
"blocker",
"with",
"optional",
"boolean",
"value"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L136-L148 |
141,340 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.compute | public void compute()
{
if (!computable) {
throw new RuntimeException("can't re-'compute' experiment results after a 'restore'");
}
expt = new MatchExpt[blockers.size()][learners.size()][datasets.size()];
for (int i=0; i<blockers.size(); i++) {
Blocker blocker = (Blocker)blockers.get(i);
for (int j=0; j<learners.size(); j++) {
StringDistanceLearner distance = (StringDistanceLearner)learners.get(j);
for (int k=0; k<datasets.size(); k++) {
MatchData dataset = (MatchData)datasets.get(k);
expt[i][j][k] = new MatchExpt(dataset,distance,blocker);
}
}
}
} | java | public void compute()
{
if (!computable) {
throw new RuntimeException("can't re-'compute' experiment results after a 'restore'");
}
expt = new MatchExpt[blockers.size()][learners.size()][datasets.size()];
for (int i=0; i<blockers.size(); i++) {
Blocker blocker = (Blocker)blockers.get(i);
for (int j=0; j<learners.size(); j++) {
StringDistanceLearner distance = (StringDistanceLearner)learners.get(j);
for (int k=0; k<datasets.size(); k++) {
MatchData dataset = (MatchData)datasets.get(k);
expt[i][j][k] = new MatchExpt(dataset,distance,blocker);
}
}
}
} | [
"public",
"void",
"compute",
"(",
")",
"{",
"if",
"(",
"!",
"computable",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"can't re-'compute' experiment results after a 'restore'\"",
")",
";",
"}",
"expt",
"=",
"new",
"MatchExpt",
"[",
"blockers",
".",
"size",
"(",
")",
"]",
"[",
"learners",
".",
"size",
"(",
")",
"]",
"[",
"datasets",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"blockers",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Blocker",
"blocker",
"=",
"(",
"Blocker",
")",
"blockers",
".",
"get",
"(",
"i",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"learners",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"StringDistanceLearner",
"distance",
"=",
"(",
"StringDistanceLearner",
")",
"learners",
".",
"get",
"(",
"j",
")",
";",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"datasets",
".",
"size",
"(",
")",
";",
"k",
"++",
")",
"{",
"MatchData",
"dataset",
"=",
"(",
"MatchData",
")",
"datasets",
".",
"get",
"(",
"k",
")",
";",
"expt",
"[",
"i",
"]",
"[",
"j",
"]",
"[",
"k",
"]",
"=",
"new",
"MatchExpt",
"(",
"dataset",
",",
"distance",
",",
"blocker",
")",
";",
"}",
"}",
"}",
"}"
] | Compute learners. | [
"Compute",
"learners",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L151-L167 |
141,341 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.table | public void table(String what) throws NoSuchMethodException,IllegalAccessException,InvocationTargetException
{
PrintfFormat dfmt = new PrintfFormat("Dataset %2d:");
PrintfFormat fmt = new PrintfFormat(" %9.5f ");
PrintfFormat nfmt = new PrintfFormat(" %11s");
if (expt==null) compute();
for (int i=0; i<blockerNames.size(); i++) {
System.out.println("\nblocker: "+blockerNames.get(i)+"\n");
System.out.print(" ");
for (int j=0; j<learnerNames.size(); j++) {
String s = (String)learnerNames.get(j);
if (s.length()>11) s = s.substring(0,11);
System.out.print( nfmt.sprintf(s) );
}
System.out.println();
double[] average = new double[learnerNames.size()];
for (int k=0; k<datasetNames.size(); k++) {
System.out.print( dfmt.sprintf(k+1));
for (int j=0; j<learnerNames.size(); j++) {
Method m = MatchExpt.class.getMethod(what, new Class[] {});
Double d = (Double)m.invoke(expt[i][j][k], new Object[]{});
System.out.print( fmt.sprintf(d) );
average[j] += d.doubleValue();
}
System.out.print("\n");
}
System.out.print( " Average:");
for (int j=0; j<learnerNames.size(); j++) {
System.out.print( fmt.sprintf( average[j]/datasetNames.size() ) );
}
System.out.print("\n\n");
}
} | java | public void table(String what) throws NoSuchMethodException,IllegalAccessException,InvocationTargetException
{
PrintfFormat dfmt = new PrintfFormat("Dataset %2d:");
PrintfFormat fmt = new PrintfFormat(" %9.5f ");
PrintfFormat nfmt = new PrintfFormat(" %11s");
if (expt==null) compute();
for (int i=0; i<blockerNames.size(); i++) {
System.out.println("\nblocker: "+blockerNames.get(i)+"\n");
System.out.print(" ");
for (int j=0; j<learnerNames.size(); j++) {
String s = (String)learnerNames.get(j);
if (s.length()>11) s = s.substring(0,11);
System.out.print( nfmt.sprintf(s) );
}
System.out.println();
double[] average = new double[learnerNames.size()];
for (int k=0; k<datasetNames.size(); k++) {
System.out.print( dfmt.sprintf(k+1));
for (int j=0; j<learnerNames.size(); j++) {
Method m = MatchExpt.class.getMethod(what, new Class[] {});
Double d = (Double)m.invoke(expt[i][j][k], new Object[]{});
System.out.print( fmt.sprintf(d) );
average[j] += d.doubleValue();
}
System.out.print("\n");
}
System.out.print( " Average:");
for (int j=0; j<learnerNames.size(); j++) {
System.out.print( fmt.sprintf( average[j]/datasetNames.size() ) );
}
System.out.print("\n\n");
}
} | [
"public",
"void",
"table",
"(",
"String",
"what",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"PrintfFormat",
"dfmt",
"=",
"new",
"PrintfFormat",
"(",
"\"Dataset %2d:\"",
")",
";",
"PrintfFormat",
"fmt",
"=",
"new",
"PrintfFormat",
"(",
"\" %9.5f \"",
")",
";",
"PrintfFormat",
"nfmt",
"=",
"new",
"PrintfFormat",
"(",
"\" %11s\"",
")",
";",
"if",
"(",
"expt",
"==",
"null",
")",
"compute",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"blockerNames",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"\\nblocker: \"",
"+",
"blockerNames",
".",
"get",
"(",
"i",
")",
"+",
"\"\\n\"",
")",
";",
"System",
".",
"out",
".",
"print",
"(",
"\" \"",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"learnerNames",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"String",
"s",
"=",
"(",
"String",
")",
"learnerNames",
".",
"get",
"(",
"j",
")",
";",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"11",
")",
"s",
"=",
"s",
".",
"substring",
"(",
"0",
",",
"11",
")",
";",
"System",
".",
"out",
".",
"print",
"(",
"nfmt",
".",
"sprintf",
"(",
"s",
")",
")",
";",
"}",
"System",
".",
"out",
".",
"println",
"(",
")",
";",
"double",
"[",
"]",
"average",
"=",
"new",
"double",
"[",
"learnerNames",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"datasetNames",
".",
"size",
"(",
")",
";",
"k",
"++",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"dfmt",
".",
"sprintf",
"(",
"k",
"+",
"1",
")",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"learnerNames",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"Method",
"m",
"=",
"MatchExpt",
".",
"class",
".",
"getMethod",
"(",
"what",
",",
"new",
"Class",
"[",
"]",
"{",
"}",
")",
";",
"Double",
"d",
"=",
"(",
"Double",
")",
"m",
".",
"invoke",
"(",
"expt",
"[",
"i",
"]",
"[",
"j",
"]",
"[",
"k",
"]",
",",
"new",
"Object",
"[",
"]",
"{",
"}",
")",
";",
"System",
".",
"out",
".",
"print",
"(",
"fmt",
".",
"sprintf",
"(",
"d",
")",
")",
";",
"average",
"[",
"j",
"]",
"+=",
"d",
".",
"doubleValue",
"(",
")",
";",
"}",
"System",
".",
"out",
".",
"print",
"(",
"\"\\n\"",
")",
";",
"}",
"System",
".",
"out",
".",
"print",
"(",
"\" Average:\"",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"learnerNames",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"fmt",
".",
"sprintf",
"(",
"average",
"[",
"j",
"]",
"/",
"datasetNames",
".",
"size",
"(",
")",
")",
")",
";",
"}",
"System",
".",
"out",
".",
"print",
"(",
"\"\\n\\n\"",
")",
";",
"}",
"}"
] | Show a table of some expt-wide numeric measurement. | [
"Show",
"a",
"table",
"of",
"some",
"expt",
"-",
"wide",
"numeric",
"measurement",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L170-L202 |
141,342 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.save | public void save(String file) throws IOException,FileNotFoundException
{
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(blockerNames);
oos.writeObject(datasetNames);
oos.writeObject(learnerNames);
oos.writeObject(expt);
oos.close();
} | java | public void save(String file) throws IOException,FileNotFoundException
{
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(blockerNames);
oos.writeObject(datasetNames);
oos.writeObject(learnerNames);
oos.writeObject(expt);
oos.close();
} | [
"public",
"void",
"save",
"(",
"String",
"file",
")",
"throws",
"IOException",
",",
"FileNotFoundException",
"{",
"ObjectOutputStream",
"oos",
"=",
"new",
"ObjectOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
";",
"oos",
".",
"writeObject",
"(",
"blockerNames",
")",
";",
"oos",
".",
"writeObject",
"(",
"datasetNames",
")",
";",
"oos",
".",
"writeObject",
"(",
"learnerNames",
")",
";",
"oos",
".",
"writeObject",
"(",
"expt",
")",
";",
"oos",
".",
"close",
"(",
")",
";",
"}"
] | Save current experimental data to a file | [
"Save",
"current",
"experimental",
"data",
"to",
"a",
"file"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L252-L260 |
141,343 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.restore | public void restore(String file) throws IOException,FileNotFoundException,ClassNotFoundException
{
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file));
blockerNames = (List)ois.readObject();
datasetNames = (List)ois.readObject();
learnerNames = (List)ois.readObject();
expt = (MatchExpt[][][]) ois.readObject();
computable = false;
ois.close();
} | java | public void restore(String file) throws IOException,FileNotFoundException,ClassNotFoundException
{
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file));
blockerNames = (List)ois.readObject();
datasetNames = (List)ois.readObject();
learnerNames = (List)ois.readObject();
expt = (MatchExpt[][][]) ois.readObject();
computable = false;
ois.close();
} | [
"public",
"void",
"restore",
"(",
"String",
"file",
")",
"throws",
"IOException",
",",
"FileNotFoundException",
",",
"ClassNotFoundException",
"{",
"ObjectInputStream",
"ois",
"=",
"new",
"ObjectInputStream",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
")",
";",
"blockerNames",
"=",
"(",
"List",
")",
"ois",
".",
"readObject",
"(",
")",
";",
"datasetNames",
"=",
"(",
"List",
")",
"ois",
".",
"readObject",
"(",
")",
";",
"learnerNames",
"=",
"(",
"List",
")",
"ois",
".",
"readObject",
"(",
")",
";",
"expt",
"=",
"(",
"MatchExpt",
"[",
"]",
"[",
"]",
"[",
"]",
")",
"ois",
".",
"readObject",
"(",
")",
";",
"computable",
"=",
"false",
";",
"ois",
".",
"close",
"(",
")",
";",
"}"
] | Restore experimental data previously 'saved' toa file. It will
be possible to analyze this data with 'table' commands and etc,
but not to perform additional experiments. | [
"Restore",
"experimental",
"data",
"previously",
"saved",
"toa",
"file",
".",
"It",
"will",
"be",
"possible",
"to",
"analyze",
"this",
"data",
"with",
"table",
"commands",
"and",
"etc",
"but",
"not",
"to",
"perform",
"additional",
"experiments",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L266-L275 |
141,344 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.runScript | public void runScript(String configFileName)
{
int lineNum = 0;
try {
BufferedReader in = new BufferedReader(new FileReader(configFileName));
String line;
while ((line = in.readLine())!=null) {
lineNum++;
if (!line.startsWith("#")) {
String command = null;
List args = new ArrayList();
StringTokenizer tok = new StringTokenizer(line);
if (tok.hasMoreTokens()) {
command = tok.nextToken();
}
while (tok.hasMoreTokens()) {
args.add( tok.nextToken() );
}
if (command!=null) {
if (echoCommands) System.out.println("exec: "+line);
execCommand(command,args);
}
}
}
} catch (Exception e) {
System.out.println("Error: "+configFileName+" line "+lineNum+": "+e.toString());
e.printStackTrace();
return;
}
} | java | public void runScript(String configFileName)
{
int lineNum = 0;
try {
BufferedReader in = new BufferedReader(new FileReader(configFileName));
String line;
while ((line = in.readLine())!=null) {
lineNum++;
if (!line.startsWith("#")) {
String command = null;
List args = new ArrayList();
StringTokenizer tok = new StringTokenizer(line);
if (tok.hasMoreTokens()) {
command = tok.nextToken();
}
while (tok.hasMoreTokens()) {
args.add( tok.nextToken() );
}
if (command!=null) {
if (echoCommands) System.out.println("exec: "+line);
execCommand(command,args);
}
}
}
} catch (Exception e) {
System.out.println("Error: "+configFileName+" line "+lineNum+": "+e.toString());
e.printStackTrace();
return;
}
} | [
"public",
"void",
"runScript",
"(",
"String",
"configFileName",
")",
"{",
"int",
"lineNum",
"=",
"0",
";",
"try",
"{",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"configFileName",
")",
")",
";",
"String",
"line",
";",
"while",
"(",
"(",
"line",
"=",
"in",
".",
"readLine",
"(",
")",
")",
"!=",
"null",
")",
"{",
"lineNum",
"++",
";",
"if",
"(",
"!",
"line",
".",
"startsWith",
"(",
"\"#\"",
")",
")",
"{",
"String",
"command",
"=",
"null",
";",
"List",
"args",
"=",
"new",
"ArrayList",
"(",
")",
";",
"StringTokenizer",
"tok",
"=",
"new",
"StringTokenizer",
"(",
"line",
")",
";",
"if",
"(",
"tok",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"command",
"=",
"tok",
".",
"nextToken",
"(",
")",
";",
"}",
"while",
"(",
"tok",
".",
"hasMoreTokens",
"(",
")",
")",
"{",
"args",
".",
"add",
"(",
"tok",
".",
"nextToken",
"(",
")",
")",
";",
"}",
"if",
"(",
"command",
"!=",
"null",
")",
"{",
"if",
"(",
"echoCommands",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"exec: \"",
"+",
"line",
")",
";",
"execCommand",
"(",
"command",
",",
"args",
")",
";",
"}",
"}",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Error: \"",
"+",
"configFileName",
"+",
"\" line \"",
"+",
"lineNum",
"+",
"\": \"",
"+",
"e",
".",
"toString",
"(",
")",
")",
";",
"e",
".",
"printStackTrace",
"(",
")",
";",
"return",
";",
"}",
"}"
] | Load commands from a file and execute them. | [
"Load",
"commands",
"from",
"a",
"file",
"and",
"execute",
"them",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L280-L309 |
141,345 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java | MatchExptScript.execCommand | private void execCommand(String command,List args)
throws NoSuchMethodException,IllegalAccessException,InvocationTargetException
{
Class[] template = new Class[ args.size() ];
for (int i=0; i<args.size(); i++) {
template[i] = String.class;
}
Method m = MatchExptScript.class.getMethod(command, template );
m.invoke(this, args.toArray(new String[0]));
} | java | private void execCommand(String command,List args)
throws NoSuchMethodException,IllegalAccessException,InvocationTargetException
{
Class[] template = new Class[ args.size() ];
for (int i=0; i<args.size(); i++) {
template[i] = String.class;
}
Method m = MatchExptScript.class.getMethod(command, template );
m.invoke(this, args.toArray(new String[0]));
} | [
"private",
"void",
"execCommand",
"(",
"String",
"command",
",",
"List",
"args",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Class",
"[",
"]",
"template",
"=",
"new",
"Class",
"[",
"args",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"template",
"[",
"i",
"]",
"=",
"String",
".",
"class",
";",
"}",
"Method",
"m",
"=",
"MatchExptScript",
".",
"class",
".",
"getMethod",
"(",
"command",
",",
"template",
")",
";",
"m",
".",
"invoke",
"(",
"this",
",",
"args",
".",
"toArray",
"(",
"new",
"String",
"[",
"0",
"]",
")",
")",
";",
"}"
] | execute a single command | [
"execute",
"a",
"single",
"command"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/expt/MatchExptScript.java#L311-L320 |
141,346 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/TokenFelligiSunter.java | TokenFelligiSunter.prepare | public StringWrapper prepare(String s) {
BagOfTokens bag = new BagOfTokens(s, tokenizer.tokenize(s));
// reweight by -log( freq/collectionSize )
double normalizer = 0.0;
for (Iterator i=bag.tokenIterator(); i.hasNext(); ) {
Token tok = (Token)i.next();
if (collectionSize>0) {
Integer dfInteger = (Integer)documentFrequency.get(tok);
// set previously unknown words to df==1, which gives them a high value
double df = dfInteger==null ? 1.0 : dfInteger.intValue();
double w = -Math.log( df/collectionSize );
bag.setWeight( tok, w );
} else {
bag.setWeight( tok, Math.log(10) );
}
}
return bag;
} | java | public StringWrapper prepare(String s) {
BagOfTokens bag = new BagOfTokens(s, tokenizer.tokenize(s));
// reweight by -log( freq/collectionSize )
double normalizer = 0.0;
for (Iterator i=bag.tokenIterator(); i.hasNext(); ) {
Token tok = (Token)i.next();
if (collectionSize>0) {
Integer dfInteger = (Integer)documentFrequency.get(tok);
// set previously unknown words to df==1, which gives them a high value
double df = dfInteger==null ? 1.0 : dfInteger.intValue();
double w = -Math.log( df/collectionSize );
bag.setWeight( tok, w );
} else {
bag.setWeight( tok, Math.log(10) );
}
}
return bag;
} | [
"public",
"StringWrapper",
"prepare",
"(",
"String",
"s",
")",
"{",
"BagOfTokens",
"bag",
"=",
"new",
"BagOfTokens",
"(",
"s",
",",
"tokenizer",
".",
"tokenize",
"(",
"s",
")",
")",
";",
"// reweight by -log( freq/collectionSize )",
"double",
"normalizer",
"=",
"0.0",
";",
"for",
"(",
"Iterator",
"i",
"=",
"bag",
".",
"tokenIterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"Token",
"tok",
"=",
"(",
"Token",
")",
"i",
".",
"next",
"(",
")",
";",
"if",
"(",
"collectionSize",
">",
"0",
")",
"{",
"Integer",
"dfInteger",
"=",
"(",
"Integer",
")",
"documentFrequency",
".",
"get",
"(",
"tok",
")",
";",
"// set previously unknown words to df==1, which gives them a high value",
"double",
"df",
"=",
"dfInteger",
"==",
"null",
"?",
"1.0",
":",
"dfInteger",
".",
"intValue",
"(",
")",
";",
"double",
"w",
"=",
"-",
"Math",
".",
"log",
"(",
"df",
"/",
"collectionSize",
")",
";",
"bag",
".",
"setWeight",
"(",
"tok",
",",
"w",
")",
";",
"}",
"else",
"{",
"bag",
".",
"setWeight",
"(",
"tok",
",",
"Math",
".",
"log",
"(",
"10",
")",
")",
";",
"}",
"}",
"return",
"bag",
";",
"}"
] | Preprocess a string by finding tokens and giving them appropriate weights | [
"Preprocess",
"a",
"string",
"by",
"finding",
"tokens",
"and",
"giving",
"them",
"appropriate",
"weights"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/TokenFelligiSunter.java#L52-L69 |
141,347 | BlueBrain/bluima | utils/blue_commons/src/main/java/ch/epfl/bbp/MissingUtils.java | MissingUtils.format | public static String format(String msg, Object... args) {
if (args == null || args.length == 0)
return msg;
StringBuilder sb = new StringBuilder();
int argId = 0;
for (int i = 0; i < msg.length(); i++) {
final char c = msg.charAt(i);
if (c == '{' && msg.charAt(i + 1) == '}') {
if (args.length > argId) {
Object val = args[argId++];
if (val == null)
sb.append("null");
else
sb.append(val.toString());
} else {
sb.append("{{MISSING ARG}}");
}
i++;
} else {
sb.append(c);
}
}
return sb.toString();
} | java | public static String format(String msg, Object... args) {
if (args == null || args.length == 0)
return msg;
StringBuilder sb = new StringBuilder();
int argId = 0;
for (int i = 0; i < msg.length(); i++) {
final char c = msg.charAt(i);
if (c == '{' && msg.charAt(i + 1) == '}') {
if (args.length > argId) {
Object val = args[argId++];
if (val == null)
sb.append("null");
else
sb.append(val.toString());
} else {
sb.append("{{MISSING ARG}}");
}
i++;
} else {
sb.append(c);
}
}
return sb.toString();
} | [
"public",
"static",
"String",
"format",
"(",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
"||",
"args",
".",
"length",
"==",
"0",
")",
"return",
"msg",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"argId",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"msg",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"final",
"char",
"c",
"=",
"msg",
".",
"charAt",
"(",
"i",
")",
";",
"if",
"(",
"c",
"==",
"'",
"'",
"&&",
"msg",
".",
"charAt",
"(",
"i",
"+",
"1",
")",
"==",
"'",
"'",
")",
"{",
"if",
"(",
"args",
".",
"length",
">",
"argId",
")",
"{",
"Object",
"val",
"=",
"args",
"[",
"argId",
"++",
"]",
";",
"if",
"(",
"val",
"==",
"null",
")",
"sb",
".",
"append",
"(",
"\"null\"",
")",
";",
"else",
"sb",
".",
"append",
"(",
"val",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"\"{{MISSING ARG}}\"",
")",
";",
"}",
"i",
"++",
";",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"c",
")",
";",
"}",
"}",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] | Similar to Slf4J logger | [
"Similar",
"to",
"Slf4J",
"logger"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/utils/blue_commons/src/main/java/ch/epfl/bbp/MissingUtils.java#L21-L47 |
141,348 | BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/tokens/NGramTokenizer.java | NGramTokenizer.tokenize | public Token[] tokenize(String input)
{
Token[] initialTokens = innerTokenizer.tokenize(input);
List tokens = new ArrayList();
for (int i=0; i<initialTokens.length; i++) {
Token tok = initialTokens[i];
String str = "^"+tok.getValue()+"$";
if (keepOldTokens) tokens.add( intern(str) );
for (int lo=0; lo<str.length(); lo++) {
for (int len=minNGramSize; len<=maxNGramSize; len++) {
if (lo+len<str.length()) {
tokens.add( innerTokenizer.intern( str.substring(lo,lo+len) ));
}
}
}
}
return (Token[]) tokens.toArray(new BasicToken[tokens.size()]);
} | java | public Token[] tokenize(String input)
{
Token[] initialTokens = innerTokenizer.tokenize(input);
List tokens = new ArrayList();
for (int i=0; i<initialTokens.length; i++) {
Token tok = initialTokens[i];
String str = "^"+tok.getValue()+"$";
if (keepOldTokens) tokens.add( intern(str) );
for (int lo=0; lo<str.length(); lo++) {
for (int len=minNGramSize; len<=maxNGramSize; len++) {
if (lo+len<str.length()) {
tokens.add( innerTokenizer.intern( str.substring(lo,lo+len) ));
}
}
}
}
return (Token[]) tokens.toArray(new BasicToken[tokens.size()]);
} | [
"public",
"Token",
"[",
"]",
"tokenize",
"(",
"String",
"input",
")",
"{",
"Token",
"[",
"]",
"initialTokens",
"=",
"innerTokenizer",
".",
"tokenize",
"(",
"input",
")",
";",
"List",
"tokens",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"initialTokens",
".",
"length",
";",
"i",
"++",
")",
"{",
"Token",
"tok",
"=",
"initialTokens",
"[",
"i",
"]",
";",
"String",
"str",
"=",
"\"^\"",
"+",
"tok",
".",
"getValue",
"(",
")",
"+",
"\"$\"",
";",
"if",
"(",
"keepOldTokens",
")",
"tokens",
".",
"add",
"(",
"intern",
"(",
"str",
")",
")",
";",
"for",
"(",
"int",
"lo",
"=",
"0",
";",
"lo",
"<",
"str",
".",
"length",
"(",
")",
";",
"lo",
"++",
")",
"{",
"for",
"(",
"int",
"len",
"=",
"minNGramSize",
";",
"len",
"<=",
"maxNGramSize",
";",
"len",
"++",
")",
"{",
"if",
"(",
"lo",
"+",
"len",
"<",
"str",
".",
"length",
"(",
")",
")",
"{",
"tokens",
".",
"add",
"(",
"innerTokenizer",
".",
"intern",
"(",
"str",
".",
"substring",
"(",
"lo",
",",
"lo",
"+",
"len",
")",
")",
")",
";",
"}",
"}",
"}",
"}",
"return",
"(",
"Token",
"[",
"]",
")",
"tokens",
".",
"toArray",
"(",
"new",
"BasicToken",
"[",
"tokens",
".",
"size",
"(",
")",
"]",
")",
";",
"}"
] | Return tokenized version of a string. Tokens are all
character n-grams that are part of a token produced by the
inner tokenizer. | [
"Return",
"tokenized",
"version",
"of",
"a",
"string",
".",
"Tokens",
"are",
"all",
"character",
"n",
"-",
"grams",
"that",
"are",
"part",
"of",
"a",
"token",
"produced",
"by",
"the",
"inner",
"tokenizer",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/tokens/NGramTokenizer.java#L30-L47 |
141,349 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.getCategories | public FSArray getCategories() {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories)));} | java | public FSArray getCategories() {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories)));} | [
"public",
"FSArray",
"getCategories",
"(",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_categories",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"categories\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"return",
"(",
"FSArray",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_categories",
")",
")",
")",
";",
"}"
] | getter for categories - gets List of Wikipedia categories associated with a Wikipedia page.
@generated
@return value of the feature | [
"getter",
"for",
"categories",
"-",
"gets",
"List",
"of",
"Wikipedia",
"categories",
"associated",
"with",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L87-L90 |
141,350 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setCategories | public void setCategories(FSArray v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.ll_cas.ll_setRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setCategories(FSArray v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.ll_cas.ll_setRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setCategories",
"(",
"FSArray",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_categories",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"categories\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_categories",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | setter for categories - sets List of Wikipedia categories associated with a Wikipedia page.
@generated
@param v value to set into the feature | [
"setter",
"for",
"categories",
"-",
"sets",
"List",
"of",
"Wikipedia",
"categories",
"associated",
"with",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L96-L99 |
141,351 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.getCategories | public Title getCategories(int i) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i);
return (Title)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i)));} | java | public Title getCategories(int i) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i);
return (Title)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i)));} | [
"public",
"Title",
"getCategories",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_categories",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"categories\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_categories",
")",
",",
"i",
")",
";",
"return",
"(",
"Title",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_categories",
")",
",",
"i",
")",
")",
")",
";",
"}"
] | indexed getter for categories - gets an indexed value - List of Wikipedia categories associated with a Wikipedia page.
@generated
@param i index in the array to get
@return value of the element at index i | [
"indexed",
"getter",
"for",
"categories",
"-",
"gets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"Wikipedia",
"categories",
"associated",
"with",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L106-L110 |
141,352 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setCategories | public void setCategories(int i, Title v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i);
jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setCategories(int i, Title v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_categories == null)
jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i);
jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_categories), i, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setCategories",
"(",
"int",
"i",
",",
"Title",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_categories",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"categories\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_categories",
")",
",",
"i",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_categories",
")",
",",
"i",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | indexed setter for categories - sets an indexed value - List of Wikipedia categories associated with a Wikipedia page.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"categories",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"Wikipedia",
"categories",
"associated",
"with",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L117-L121 |
141,353 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.getOutgoingLinks | public FSArray getOutgoingLinks() {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks)));} | java | public FSArray getOutgoingLinks() {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks)));} | [
"public",
"FSArray",
"getOutgoingLinks",
"(",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_outgoingLinks",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"outgoingLinks\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"return",
"(",
"FSArray",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_outgoingLinks",
")",
")",
")",
";",
"}"
] | getter for outgoingLinks - gets List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page.
@generated
@return value of the feature | [
"getter",
"for",
"outgoingLinks",
"-",
"gets",
"List",
"of",
"outgoing",
"links",
"pointing",
"to",
"other",
"Wikipedia",
"pages",
"starting",
"at",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L175-L178 |
141,354 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setOutgoingLinks | public void setOutgoingLinks(FSArray v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.ll_cas.ll_setRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setOutgoingLinks(FSArray v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.ll_cas.ll_setRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setOutgoingLinks",
"(",
"FSArray",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_outgoingLinks",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"outgoingLinks\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_outgoingLinks",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | setter for outgoingLinks - sets List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page.
@generated
@param v value to set into the feature | [
"setter",
"for",
"outgoingLinks",
"-",
"sets",
"List",
"of",
"outgoing",
"links",
"pointing",
"to",
"other",
"Wikipedia",
"pages",
"starting",
"at",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L184-L187 |
141,355 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.getOutgoingLinks | public Title getOutgoingLinks(int i) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i);
return (Title)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i)));} | java | public Title getOutgoingLinks(int i) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i);
return (Title)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i)));} | [
"public",
"Title",
"getOutgoingLinks",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_outgoingLinks",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"outgoingLinks\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_outgoingLinks",
")",
",",
"i",
")",
";",
"return",
"(",
"Title",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_outgoingLinks",
")",
",",
"i",
")",
")",
")",
";",
"}"
] | indexed getter for outgoingLinks - gets an indexed value - List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page.
@generated
@param i index in the array to get
@return value of the element at index i | [
"indexed",
"getter",
"for",
"outgoingLinks",
"-",
"gets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"outgoing",
"links",
"pointing",
"to",
"other",
"Wikipedia",
"pages",
"starting",
"at",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L194-L198 |
141,356 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setOutgoingLinks | public void setOutgoingLinks(int i, Title v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i);
jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setOutgoingLinks(int i, Title v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i);
jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_outgoingLinks), i, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setOutgoingLinks",
"(",
"int",
"i",
",",
"Title",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_outgoingLinks",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"outgoingLinks\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_outgoingLinks",
")",
",",
"i",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_outgoingLinks",
")",
",",
"i",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | indexed setter for outgoingLinks - sets an indexed value - List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"outgoingLinks",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"outgoing",
"links",
"pointing",
"to",
"other",
"Wikipedia",
"pages",
"starting",
"at",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L205-L209 |
141,357 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.getRedirects | public StringArray getRedirects() {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects)));} | java | public StringArray getRedirects() {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects)));} | [
"public",
"StringArray",
"getRedirects",
"(",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_redirects",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"redirects\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"return",
"(",
"StringArray",
")",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSForRef",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_redirects",
")",
")",
")",
";",
"}"
] | getter for redirects - gets List of redirects pointing to a Wikipedia page.
@generated
@return value of the feature | [
"getter",
"for",
"redirects",
"-",
"gets",
"List",
"of",
"redirects",
"pointing",
"to",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L219-L222 |
141,358 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setRedirects | public void setRedirects(StringArray v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.ll_cas.ll_setRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects, jcasType.ll_cas.ll_getFSRef(v));} | java | public void setRedirects(StringArray v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.ll_cas.ll_setRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects, jcasType.ll_cas.ll_getFSRef(v));} | [
"public",
"void",
"setRedirects",
"(",
"StringArray",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_redirects",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"redirects\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_redirects",
",",
"jcasType",
".",
"ll_cas",
".",
"ll_getFSRef",
"(",
"v",
")",
")",
";",
"}"
] | setter for redirects - sets List of redirects pointing to a Wikipedia page.
@generated
@param v value to set into the feature | [
"setter",
"for",
"redirects",
"-",
"sets",
"List",
"of",
"redirects",
"pointing",
"to",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L228-L231 |
141,359 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.getRedirects | public String getRedirects(int i) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i);
return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i);} | java | public String getRedirects(int i) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i);
return jcasType.ll_cas.ll_getStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i);} | [
"public",
"String",
"getRedirects",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_redirects",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"redirects\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_redirects",
")",
",",
"i",
")",
";",
"return",
"jcasType",
".",
"ll_cas",
".",
"ll_getStringArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_redirects",
")",
",",
"i",
")",
";",
"}"
] | indexed getter for redirects - gets an indexed value - List of redirects pointing to a Wikipedia page.
@generated
@param i index in the array to get
@return value of the element at index i | [
"indexed",
"getter",
"for",
"redirects",
"-",
"gets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"redirects",
"pointing",
"to",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L238-L242 |
141,360 | BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setRedirects | public void setRedirects(int i, String v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i);
jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i, v);} | java | public void setRedirects(int i, String v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_redirects == null)
jcasType.jcas.throwFeatMissing("redirects", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i);
jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Descriptor_Type)jcasType).casFeatCode_redirects), i, v);} | [
"public",
"void",
"setRedirects",
"(",
"int",
"i",
",",
"String",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_redirects",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"redirects\"",
",",
"\"de.julielab.jules.types.wikipedia.Descriptor\"",
")",
";",
"jcasType",
".",
"jcas",
".",
"checkArrayBounds",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_redirects",
")",
",",
"i",
")",
";",
"jcasType",
".",
"ll_cas",
".",
"ll_setStringArrayValue",
"(",
"jcasType",
".",
"ll_cas",
".",
"ll_getRefValue",
"(",
"addr",
",",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeatCode_redirects",
")",
",",
"i",
",",
"v",
")",
";",
"}"
] | indexed setter for redirects - sets an indexed value - List of redirects pointing to a Wikipedia page.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"redirects",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"redirects",
"pointing",
"to",
"a",
"Wikipedia",
"page",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L249-L253 |
141,361 | BlueBrain/bluima | modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/Bio.java | Bio.getRid | public java.util.List<Object> getRid() {
if (rid == null) {
rid = new ArrayList<Object>();
}
return this.rid;
} | java | public java.util.List<Object> getRid() {
if (rid == null) {
rid = new ArrayList<Object>();
}
return this.rid;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"Object",
">",
"getRid",
"(",
")",
"{",
"if",
"(",
"rid",
"==",
"null",
")",
"{",
"rid",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"}",
"return",
"this",
".",
"rid",
";",
"}"
] | Gets the value of the rid property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the rid property.
<p>
For example, to add a new item, do as follows:
<pre>
getRid().add(newItem);
</pre>
<p>
Objects of the following type(s) are allowed in the list
{@link Object } | [
"Gets",
"the",
"value",
"of",
"the",
"rid",
"property",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/Bio.java#L419-L424 |
141,362 | BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.parse | public static Pipeline parse(File scriptFile, List<String> replacementVars)
throws ParseException, IOException {
checkArgument(
scriptFile.exists(),
"could not find pipeline script file at "
+ scriptFile.getAbsolutePath());
return parse(FileUtils.readLines(scriptFile), scriptFile.getParent(),
replacementVars);
} | java | public static Pipeline parse(File scriptFile, List<String> replacementVars)
throws ParseException, IOException {
checkArgument(
scriptFile.exists(),
"could not find pipeline script file at "
+ scriptFile.getAbsolutePath());
return parse(FileUtils.readLines(scriptFile), scriptFile.getParent(),
replacementVars);
} | [
"public",
"static",
"Pipeline",
"parse",
"(",
"File",
"scriptFile",
",",
"List",
"<",
"String",
">",
"replacementVars",
")",
"throws",
"ParseException",
",",
"IOException",
"{",
"checkArgument",
"(",
"scriptFile",
".",
"exists",
"(",
")",
",",
"\"could not find pipeline script file at \"",
"+",
"scriptFile",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"return",
"parse",
"(",
"FileUtils",
".",
"readLines",
"(",
"scriptFile",
")",
",",
"scriptFile",
".",
"getParent",
"(",
")",
",",
"replacementVars",
")",
";",
"}"
] | Parses a pipeline script file.
@param scriptFile
the pipeline script file to parse
@param replacementVars
the variables to replace in the original pipeline script. The
first variable gets inserted in place of all $1, the second in
place of $2, etc.
@return the parsed {@link Pipeline} | [
"Parses",
"a",
"pipeline",
"script",
"file",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L76-L84 |
141,363 | BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.parse | public static Pipeline parse(List<String> scriptLines,
String parentFilePath, List<String> replacementVars)
throws ParseException, IOException {
if (replacementVars == null)
replacementVars = new ArrayList<String>();
// parse
Pipeline pipeline = parseAndDispatch(scriptLines, new Pipeline(),
parentFilePath, replacementVars);
// verify pipeline not empty
if (pipeline.crd == null)
LOG.warn("no CollectionReader defined in this pipeline");
// throw new ParseException(
// "no collection reader defined in this pipeline script", -1);
if (pipeline.aeds.isEmpty())
throw new ParseException(
"no analysis engines defined in this pipeline script, at least define one",
-1);
return pipeline;
} | java | public static Pipeline parse(List<String> scriptLines,
String parentFilePath, List<String> replacementVars)
throws ParseException, IOException {
if (replacementVars == null)
replacementVars = new ArrayList<String>();
// parse
Pipeline pipeline = parseAndDispatch(scriptLines, new Pipeline(),
parentFilePath, replacementVars);
// verify pipeline not empty
if (pipeline.crd == null)
LOG.warn("no CollectionReader defined in this pipeline");
// throw new ParseException(
// "no collection reader defined in this pipeline script", -1);
if (pipeline.aeds.isEmpty())
throw new ParseException(
"no analysis engines defined in this pipeline script, at least define one",
-1);
return pipeline;
} | [
"public",
"static",
"Pipeline",
"parse",
"(",
"List",
"<",
"String",
">",
"scriptLines",
",",
"String",
"parentFilePath",
",",
"List",
"<",
"String",
">",
"replacementVars",
")",
"throws",
"ParseException",
",",
"IOException",
"{",
"if",
"(",
"replacementVars",
"==",
"null",
")",
"replacementVars",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"// parse",
"Pipeline",
"pipeline",
"=",
"parseAndDispatch",
"(",
"scriptLines",
",",
"new",
"Pipeline",
"(",
")",
",",
"parentFilePath",
",",
"replacementVars",
")",
";",
"// verify pipeline not empty",
"if",
"(",
"pipeline",
".",
"crd",
"==",
"null",
")",
"LOG",
".",
"warn",
"(",
"\"no CollectionReader defined in this pipeline\"",
")",
";",
"// throw new ParseException(",
"// \"no collection reader defined in this pipeline script\", -1);",
"if",
"(",
"pipeline",
".",
"aeds",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"ParseException",
"(",
"\"no analysis engines defined in this pipeline script, at least define one\"",
",",
"-",
"1",
")",
";",
"return",
"pipeline",
";",
"}"
] | Parses lines from a pipeline script.
@param scriptLines
the lines of a pipeline script to parse
@param parentFilePath
the path to the parent File, used for resolving includes
@param replacementVars
the variables to replace in the original pipeline script. The
first variable gets inserted in place of all $1, the second in
place of $2, etc.
@return the parsed {@link Pipeline} | [
"Parses",
"lines",
"from",
"a",
"pipeline",
"script",
"."
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L99-L120 |
141,364 | BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.parsePython | private static void parsePython(IteratorWithPrevious<String> it,
Pipeline pipeline) throws ParseException {
String script = "";
while (it.hasNext()) {
String current = it.next();
if (StringUtils.isBlank(current))
break;
script += current + "\n";
}
if (script.length() < 3)
throw new ParseException("empty script", -1);
try {
AnalysisEngineDescription aed = AnalysisEngineFactory
.createEngineDescription(JythonAnnotator2.class,
JythonAnnotator2.SCRIPT_STRING, script);
pipeline.addAe(aed);
} catch (ResourceInitializationException e) {
throw new ParseException("could not create aed with script, "
+ e.getMessage(), -1);
}
} | java | private static void parsePython(IteratorWithPrevious<String> it,
Pipeline pipeline) throws ParseException {
String script = "";
while (it.hasNext()) {
String current = it.next();
if (StringUtils.isBlank(current))
break;
script += current + "\n";
}
if (script.length() < 3)
throw new ParseException("empty script", -1);
try {
AnalysisEngineDescription aed = AnalysisEngineFactory
.createEngineDescription(JythonAnnotator2.class,
JythonAnnotator2.SCRIPT_STRING, script);
pipeline.addAe(aed);
} catch (ResourceInitializationException e) {
throw new ParseException("could not create aed with script, "
+ e.getMessage(), -1);
}
} | [
"private",
"static",
"void",
"parsePython",
"(",
"IteratorWithPrevious",
"<",
"String",
">",
"it",
",",
"Pipeline",
"pipeline",
")",
"throws",
"ParseException",
"{",
"String",
"script",
"=",
"\"\"",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"current",
"=",
"it",
".",
"next",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"current",
")",
")",
"break",
";",
"script",
"+=",
"current",
"+",
"\"\\n\"",
";",
"}",
"if",
"(",
"script",
".",
"length",
"(",
")",
"<",
"3",
")",
"throw",
"new",
"ParseException",
"(",
"\"empty script\"",
",",
"-",
"1",
")",
";",
"try",
"{",
"AnalysisEngineDescription",
"aed",
"=",
"AnalysisEngineFactory",
".",
"createEngineDescription",
"(",
"JythonAnnotator2",
".",
"class",
",",
"JythonAnnotator2",
".",
"SCRIPT_STRING",
",",
"script",
")",
";",
"pipeline",
".",
"addAe",
"(",
"aed",
")",
";",
"}",
"catch",
"(",
"ResourceInitializationException",
"e",
")",
"{",
"throw",
"new",
"ParseException",
"(",
"\"could not create aed with script, \"",
"+",
"e",
".",
"getMessage",
"(",
")",
",",
"-",
"1",
")",
";",
"}",
"}"
] | Parses inline, raw Python code and executes it with Jython
@return | [
"Parses",
"inline",
"raw",
"Python",
"code",
"and",
"executes",
"it",
"with",
"Jython"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L211-L233 |
141,365 | BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.parseJava | private static void parseJava(IteratorWithPrevious<String> it,
Pipeline pipeline) throws ParseException {
String script = "";
while (it.hasNext()) {
String current = it.next();
if (isBlank(current))
break;
script += current + "\n";
}
if (script.length() < 3)
throw new ParseException("empty script", -1);
try {
pipeline.aeds.add(createEngineDescription(BeanshellAnnotator.class,
SCRIPT_STRING, script));
} catch (ResourceInitializationException e) {
throw new ParseException("could not create aed with script "
+ script, -1);
}
} | java | private static void parseJava(IteratorWithPrevious<String> it,
Pipeline pipeline) throws ParseException {
String script = "";
while (it.hasNext()) {
String current = it.next();
if (isBlank(current))
break;
script += current + "\n";
}
if (script.length() < 3)
throw new ParseException("empty script", -1);
try {
pipeline.aeds.add(createEngineDescription(BeanshellAnnotator.class,
SCRIPT_STRING, script));
} catch (ResourceInitializationException e) {
throw new ParseException("could not create aed with script "
+ script, -1);
}
} | [
"private",
"static",
"void",
"parseJava",
"(",
"IteratorWithPrevious",
"<",
"String",
">",
"it",
",",
"Pipeline",
"pipeline",
")",
"throws",
"ParseException",
"{",
"String",
"script",
"=",
"\"\"",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"current",
"=",
"it",
".",
"next",
"(",
")",
";",
"if",
"(",
"isBlank",
"(",
"current",
")",
")",
"break",
";",
"script",
"+=",
"current",
"+",
"\"\\n\"",
";",
"}",
"if",
"(",
"script",
".",
"length",
"(",
")",
"<",
"3",
")",
"throw",
"new",
"ParseException",
"(",
"\"empty script\"",
",",
"-",
"1",
")",
";",
"try",
"{",
"pipeline",
".",
"aeds",
".",
"add",
"(",
"createEngineDescription",
"(",
"BeanshellAnnotator",
".",
"class",
",",
"SCRIPT_STRING",
",",
"script",
")",
")",
";",
"}",
"catch",
"(",
"ResourceInitializationException",
"e",
")",
"{",
"throw",
"new",
"ParseException",
"(",
"\"could not create aed with script \"",
"+",
"script",
",",
"-",
"1",
")",
";",
"}",
"}"
] | Parses inline, raw java code and executes it with Beanshell
@return | [
"Parses",
"inline",
"raw",
"java",
"code",
"and",
"executes",
"it",
"with",
"Beanshell"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L240-L260 |
141,366 | BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.parseInclude | private static void parseInclude(String line, Pipeline pipeline,
String parentFilePath, List<String> cliArgs) throws ParseException {
LOG.info("+-parsing include line '{}'", line);
String includeName = line.replaceFirst("include: ", "").trim();
File includeFile = null;
if (includeName.startsWith("/")) {
includeFile = new File(includeName);
} else {
includeFile = new File(parentFilePath, includeName);
}
if (!includeFile.exists()) {
String didYouMean = "";
if (new File(parentFilePath, "../" + includeName).exists()) {
didYouMean = "\ndid you mean: '../" + includeName + "'";
} else if (new File(parentFilePath, includeName.replaceFirst(
"\\.\\./", "")).exists()) {
didYouMean = "\ndid you mean: '"
+ includeName.replaceFirst("\\.\\./", "") + "'";
}
throw new ParseException("include file does not exist ("
+ includeFile.getAbsolutePath() + ") " + didYouMean, -1);
}
try {
List<String> includeStr = FileUtils.readLines(includeFile);
includeStr.add("");
includeStr.add("");
parseAndDispatch(includeStr, pipeline, includeFile.getParentFile()
.getAbsolutePath(), cliArgs);
} catch (IOException e) {
throw new ParseException("cannot read include file ("
+ includeFile.getAbsolutePath() + ")", -1);
}
} | java | private static void parseInclude(String line, Pipeline pipeline,
String parentFilePath, List<String> cliArgs) throws ParseException {
LOG.info("+-parsing include line '{}'", line);
String includeName = line.replaceFirst("include: ", "").trim();
File includeFile = null;
if (includeName.startsWith("/")) {
includeFile = new File(includeName);
} else {
includeFile = new File(parentFilePath, includeName);
}
if (!includeFile.exists()) {
String didYouMean = "";
if (new File(parentFilePath, "../" + includeName).exists()) {
didYouMean = "\ndid you mean: '../" + includeName + "'";
} else if (new File(parentFilePath, includeName.replaceFirst(
"\\.\\./", "")).exists()) {
didYouMean = "\ndid you mean: '"
+ includeName.replaceFirst("\\.\\./", "") + "'";
}
throw new ParseException("include file does not exist ("
+ includeFile.getAbsolutePath() + ") " + didYouMean, -1);
}
try {
List<String> includeStr = FileUtils.readLines(includeFile);
includeStr.add("");
includeStr.add("");
parseAndDispatch(includeStr, pipeline, includeFile.getParentFile()
.getAbsolutePath(), cliArgs);
} catch (IOException e) {
throw new ParseException("cannot read include file ("
+ includeFile.getAbsolutePath() + ")", -1);
}
} | [
"private",
"static",
"void",
"parseInclude",
"(",
"String",
"line",
",",
"Pipeline",
"pipeline",
",",
"String",
"parentFilePath",
",",
"List",
"<",
"String",
">",
"cliArgs",
")",
"throws",
"ParseException",
"{",
"LOG",
".",
"info",
"(",
"\"+-parsing include line '{}'\"",
",",
"line",
")",
";",
"String",
"includeName",
"=",
"line",
".",
"replaceFirst",
"(",
"\"include: \"",
",",
"\"\"",
")",
".",
"trim",
"(",
")",
";",
"File",
"includeFile",
"=",
"null",
";",
"if",
"(",
"includeName",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"includeFile",
"=",
"new",
"File",
"(",
"includeName",
")",
";",
"}",
"else",
"{",
"includeFile",
"=",
"new",
"File",
"(",
"parentFilePath",
",",
"includeName",
")",
";",
"}",
"if",
"(",
"!",
"includeFile",
".",
"exists",
"(",
")",
")",
"{",
"String",
"didYouMean",
"=",
"\"\"",
";",
"if",
"(",
"new",
"File",
"(",
"parentFilePath",
",",
"\"../\"",
"+",
"includeName",
")",
".",
"exists",
"(",
")",
")",
"{",
"didYouMean",
"=",
"\"\\ndid you mean: '../\"",
"+",
"includeName",
"+",
"\"'\"",
";",
"}",
"else",
"if",
"(",
"new",
"File",
"(",
"parentFilePath",
",",
"includeName",
".",
"replaceFirst",
"(",
"\"\\\\.\\\\./\"",
",",
"\"\"",
")",
")",
".",
"exists",
"(",
")",
")",
"{",
"didYouMean",
"=",
"\"\\ndid you mean: '\"",
"+",
"includeName",
".",
"replaceFirst",
"(",
"\"\\\\.\\\\./\"",
",",
"\"\"",
")",
"+",
"\"'\"",
";",
"}",
"throw",
"new",
"ParseException",
"(",
"\"include file does not exist (\"",
"+",
"includeFile",
".",
"getAbsolutePath",
"(",
")",
"+",
"\") \"",
"+",
"didYouMean",
",",
"-",
"1",
")",
";",
"}",
"try",
"{",
"List",
"<",
"String",
">",
"includeStr",
"=",
"FileUtils",
".",
"readLines",
"(",
"includeFile",
")",
";",
"includeStr",
".",
"add",
"(",
"\"\"",
")",
";",
"includeStr",
".",
"add",
"(",
"\"\"",
")",
";",
"parseAndDispatch",
"(",
"includeStr",
",",
"pipeline",
",",
"includeFile",
".",
"getParentFile",
"(",
")",
".",
"getAbsolutePath",
"(",
")",
",",
"cliArgs",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"ParseException",
"(",
"\"cannot read include file (\"",
"+",
"includeFile",
".",
"getAbsolutePath",
"(",
")",
"+",
"\")\"",
",",
"-",
"1",
")",
";",
"}",
"}"
] | parse include commands | [
"parse",
"include",
"commands"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L263-L297 |
141,367 | BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.validateParams | private static void validateParams(List<Object> params, Class<?> classz) {
// skip validation if not uimafit
if (!JCasAnnotator_ImplBase.class.isAssignableFrom(classz)
&& !JCasCollectionReader_ImplBase.class.isAssignableFrom(//
classz)) {
LOG.warn(
" +- Could not validate parameters in {}. You might want to check it manually.",
classz.getName());
return;
}
for (int i = 0; i < params.size(); i = i + 2) {
String paramName = (String) params.get(i);
try {
// add fields from superclass as well
Set<Field> fields = newHashSet(classz.getDeclaredFields());
fields.addAll(newHashSet(classz.getSuperclass()
.getDeclaredFields()));
List<String> paramNames = new ArrayList<String>();
for (Field f : fields) {
if (f.isAnnotationPresent(ConfigurationParameter.class)) {
ConfigurationParameter confParam = f
.getAnnotation(ConfigurationParameter.class);
paramNames.add(confParam.name());
}
}
if (!paramNames.contains(paramName)) {
LOG.warn(
" +-XXXXXXXXX Could not find parameter '{}' in {}. You should check it.",
paramName, classz.getName());
LOG.warn(" +-XXXXXXXXX Available parameters are:\n",
join(paramNames, "\n"));
}
} catch (SecurityException e) {
LOG.error(
"could not validate params for "
+ classz.getSimpleName(), e);
}
}
} | java | private static void validateParams(List<Object> params, Class<?> classz) {
// skip validation if not uimafit
if (!JCasAnnotator_ImplBase.class.isAssignableFrom(classz)
&& !JCasCollectionReader_ImplBase.class.isAssignableFrom(//
classz)) {
LOG.warn(
" +- Could not validate parameters in {}. You might want to check it manually.",
classz.getName());
return;
}
for (int i = 0; i < params.size(); i = i + 2) {
String paramName = (String) params.get(i);
try {
// add fields from superclass as well
Set<Field> fields = newHashSet(classz.getDeclaredFields());
fields.addAll(newHashSet(classz.getSuperclass()
.getDeclaredFields()));
List<String> paramNames = new ArrayList<String>();
for (Field f : fields) {
if (f.isAnnotationPresent(ConfigurationParameter.class)) {
ConfigurationParameter confParam = f
.getAnnotation(ConfigurationParameter.class);
paramNames.add(confParam.name());
}
}
if (!paramNames.contains(paramName)) {
LOG.warn(
" +-XXXXXXXXX Could not find parameter '{}' in {}. You should check it.",
paramName, classz.getName());
LOG.warn(" +-XXXXXXXXX Available parameters are:\n",
join(paramNames, "\n"));
}
} catch (SecurityException e) {
LOG.error(
"could not validate params for "
+ classz.getSimpleName(), e);
}
}
} | [
"private",
"static",
"void",
"validateParams",
"(",
"List",
"<",
"Object",
">",
"params",
",",
"Class",
"<",
"?",
">",
"classz",
")",
"{",
"// skip validation if not uimafit",
"if",
"(",
"!",
"JCasAnnotator_ImplBase",
".",
"class",
".",
"isAssignableFrom",
"(",
"classz",
")",
"&&",
"!",
"JCasCollectionReader_ImplBase",
".",
"class",
".",
"isAssignableFrom",
"(",
"//",
"classz",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\" +- Could not validate parameters in {}. You might want to check it manually.\"",
",",
"classz",
".",
"getName",
"(",
")",
")",
";",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".",
"size",
"(",
")",
";",
"i",
"=",
"i",
"+",
"2",
")",
"{",
"String",
"paramName",
"=",
"(",
"String",
")",
"params",
".",
"get",
"(",
"i",
")",
";",
"try",
"{",
"// add fields from superclass as well",
"Set",
"<",
"Field",
">",
"fields",
"=",
"newHashSet",
"(",
"classz",
".",
"getDeclaredFields",
"(",
")",
")",
";",
"fields",
".",
"addAll",
"(",
"newHashSet",
"(",
"classz",
".",
"getSuperclass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
")",
")",
";",
"List",
"<",
"String",
">",
"paramNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Field",
"f",
":",
"fields",
")",
"{",
"if",
"(",
"f",
".",
"isAnnotationPresent",
"(",
"ConfigurationParameter",
".",
"class",
")",
")",
"{",
"ConfigurationParameter",
"confParam",
"=",
"f",
".",
"getAnnotation",
"(",
"ConfigurationParameter",
".",
"class",
")",
";",
"paramNames",
".",
"add",
"(",
"confParam",
".",
"name",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"!",
"paramNames",
".",
"contains",
"(",
"paramName",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\" +-XXXXXXXXX Could not find parameter '{}' in {}. You should check it.\"",
",",
"paramName",
",",
"classz",
".",
"getName",
"(",
")",
")",
";",
"LOG",
".",
"warn",
"(",
"\" +-XXXXXXXXX Available parameters are:\\n\"",
",",
"join",
"(",
"paramNames",
",",
"\"\\n\"",
")",
")",
";",
"}",
"}",
"catch",
"(",
"SecurityException",
"e",
")",
"{",
"LOG",
".",
"error",
"(",
"\"could not validate params for \"",
"+",
"classz",
".",
"getSimpleName",
"(",
")",
",",
"e",
")",
";",
"}",
"}",
"}"
] | check that this ae or cr has the right parameters
@param params
key : val : key : val
@param classz
a cr or an ae
@throws ParseException
if the keys are not declared as fields in the classz | [
"check",
"that",
"this",
"ae",
"or",
"cr",
"has",
"the",
"right",
"parameters"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L377-L420 |
141,368 | duracloud/duracloud | security/src/main/java/org/duracloud/security/vote/VoterUtil.java | VoterUtil.debugText | protected static String debugText(String heading,
Authentication auth,
Collection<ConfigAttribute> config,
Object resource,
int decision) {
StringBuilder sb = new StringBuilder(heading);
sb.append(": ");
if (auth != null) {
sb.append(auth.getName());
}
if (config != null) {
Collection<ConfigAttribute> atts = config;
if (atts != null && atts.size() > 0) {
sb.append(" [");
for (ConfigAttribute att : atts) {
sb.append(att.getAttribute());
sb.append(",");
}
sb.replace(sb.length() - 1, sb.length(), "]");
}
}
if (resource != null) {
sb.append(" resource: [");
sb.append(resource.toString());
sb.append("]");
}
sb.append(" => decision: " + decision);
return sb.toString();
} | java | protected static String debugText(String heading,
Authentication auth,
Collection<ConfigAttribute> config,
Object resource,
int decision) {
StringBuilder sb = new StringBuilder(heading);
sb.append(": ");
if (auth != null) {
sb.append(auth.getName());
}
if (config != null) {
Collection<ConfigAttribute> atts = config;
if (atts != null && atts.size() > 0) {
sb.append(" [");
for (ConfigAttribute att : atts) {
sb.append(att.getAttribute());
sb.append(",");
}
sb.replace(sb.length() - 1, sb.length(), "]");
}
}
if (resource != null) {
sb.append(" resource: [");
sb.append(resource.toString());
sb.append("]");
}
sb.append(" => decision: " + decision);
return sb.toString();
} | [
"protected",
"static",
"String",
"debugText",
"(",
"String",
"heading",
",",
"Authentication",
"auth",
",",
"Collection",
"<",
"ConfigAttribute",
">",
"config",
",",
"Object",
"resource",
",",
"int",
"decision",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"heading",
")",
";",
"sb",
".",
"append",
"(",
"\": \"",
")",
";",
"if",
"(",
"auth",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"auth",
".",
"getName",
"(",
")",
")",
";",
"}",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"Collection",
"<",
"ConfigAttribute",
">",
"atts",
"=",
"config",
";",
"if",
"(",
"atts",
"!=",
"null",
"&&",
"atts",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"sb",
".",
"append",
"(",
"\" [\"",
")",
";",
"for",
"(",
"ConfigAttribute",
"att",
":",
"atts",
")",
"{",
"sb",
".",
"append",
"(",
"att",
".",
"getAttribute",
"(",
")",
")",
";",
"sb",
".",
"append",
"(",
"\",\"",
")",
";",
"}",
"sb",
".",
"replace",
"(",
"sb",
".",
"length",
"(",
")",
"-",
"1",
",",
"sb",
".",
"length",
"(",
")",
",",
"\"]\"",
")",
";",
"}",
"}",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"\" resource: [\"",
")",
";",
"sb",
".",
"append",
"(",
"resource",
".",
"toString",
"(",
")",
")",
";",
"sb",
".",
"append",
"(",
"\"]\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"\" => decision: \"",
"+",
"decision",
")",
";",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] | This is small debug utility available to voters in this package. | [
"This",
"is",
"small",
"debug",
"utility",
"available",
"to",
"voters",
"in",
"this",
"package",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/security/src/main/java/org/duracloud/security/vote/VoterUtil.java#L28-L57 |
141,369 | duracloud/duracloud | storeclient/src/main/java/org/duracloud/client/task/S3TaskClientManager.java | S3TaskClientManager.get | public S3TaskClient get(String storeId) throws ContentStoreException {
ContentStore contentStore = contentStoreManager.getContentStore(storeId);
return new S3TaskClientImpl(contentStore);
} | java | public S3TaskClient get(String storeId) throws ContentStoreException {
ContentStore contentStore = contentStoreManager.getContentStore(storeId);
return new S3TaskClientImpl(contentStore);
} | [
"public",
"S3TaskClient",
"get",
"(",
"String",
"storeId",
")",
"throws",
"ContentStoreException",
"{",
"ContentStore",
"contentStore",
"=",
"contentStoreManager",
".",
"getContentStore",
"(",
"storeId",
")",
";",
"return",
"new",
"S3TaskClientImpl",
"(",
"contentStore",
")",
";",
"}"
] | Retrieve an S3TaskClient
@param storeId id of the storage provider
@return client for calling S3 tasks
@throws ContentStoreException on error | [
"Retrieve",
"an",
"S3TaskClient"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storeclient/src/main/java/org/duracloud/client/task/S3TaskClientManager.java#L35-L38 |
141,370 | duracloud/duracloud | common/src/main/java/org/duracloud/common/util/IOUtil.java | IOUtil.addFileToZipOutputStream | public static void addFileToZipOutputStream(File file, ZipOutputStream zipOs) throws IOException {
String fileName = file.getName();
try (FileInputStream fos = new FileInputStream(file)) {
ZipEntry zipEntry = new ZipEntry(fileName);
zipEntry.setSize(file.length());
zipEntry.setTime(System.currentTimeMillis());
zipOs.putNextEntry(zipEntry);
byte[] buf = new byte[1024];
int bytesRead;
while ((bytesRead = fos.read(buf)) > 0) {
zipOs.write(buf, 0, bytesRead);
}
zipOs.closeEntry();
fos.close();
}
} | java | public static void addFileToZipOutputStream(File file, ZipOutputStream zipOs) throws IOException {
String fileName = file.getName();
try (FileInputStream fos = new FileInputStream(file)) {
ZipEntry zipEntry = new ZipEntry(fileName);
zipEntry.setSize(file.length());
zipEntry.setTime(System.currentTimeMillis());
zipOs.putNextEntry(zipEntry);
byte[] buf = new byte[1024];
int bytesRead;
while ((bytesRead = fos.read(buf)) > 0) {
zipOs.write(buf, 0, bytesRead);
}
zipOs.closeEntry();
fos.close();
}
} | [
"public",
"static",
"void",
"addFileToZipOutputStream",
"(",
"File",
"file",
",",
"ZipOutputStream",
"zipOs",
")",
"throws",
"IOException",
"{",
"String",
"fileName",
"=",
"file",
".",
"getName",
"(",
")",
";",
"try",
"(",
"FileInputStream",
"fos",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
")",
"{",
"ZipEntry",
"zipEntry",
"=",
"new",
"ZipEntry",
"(",
"fileName",
")",
";",
"zipEntry",
".",
"setSize",
"(",
"file",
".",
"length",
"(",
")",
")",
";",
"zipEntry",
".",
"setTime",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"zipOs",
".",
"putNextEntry",
"(",
"zipEntry",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"int",
"bytesRead",
";",
"while",
"(",
"(",
"bytesRead",
"=",
"fos",
".",
"read",
"(",
"buf",
")",
")",
">",
"0",
")",
"{",
"zipOs",
".",
"write",
"(",
"buf",
",",
"0",
",",
"bytesRead",
")",
";",
"}",
"zipOs",
".",
"closeEntry",
"(",
")",
";",
"fos",
".",
"close",
"(",
")",
";",
"}",
"}"
] | Adds the specified file to the zip output stream.
@param file
@param zipOs | [
"Adds",
"the",
"specified",
"file",
"to",
"the",
"zip",
"output",
"stream",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common/src/main/java/org/duracloud/common/util/IOUtil.java#L140-L155 |
141,371 | duracloud/duracloud | glacierstorageprovider/src/main/java/org/duracloud/glacierstorage/GlacierStorageProvider.java | GlacierStorageProvider.checkStorageState | private void checkStorageState(StorageException e) {
if (e.getCause() instanceof AmazonS3Exception) {
String errorCode =
((AmazonS3Exception) e.getCause()).getErrorCode();
if (INVALID_OBJECT_STATE.equals(errorCode)) {
String message = "The storage state of this content item " +
"does not allow for this action to be taken. To resolve " +
"this issue: 1. Request that this content item be " +
"retrieved from offline storage 2. Wait (retrieval may " +
"take up to 5 hours) 3. Retry this request";
throw new StorageStateException(message, e);
}
}
} | java | private void checkStorageState(StorageException e) {
if (e.getCause() instanceof AmazonS3Exception) {
String errorCode =
((AmazonS3Exception) e.getCause()).getErrorCode();
if (INVALID_OBJECT_STATE.equals(errorCode)) {
String message = "The storage state of this content item " +
"does not allow for this action to be taken. To resolve " +
"this issue: 1. Request that this content item be " +
"retrieved from offline storage 2. Wait (retrieval may " +
"take up to 5 hours) 3. Retry this request";
throw new StorageStateException(message, e);
}
}
} | [
"private",
"void",
"checkStorageState",
"(",
"StorageException",
"e",
")",
"{",
"if",
"(",
"e",
".",
"getCause",
"(",
")",
"instanceof",
"AmazonS3Exception",
")",
"{",
"String",
"errorCode",
"=",
"(",
"(",
"AmazonS3Exception",
")",
"e",
".",
"getCause",
"(",
")",
")",
".",
"getErrorCode",
"(",
")",
";",
"if",
"(",
"INVALID_OBJECT_STATE",
".",
"equals",
"(",
"errorCode",
")",
")",
"{",
"String",
"message",
"=",
"\"The storage state of this content item \"",
"+",
"\"does not allow for this action to be taken. To resolve \"",
"+",
"\"this issue: 1. Request that this content item be \"",
"+",
"\"retrieved from offline storage 2. Wait (retrieval may \"",
"+",
"\"take up to 5 hours) 3. Retry this request\"",
";",
"throw",
"new",
"StorageStateException",
"(",
"message",
",",
"e",
")",
";",
"}",
"}",
"}"
] | Recognize and handle exceptions due to content which resides in Glacier
but has not been retrieved for access. | [
"Recognize",
"and",
"handle",
"exceptions",
"due",
"to",
"content",
"which",
"resides",
"in",
"Glacier",
"but",
"has",
"not",
"been",
"retrieved",
"for",
"access",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/glacierstorageprovider/src/main/java/org/duracloud/glacierstorage/GlacierStorageProvider.java#L116-L129 |
141,372 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/ManifestRest.java | ManifestRest.generateAsynchronously | private URI generateAsynchronously(String account,
String spaceId,
String storeId,
String format)
throws Exception {
StorageProviderType providerType = getStorageProviderType(storeId);
InputStream manifest =
manifestResource.getManifest(account, storeId, spaceId, format);
String contentId =
MessageFormat.format("generated-manifests/manifest-{0}_{1}_{2}.txt{3}",
spaceId,
providerType.name().toLowerCase(),
DateUtil.convertToString(System.currentTimeMillis(), DateFormat.PLAIN_FORMAT),
".gz");
String adminSpace = "x-duracloud-admin";
URI uri = buildURI(adminSpace, contentId);
StorageProvider provider = storageProviderFactory.getStorageProvider();
executor.execute(() -> {
try {
boolean gzip = true;
// write file to disk
File file = IOUtil.writeStreamToFile(manifest, gzip);
// upload to the default storage provider with retries
uploadManifestToDefaultStorageProvider(format,
adminSpace,
contentId,
file,
provider,
gzip);
} catch (Exception ex) {
log.error("failed to generate manifest for space: spaceId="
+ spaceId
+ ", storeId="
+ storeId
+ " : "
+ ex.getMessage(),
ex);
}
});
return uri;
} | java | private URI generateAsynchronously(String account,
String spaceId,
String storeId,
String format)
throws Exception {
StorageProviderType providerType = getStorageProviderType(storeId);
InputStream manifest =
manifestResource.getManifest(account, storeId, spaceId, format);
String contentId =
MessageFormat.format("generated-manifests/manifest-{0}_{1}_{2}.txt{3}",
spaceId,
providerType.name().toLowerCase(),
DateUtil.convertToString(System.currentTimeMillis(), DateFormat.PLAIN_FORMAT),
".gz");
String adminSpace = "x-duracloud-admin";
URI uri = buildURI(adminSpace, contentId);
StorageProvider provider = storageProviderFactory.getStorageProvider();
executor.execute(() -> {
try {
boolean gzip = true;
// write file to disk
File file = IOUtil.writeStreamToFile(manifest, gzip);
// upload to the default storage provider with retries
uploadManifestToDefaultStorageProvider(format,
adminSpace,
contentId,
file,
provider,
gzip);
} catch (Exception ex) {
log.error("failed to generate manifest for space: spaceId="
+ spaceId
+ ", storeId="
+ storeId
+ " : "
+ ex.getMessage(),
ex);
}
});
return uri;
} | [
"private",
"URI",
"generateAsynchronously",
"(",
"String",
"account",
",",
"String",
"spaceId",
",",
"String",
"storeId",
",",
"String",
"format",
")",
"throws",
"Exception",
"{",
"StorageProviderType",
"providerType",
"=",
"getStorageProviderType",
"(",
"storeId",
")",
";",
"InputStream",
"manifest",
"=",
"manifestResource",
".",
"getManifest",
"(",
"account",
",",
"storeId",
",",
"spaceId",
",",
"format",
")",
";",
"String",
"contentId",
"=",
"MessageFormat",
".",
"format",
"(",
"\"generated-manifests/manifest-{0}_{1}_{2}.txt{3}\"",
",",
"spaceId",
",",
"providerType",
".",
"name",
"(",
")",
".",
"toLowerCase",
"(",
")",
",",
"DateUtil",
".",
"convertToString",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
",",
"DateFormat",
".",
"PLAIN_FORMAT",
")",
",",
"\".gz\"",
")",
";",
"String",
"adminSpace",
"=",
"\"x-duracloud-admin\"",
";",
"URI",
"uri",
"=",
"buildURI",
"(",
"adminSpace",
",",
"contentId",
")",
";",
"StorageProvider",
"provider",
"=",
"storageProviderFactory",
".",
"getStorageProvider",
"(",
")",
";",
"executor",
".",
"execute",
"(",
"(",
")",
"->",
"{",
"try",
"{",
"boolean",
"gzip",
"=",
"true",
";",
"// write file to disk\r",
"File",
"file",
"=",
"IOUtil",
".",
"writeStreamToFile",
"(",
"manifest",
",",
"gzip",
")",
";",
"// upload to the default storage provider with retries\r",
"uploadManifestToDefaultStorageProvider",
"(",
"format",
",",
"adminSpace",
",",
"contentId",
",",
"file",
",",
"provider",
",",
"gzip",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"log",
".",
"error",
"(",
"\"failed to generate manifest for space: spaceId=\"",
"+",
"spaceId",
"+",
"\", storeId=\"",
"+",
"storeId",
"+",
"\" : \"",
"+",
"ex",
".",
"getMessage",
"(",
")",
",",
"ex",
")",
";",
"}",
"}",
")",
";",
"return",
"uri",
";",
"}"
] | Generates a manifest file asynchronously and uploads to DuraCloud
@param account
@param spaceId
@param storeId
@param format
@return The URI of the generated manifest. | [
"Generates",
"a",
"manifest",
"file",
"asynchronously",
"and",
"uploads",
"to",
"DuraCloud"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/ManifestRest.java#L177-L226 |
141,373 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/util/StorageProviderFactoryImpl.java | StorageProviderFactoryImpl.getStorageAccounts | @Override
public List<StorageAccount> getStorageAccounts() {
List<StorageAccount> accts = new ArrayList<>();
Iterator<String> ids = getAccountManager().getStorageAccountIds();
while (ids.hasNext()) {
accts.add(getAccountManager().getStorageAccount(ids.next()));
}
return accts;
} | java | @Override
public List<StorageAccount> getStorageAccounts() {
List<StorageAccount> accts = new ArrayList<>();
Iterator<String> ids = getAccountManager().getStorageAccountIds();
while (ids.hasNext()) {
accts.add(getAccountManager().getStorageAccount(ids.next()));
}
return accts;
} | [
"@",
"Override",
"public",
"List",
"<",
"StorageAccount",
">",
"getStorageAccounts",
"(",
")",
"{",
"List",
"<",
"StorageAccount",
">",
"accts",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"ids",
"=",
"getAccountManager",
"(",
")",
".",
"getStorageAccountIds",
"(",
")",
";",
"while",
"(",
"ids",
".",
"hasNext",
"(",
")",
")",
"{",
"accts",
".",
"add",
"(",
"getAccountManager",
"(",
")",
".",
"getStorageAccount",
"(",
"ids",
".",
"next",
"(",
")",
")",
")",
";",
"}",
"return",
"accts",
";",
"}"
] | This method returns all of the registered storage accounts.
@return list of storage accounts | [
"This",
"method",
"returns",
"all",
"of",
"the",
"registered",
"storage",
"accounts",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/util/StorageProviderFactoryImpl.java#L154-L163 |
141,374 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/util/StorageProviderFactoryImpl.java | StorageProviderFactoryImpl.getStorageProvider | @Override
public StorageProvider getStorageProvider(String storageAccountId)
throws StorageException {
// If no store ID is provided, retrieves the primary store ID
storageAccountId = checkStorageAccountId(storageAccountId);
if (storageProviders.containsKey(storageAccountId)) {
return storageProviders.get(storageAccountId);
}
StorageAccountManager storageAccountManager = getAccountManager();
StorageAccount account =
storageAccountManager.getStorageAccount(storageAccountId);
if (account == null) {
throw new NotFoundException("No store exists with ID " + storageAccountId);
}
String username = account.getUsername();
String password = account.getPassword();
StorageProviderType type = account.getType();
StorageProvider storageProvider = null;
if (type.equals(StorageProviderType.AMAZON_S3)) {
storageProvider = new S3StorageProvider(username,
password,
account.getOptions());
} else if (type.equals(StorageProviderType.AMAZON_GLACIER)) {
storageProvider = new GlacierStorageProvider(username,
password,
account.getOptions());
} else if (type.equals(StorageProviderType.IRODS)) {
storageProvider = new IrodsStorageProvider(username,
password,
account.getOptions());
} else if (type.equals(StorageProviderType.CHRONOPOLIS)) {
storageProvider = new ChronopolisStorageProvider(username, password);
} else if (type.equals(StorageProviderType.TEST_RETRY)) {
storageProvider = new MockRetryStorageProvider();
} else if (type.equals(StorageProviderType.TEST_VERIFY_CREATE)) {
storageProvider = new MockVerifyCreateStorageProvider();
} else if (type.equals(StorageProviderType.TEST_VERIFY_DELETE)) {
storageProvider = new MockVerifyDeleteStorageProvider();
} else {
throw new StorageException("Unsupported storage provider type ("
+ type.name() + ") associated with storage account ("
+ storageAccountId + "): unable to create");
}
StorageProvider auditProvider =
new AuditStorageProvider(storageProvider,
storageAccountManager.getAccountName(),
storageAccountId,
type.getName(),
userUtil,
auditQueue);
if (storageProvider instanceof StorageProviderBase) {
((StorageProviderBase) storageProvider).setWrappedStorageProvider(auditProvider);
}
StorageProvider aclProvider = new ACLStorageProvider(auditProvider, notifier, contextUtil);
StorageProvider brokeredProvider =
new BrokeredStorageProvider(statelessProvider,
aclProvider,
type,
storageAccountId);
storageProviders.put(storageAccountId, brokeredProvider);
return brokeredProvider;
} | java | @Override
public StorageProvider getStorageProvider(String storageAccountId)
throws StorageException {
// If no store ID is provided, retrieves the primary store ID
storageAccountId = checkStorageAccountId(storageAccountId);
if (storageProviders.containsKey(storageAccountId)) {
return storageProviders.get(storageAccountId);
}
StorageAccountManager storageAccountManager = getAccountManager();
StorageAccount account =
storageAccountManager.getStorageAccount(storageAccountId);
if (account == null) {
throw new NotFoundException("No store exists with ID " + storageAccountId);
}
String username = account.getUsername();
String password = account.getPassword();
StorageProviderType type = account.getType();
StorageProvider storageProvider = null;
if (type.equals(StorageProviderType.AMAZON_S3)) {
storageProvider = new S3StorageProvider(username,
password,
account.getOptions());
} else if (type.equals(StorageProviderType.AMAZON_GLACIER)) {
storageProvider = new GlacierStorageProvider(username,
password,
account.getOptions());
} else if (type.equals(StorageProviderType.IRODS)) {
storageProvider = new IrodsStorageProvider(username,
password,
account.getOptions());
} else if (type.equals(StorageProviderType.CHRONOPOLIS)) {
storageProvider = new ChronopolisStorageProvider(username, password);
} else if (type.equals(StorageProviderType.TEST_RETRY)) {
storageProvider = new MockRetryStorageProvider();
} else if (type.equals(StorageProviderType.TEST_VERIFY_CREATE)) {
storageProvider = new MockVerifyCreateStorageProvider();
} else if (type.equals(StorageProviderType.TEST_VERIFY_DELETE)) {
storageProvider = new MockVerifyDeleteStorageProvider();
} else {
throw new StorageException("Unsupported storage provider type ("
+ type.name() + ") associated with storage account ("
+ storageAccountId + "): unable to create");
}
StorageProvider auditProvider =
new AuditStorageProvider(storageProvider,
storageAccountManager.getAccountName(),
storageAccountId,
type.getName(),
userUtil,
auditQueue);
if (storageProvider instanceof StorageProviderBase) {
((StorageProviderBase) storageProvider).setWrappedStorageProvider(auditProvider);
}
StorageProvider aclProvider = new ACLStorageProvider(auditProvider, notifier, contextUtil);
StorageProvider brokeredProvider =
new BrokeredStorageProvider(statelessProvider,
aclProvider,
type,
storageAccountId);
storageProviders.put(storageAccountId, brokeredProvider);
return brokeredProvider;
} | [
"@",
"Override",
"public",
"StorageProvider",
"getStorageProvider",
"(",
"String",
"storageAccountId",
")",
"throws",
"StorageException",
"{",
"// If no store ID is provided, retrieves the primary store ID",
"storageAccountId",
"=",
"checkStorageAccountId",
"(",
"storageAccountId",
")",
";",
"if",
"(",
"storageProviders",
".",
"containsKey",
"(",
"storageAccountId",
")",
")",
"{",
"return",
"storageProviders",
".",
"get",
"(",
"storageAccountId",
")",
";",
"}",
"StorageAccountManager",
"storageAccountManager",
"=",
"getAccountManager",
"(",
")",
";",
"StorageAccount",
"account",
"=",
"storageAccountManager",
".",
"getStorageAccount",
"(",
"storageAccountId",
")",
";",
"if",
"(",
"account",
"==",
"null",
")",
"{",
"throw",
"new",
"NotFoundException",
"(",
"\"No store exists with ID \"",
"+",
"storageAccountId",
")",
";",
"}",
"String",
"username",
"=",
"account",
".",
"getUsername",
"(",
")",
";",
"String",
"password",
"=",
"account",
".",
"getPassword",
"(",
")",
";",
"StorageProviderType",
"type",
"=",
"account",
".",
"getType",
"(",
")",
";",
"StorageProvider",
"storageProvider",
"=",
"null",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"AMAZON_S3",
")",
")",
"{",
"storageProvider",
"=",
"new",
"S3StorageProvider",
"(",
"username",
",",
"password",
",",
"account",
".",
"getOptions",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"AMAZON_GLACIER",
")",
")",
"{",
"storageProvider",
"=",
"new",
"GlacierStorageProvider",
"(",
"username",
",",
"password",
",",
"account",
".",
"getOptions",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"IRODS",
")",
")",
"{",
"storageProvider",
"=",
"new",
"IrodsStorageProvider",
"(",
"username",
",",
"password",
",",
"account",
".",
"getOptions",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"CHRONOPOLIS",
")",
")",
"{",
"storageProvider",
"=",
"new",
"ChronopolisStorageProvider",
"(",
"username",
",",
"password",
")",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"TEST_RETRY",
")",
")",
"{",
"storageProvider",
"=",
"new",
"MockRetryStorageProvider",
"(",
")",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"TEST_VERIFY_CREATE",
")",
")",
"{",
"storageProvider",
"=",
"new",
"MockVerifyCreateStorageProvider",
"(",
")",
";",
"}",
"else",
"if",
"(",
"type",
".",
"equals",
"(",
"StorageProviderType",
".",
"TEST_VERIFY_DELETE",
")",
")",
"{",
"storageProvider",
"=",
"new",
"MockVerifyDeleteStorageProvider",
"(",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"StorageException",
"(",
"\"Unsupported storage provider type (\"",
"+",
"type",
".",
"name",
"(",
")",
"+",
"\") associated with storage account (\"",
"+",
"storageAccountId",
"+",
"\"): unable to create\"",
")",
";",
"}",
"StorageProvider",
"auditProvider",
"=",
"new",
"AuditStorageProvider",
"(",
"storageProvider",
",",
"storageAccountManager",
".",
"getAccountName",
"(",
")",
",",
"storageAccountId",
",",
"type",
".",
"getName",
"(",
")",
",",
"userUtil",
",",
"auditQueue",
")",
";",
"if",
"(",
"storageProvider",
"instanceof",
"StorageProviderBase",
")",
"{",
"(",
"(",
"StorageProviderBase",
")",
"storageProvider",
")",
".",
"setWrappedStorageProvider",
"(",
"auditProvider",
")",
";",
"}",
"StorageProvider",
"aclProvider",
"=",
"new",
"ACLStorageProvider",
"(",
"auditProvider",
",",
"notifier",
",",
"contextUtil",
")",
";",
"StorageProvider",
"brokeredProvider",
"=",
"new",
"BrokeredStorageProvider",
"(",
"statelessProvider",
",",
"aclProvider",
",",
"type",
",",
"storageAccountId",
")",
";",
"storageProviders",
".",
"put",
"(",
"storageAccountId",
",",
"brokeredProvider",
")",
";",
"return",
"brokeredProvider",
";",
"}"
] | Retrieves a particular storage provider based on the storage account ID.
If no storage ID is provided use the primary storage provider account
If no storage account can be found with the given ID, throw NotFoundException
@param storageAccountId - the ID of the storage provider account
@return
@throws StorageException | [
"Retrieves",
"a",
"particular",
"storage",
"provider",
"based",
"on",
"the",
"storage",
"account",
"ID",
".",
"If",
"no",
"storage",
"ID",
"is",
"provided",
"use",
"the",
"primary",
"storage",
"provider",
"account",
"If",
"no",
"storage",
"account",
"can",
"be",
"found",
"with",
"the",
"given",
"ID",
"throw",
"NotFoundException"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/util/StorageProviderFactoryImpl.java#L186-L256 |
141,375 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/util/StorageProviderFactoryImpl.java | StorageProviderFactoryImpl.expireStorageProvider | @Override
public void expireStorageProvider(String storageAccountId) {
storageAccountId = checkStorageAccountId(storageAccountId);
log.info("Expiring storage provider connection! Storage account id: {}", storageAccountId);
storageProviders.remove(storageAccountId);
} | java | @Override
public void expireStorageProvider(String storageAccountId) {
storageAccountId = checkStorageAccountId(storageAccountId);
log.info("Expiring storage provider connection! Storage account id: {}", storageAccountId);
storageProviders.remove(storageAccountId);
} | [
"@",
"Override",
"public",
"void",
"expireStorageProvider",
"(",
"String",
"storageAccountId",
")",
"{",
"storageAccountId",
"=",
"checkStorageAccountId",
"(",
"storageAccountId",
")",
";",
"log",
".",
"info",
"(",
"\"Expiring storage provider connection! Storage account id: {}\"",
",",
"storageAccountId",
")",
";",
"storageProviders",
".",
"remove",
"(",
"storageAccountId",
")",
";",
"}"
] | Removes a particular storage provider from the cache, which will
require that the connection be recreated on the next call.
@param storageAccountId - the ID of the storage provider account | [
"Removes",
"a",
"particular",
"storage",
"provider",
"from",
"the",
"cache",
"which",
"will",
"require",
"that",
"the",
"connection",
"be",
"recreated",
"on",
"the",
"next",
"call",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/util/StorageProviderFactoryImpl.java#L271-L277 |
141,376 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/util/ProviderFactoryBase.java | ProviderFactoryBase.initialize | public void initialize(DuraStoreInitConfig initConfig,
String instanceHost,
String instancePort,
String accountId)
throws StorageException {
this.initConfig = initConfig;
storageAccountManager.initialize(initConfig.getStorageAccounts());
storageAccountManager.setEnvironment(instanceHost, instancePort, accountId);
} | java | public void initialize(DuraStoreInitConfig initConfig,
String instanceHost,
String instancePort,
String accountId)
throws StorageException {
this.initConfig = initConfig;
storageAccountManager.initialize(initConfig.getStorageAccounts());
storageAccountManager.setEnvironment(instanceHost, instancePort, accountId);
} | [
"public",
"void",
"initialize",
"(",
"DuraStoreInitConfig",
"initConfig",
",",
"String",
"instanceHost",
",",
"String",
"instancePort",
",",
"String",
"accountId",
")",
"throws",
"StorageException",
"{",
"this",
".",
"initConfig",
"=",
"initConfig",
";",
"storageAccountManager",
".",
"initialize",
"(",
"initConfig",
".",
"getStorageAccounts",
"(",
")",
")",
";",
"storageAccountManager",
".",
"setEnvironment",
"(",
"instanceHost",
",",
"instancePort",
",",
"accountId",
")",
";",
"}"
] | Initializes DuraStore with account information
necessary to connect to Storage Providers. | [
"Initializes",
"DuraStore",
"with",
"account",
"information",
"necessary",
"to",
"connect",
"to",
"Storage",
"Providers",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/util/ProviderFactoryBase.java#L36-L44 |
141,377 | duracloud/duracloud | common-queue/src/main/java/org/duracloud/common/queue/task/Task.java | Task.getAttempts | public int getAttempts() {
String attempts = this.properties.get("attempts");
if (attempts == null) {
attempts = "0";
}
return Integer.parseInt(attempts);
} | java | public int getAttempts() {
String attempts = this.properties.get("attempts");
if (attempts == null) {
attempts = "0";
}
return Integer.parseInt(attempts);
} | [
"public",
"int",
"getAttempts",
"(",
")",
"{",
"String",
"attempts",
"=",
"this",
".",
"properties",
".",
"get",
"(",
"\"attempts\"",
")",
";",
"if",
"(",
"attempts",
"==",
"null",
")",
"{",
"attempts",
"=",
"\"0\"",
";",
"}",
"return",
"Integer",
".",
"parseInt",
"(",
"attempts",
")",
";",
"}"
] | The number of completed attempts to process this task.
@return | [
"The",
"number",
"of",
"completed",
"attempts",
"to",
"process",
"this",
"task",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-queue/src/main/java/org/duracloud/common/queue/task/Task.java#L72-L79 |
141,378 | duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3task/streaminghls/GetHlsSignedCookiesUrlTaskRunner.java | GetHlsSignedCookiesUrlTaskRunner.performTask | public String performTask(String taskParameters) {
GetSignedCookiesUrlTaskParameters taskParams =
GetSignedCookiesUrlTaskParameters.deserialize(taskParameters);
String spaceId = taskParams.getSpaceId();
String ipAddress = taskParams.getIpAddress();
int minutesToExpire = taskParams.getMinutesToExpire();
if (minutesToExpire <= 0) {
minutesToExpire = DEFAULT_MINUTES_TO_EXPIRE;
}
String redirectUrl = taskParams.getRedirectUrl();
log.info("Performing " + TASK_NAME + " task with parameters: spaceId=" + spaceId +
", minutesToExpire=" + minutesToExpire + ", ipAddress=" + ipAddress +
", redirectUrl=" + redirectUrl);
// Will throw if bucket does not exist
String bucketName = unwrappedS3Provider.getBucketName(spaceId);
// Ensure that streaming service is on
checkThatStreamingServiceIsEnabled(spaceId, TASK_NAME);
// Retrieve the existing distribution for the given space
DistributionSummary existingDist = getExistingDistribution(bucketName);
if (null == existingDist) {
throw new UnsupportedTaskException(TASK_NAME,
"The " + TASK_NAME + " task can only be used after a space " +
"has been configured to enable secure streaming. Use " +
StorageTaskConstants.ENABLE_STREAMING_TASK_NAME +
" to enable secure streaming on this space.");
}
String domainName = existingDist.getDomainName();
// Define expiration date/time
Calendar expireCalendar = Calendar.getInstance();
expireCalendar.add(Calendar.MINUTE, minutesToExpire);
Map<String, String> signedCookies = new HashMap<>();
try {
File cfKeyPathFile = getCfKeyPathFile(this.cfKeyPath);
// Generate signed cookies
CloudFrontCookieSigner.CookiesForCustomPolicy cookies =
CloudFrontCookieSigner.getCookiesForCustomPolicy(
SignerUtils.Protocol.https,
domainName,
cfKeyPathFile,
"*",
cfKeyId,
expireCalendar.getTime(),
null,
ipAddress);
signedCookies.put(cookies.getPolicy().getKey(), cookies.getPolicy().getValue());
signedCookies.put(cookies.getSignature().getKey(), cookies.getSignature().getValue());
signedCookies.put(cookies.getKeyPairId().getKey(), cookies.getKeyPairId().getValue());
} catch (InvalidKeySpecException | IOException e) {
throw new RuntimeException("Error encountered attempting to create signed cookies in task " +
TASK_NAME + ": " + e.getMessage(), e);
}
String token = storeCookies(signedCookies, domainName, redirectUrl);
GetSignedCookiesUrlTaskResult taskResult = new GetSignedCookiesUrlTaskResult();
taskResult.setSignedCookiesUrl("https://" + domainName + "/cookies?token=" + token);
String toReturn = taskResult.serialize();
log.info("Result of " + TASK_NAME + " task: " + toReturn);
return toReturn;
} | java | public String performTask(String taskParameters) {
GetSignedCookiesUrlTaskParameters taskParams =
GetSignedCookiesUrlTaskParameters.deserialize(taskParameters);
String spaceId = taskParams.getSpaceId();
String ipAddress = taskParams.getIpAddress();
int minutesToExpire = taskParams.getMinutesToExpire();
if (minutesToExpire <= 0) {
minutesToExpire = DEFAULT_MINUTES_TO_EXPIRE;
}
String redirectUrl = taskParams.getRedirectUrl();
log.info("Performing " + TASK_NAME + " task with parameters: spaceId=" + spaceId +
", minutesToExpire=" + minutesToExpire + ", ipAddress=" + ipAddress +
", redirectUrl=" + redirectUrl);
// Will throw if bucket does not exist
String bucketName = unwrappedS3Provider.getBucketName(spaceId);
// Ensure that streaming service is on
checkThatStreamingServiceIsEnabled(spaceId, TASK_NAME);
// Retrieve the existing distribution for the given space
DistributionSummary existingDist = getExistingDistribution(bucketName);
if (null == existingDist) {
throw new UnsupportedTaskException(TASK_NAME,
"The " + TASK_NAME + " task can only be used after a space " +
"has been configured to enable secure streaming. Use " +
StorageTaskConstants.ENABLE_STREAMING_TASK_NAME +
" to enable secure streaming on this space.");
}
String domainName = existingDist.getDomainName();
// Define expiration date/time
Calendar expireCalendar = Calendar.getInstance();
expireCalendar.add(Calendar.MINUTE, minutesToExpire);
Map<String, String> signedCookies = new HashMap<>();
try {
File cfKeyPathFile = getCfKeyPathFile(this.cfKeyPath);
// Generate signed cookies
CloudFrontCookieSigner.CookiesForCustomPolicy cookies =
CloudFrontCookieSigner.getCookiesForCustomPolicy(
SignerUtils.Protocol.https,
domainName,
cfKeyPathFile,
"*",
cfKeyId,
expireCalendar.getTime(),
null,
ipAddress);
signedCookies.put(cookies.getPolicy().getKey(), cookies.getPolicy().getValue());
signedCookies.put(cookies.getSignature().getKey(), cookies.getSignature().getValue());
signedCookies.put(cookies.getKeyPairId().getKey(), cookies.getKeyPairId().getValue());
} catch (InvalidKeySpecException | IOException e) {
throw new RuntimeException("Error encountered attempting to create signed cookies in task " +
TASK_NAME + ": " + e.getMessage(), e);
}
String token = storeCookies(signedCookies, domainName, redirectUrl);
GetSignedCookiesUrlTaskResult taskResult = new GetSignedCookiesUrlTaskResult();
taskResult.setSignedCookiesUrl("https://" + domainName + "/cookies?token=" + token);
String toReturn = taskResult.serialize();
log.info("Result of " + TASK_NAME + " task: " + toReturn);
return toReturn;
} | [
"public",
"String",
"performTask",
"(",
"String",
"taskParameters",
")",
"{",
"GetSignedCookiesUrlTaskParameters",
"taskParams",
"=",
"GetSignedCookiesUrlTaskParameters",
".",
"deserialize",
"(",
"taskParameters",
")",
";",
"String",
"spaceId",
"=",
"taskParams",
".",
"getSpaceId",
"(",
")",
";",
"String",
"ipAddress",
"=",
"taskParams",
".",
"getIpAddress",
"(",
")",
";",
"int",
"minutesToExpire",
"=",
"taskParams",
".",
"getMinutesToExpire",
"(",
")",
";",
"if",
"(",
"minutesToExpire",
"<=",
"0",
")",
"{",
"minutesToExpire",
"=",
"DEFAULT_MINUTES_TO_EXPIRE",
";",
"}",
"String",
"redirectUrl",
"=",
"taskParams",
".",
"getRedirectUrl",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Performing \"",
"+",
"TASK_NAME",
"+",
"\" task with parameters: spaceId=\"",
"+",
"spaceId",
"+",
"\", minutesToExpire=\"",
"+",
"minutesToExpire",
"+",
"\", ipAddress=\"",
"+",
"ipAddress",
"+",
"\", redirectUrl=\"",
"+",
"redirectUrl",
")",
";",
"// Will throw if bucket does not exist",
"String",
"bucketName",
"=",
"unwrappedS3Provider",
".",
"getBucketName",
"(",
"spaceId",
")",
";",
"// Ensure that streaming service is on",
"checkThatStreamingServiceIsEnabled",
"(",
"spaceId",
",",
"TASK_NAME",
")",
";",
"// Retrieve the existing distribution for the given space",
"DistributionSummary",
"existingDist",
"=",
"getExistingDistribution",
"(",
"bucketName",
")",
";",
"if",
"(",
"null",
"==",
"existingDist",
")",
"{",
"throw",
"new",
"UnsupportedTaskException",
"(",
"TASK_NAME",
",",
"\"The \"",
"+",
"TASK_NAME",
"+",
"\" task can only be used after a space \"",
"+",
"\"has been configured to enable secure streaming. Use \"",
"+",
"StorageTaskConstants",
".",
"ENABLE_STREAMING_TASK_NAME",
"+",
"\" to enable secure streaming on this space.\"",
")",
";",
"}",
"String",
"domainName",
"=",
"existingDist",
".",
"getDomainName",
"(",
")",
";",
"// Define expiration date/time",
"Calendar",
"expireCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"expireCalendar",
".",
"add",
"(",
"Calendar",
".",
"MINUTE",
",",
"minutesToExpire",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"signedCookies",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"try",
"{",
"File",
"cfKeyPathFile",
"=",
"getCfKeyPathFile",
"(",
"this",
".",
"cfKeyPath",
")",
";",
"// Generate signed cookies",
"CloudFrontCookieSigner",
".",
"CookiesForCustomPolicy",
"cookies",
"=",
"CloudFrontCookieSigner",
".",
"getCookiesForCustomPolicy",
"(",
"SignerUtils",
".",
"Protocol",
".",
"https",
",",
"domainName",
",",
"cfKeyPathFile",
",",
"\"*\"",
",",
"cfKeyId",
",",
"expireCalendar",
".",
"getTime",
"(",
")",
",",
"null",
",",
"ipAddress",
")",
";",
"signedCookies",
".",
"put",
"(",
"cookies",
".",
"getPolicy",
"(",
")",
".",
"getKey",
"(",
")",
",",
"cookies",
".",
"getPolicy",
"(",
")",
".",
"getValue",
"(",
")",
")",
";",
"signedCookies",
".",
"put",
"(",
"cookies",
".",
"getSignature",
"(",
")",
".",
"getKey",
"(",
")",
",",
"cookies",
".",
"getSignature",
"(",
")",
".",
"getValue",
"(",
")",
")",
";",
"signedCookies",
".",
"put",
"(",
"cookies",
".",
"getKeyPairId",
"(",
")",
".",
"getKey",
"(",
")",
",",
"cookies",
".",
"getKeyPairId",
"(",
")",
".",
"getValue",
"(",
")",
")",
";",
"}",
"catch",
"(",
"InvalidKeySpecException",
"|",
"IOException",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Error encountered attempting to create signed cookies in task \"",
"+",
"TASK_NAME",
"+",
"\": \"",
"+",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"String",
"token",
"=",
"storeCookies",
"(",
"signedCookies",
",",
"domainName",
",",
"redirectUrl",
")",
";",
"GetSignedCookiesUrlTaskResult",
"taskResult",
"=",
"new",
"GetSignedCookiesUrlTaskResult",
"(",
")",
";",
"taskResult",
".",
"setSignedCookiesUrl",
"(",
"\"https://\"",
"+",
"domainName",
"+",
"\"/cookies?token=\"",
"+",
"token",
")",
";",
"String",
"toReturn",
"=",
"taskResult",
".",
"serialize",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Result of \"",
"+",
"TASK_NAME",
"+",
"\" task: \"",
"+",
"toReturn",
")",
";",
"return",
"toReturn",
";",
"}"
] | Create and store signed cookies | [
"Create",
"and",
"store",
"signed",
"cookies"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3task/streaminghls/GetHlsSignedCookiesUrlTaskRunner.java#L77-L146 |
141,379 | duracloud/duracloud | retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalManager.java | RetrievalManager.run | public void run() {
try {
while (!complete) {
ContentItem contentItem = new Retrier(5, 4000, 2).execute(() -> {
return source.getNextContentItem();
});
if (contentItem == null) {
break;
}
while (!retrieveContent(contentItem)) {
sleep(1000);
}
}
} catch (Exception ex) {
logger.error("Failed to run to completion", ex);
} finally {
shutdown();
}
} | java | public void run() {
try {
while (!complete) {
ContentItem contentItem = new Retrier(5, 4000, 2).execute(() -> {
return source.getNextContentItem();
});
if (contentItem == null) {
break;
}
while (!retrieveContent(contentItem)) {
sleep(1000);
}
}
} catch (Exception ex) {
logger.error("Failed to run to completion", ex);
} finally {
shutdown();
}
} | [
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"while",
"(",
"!",
"complete",
")",
"{",
"ContentItem",
"contentItem",
"=",
"new",
"Retrier",
"(",
"5",
",",
"4000",
",",
"2",
")",
".",
"execute",
"(",
"(",
")",
"->",
"{",
"return",
"source",
".",
"getNextContentItem",
"(",
")",
";",
"}",
")",
";",
"if",
"(",
"contentItem",
"==",
"null",
")",
"{",
"break",
";",
"}",
"while",
"(",
"!",
"retrieveContent",
"(",
"contentItem",
")",
")",
"{",
"sleep",
"(",
"1000",
")",
";",
"}",
"}",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"logger",
".",
"error",
"(",
"\"Failed to run to completion\"",
",",
"ex",
")",
";",
"}",
"finally",
"{",
"shutdown",
"(",
")",
";",
"}",
"}"
] | Begins the content retrieval process | [
"Begins",
"the",
"content",
"retrieval",
"process"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalManager.java#L74-L96 |
141,380 | duracloud/duracloud | retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalManager.java | RetrievalManager.shutdown | public void shutdown() {
logger.info("Closing Retrieval Manager");
workerPool.shutdown();
try {
workerPool.awaitTermination(30, TimeUnit.MINUTES);
} catch (InterruptedException e) {
// Exit wait on interruption
}
complete = true;
} | java | public void shutdown() {
logger.info("Closing Retrieval Manager");
workerPool.shutdown();
try {
workerPool.awaitTermination(30, TimeUnit.MINUTES);
} catch (InterruptedException e) {
// Exit wait on interruption
}
complete = true;
} | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Closing Retrieval Manager\"",
")",
";",
"workerPool",
".",
"shutdown",
"(",
")",
";",
"try",
"{",
"workerPool",
".",
"awaitTermination",
"(",
"30",
",",
"TimeUnit",
".",
"MINUTES",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// Exit wait on interruption",
"}",
"complete",
"=",
"true",
";",
"}"
] | Stops the retrieval, no further files will be retrieved after those
which are in progress have completed. | [
"Stops",
"the",
"retrieval",
"no",
"further",
"files",
"will",
"be",
"retrieved",
"after",
"those",
"which",
"are",
"in",
"progress",
"have",
"completed",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalManager.java#L127-L138 |
141,381 | duracloud/duracloud | common-xml/src/main/java/org/duracloud/common/xml/XmlSerializer.java | XmlSerializer.serialize | public String serialize(T obj) {
try {
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
StringWriter writer = new StringWriter();
marshaller.marshal(obj, writer);
return writer.toString();
} catch (JAXBException e) {
throw new XmlSerializationException("Exception encountered " +
"serializing report: " +
getErrorMsg(e), e);
}
} | java | public String serialize(T obj) {
try {
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
StringWriter writer = new StringWriter();
marshaller.marshal(obj, writer);
return writer.toString();
} catch (JAXBException e) {
throw new XmlSerializationException("Exception encountered " +
"serializing report: " +
getErrorMsg(e), e);
}
} | [
"public",
"String",
"serialize",
"(",
"T",
"obj",
")",
"{",
"try",
"{",
"Marshaller",
"marshaller",
"=",
"context",
".",
"createMarshaller",
"(",
")",
";",
"marshaller",
".",
"setProperty",
"(",
"Marshaller",
".",
"JAXB_FORMATTED_OUTPUT",
",",
"true",
")",
";",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"marshaller",
".",
"marshal",
"(",
"obj",
",",
"writer",
")",
";",
"return",
"writer",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"JAXBException",
"e",
")",
"{",
"throw",
"new",
"XmlSerializationException",
"(",
"\"Exception encountered \"",
"+",
"\"serializing report: \"",
"+",
"getErrorMsg",
"(",
"e",
")",
",",
"e",
")",
";",
"}",
"}"
] | Serializes the data stored within a java bean to XML. The bean and any
ancillary beans should include JAXB binding annotations.
@param obj to serialize
@return XML | [
"Serializes",
"the",
"data",
"stored",
"within",
"a",
"java",
"bean",
"to",
"XML",
".",
"The",
"bean",
"and",
"any",
"ancillary",
"beans",
"should",
"include",
"JAXB",
"binding",
"annotations",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-xml/src/main/java/org/duracloud/common/xml/XmlSerializer.java#L85-L97 |
141,382 | duracloud/duracloud | common-xml/src/main/java/org/duracloud/common/xml/XmlSerializer.java | XmlSerializer.deserialize | public T deserialize(String xml) {
if (xml == null || xml.equals("")) {
throw new RuntimeException("XML cannot be null or empty");
} else {
return deserialize(new StreamSource(new StringReader(xml)));
}
} | java | public T deserialize(String xml) {
if (xml == null || xml.equals("")) {
throw new RuntimeException("XML cannot be null or empty");
} else {
return deserialize(new StreamSource(new StringReader(xml)));
}
} | [
"public",
"T",
"deserialize",
"(",
"String",
"xml",
")",
"{",
"if",
"(",
"xml",
"==",
"null",
"||",
"xml",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"XML cannot be null or empty\"",
")",
";",
"}",
"else",
"{",
"return",
"deserialize",
"(",
"new",
"StreamSource",
"(",
"new",
"StringReader",
"(",
"xml",
")",
")",
")",
";",
"}",
"}"
] | De-serializes XML into an object structure.
@param xml to de-serialize
@return de-serialized object | [
"De",
"-",
"serializes",
"XML",
"into",
"an",
"object",
"structure",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-xml/src/main/java/org/duracloud/common/xml/XmlSerializer.java#L105-L111 |
141,383 | duracloud/duracloud | common-xml/src/main/java/org/duracloud/common/xml/XmlSerializer.java | XmlSerializer.deserialize | public T deserialize(InputStream stream) {
if (stream == null) {
throw new RuntimeException("Stream cannot be null");
} else {
return deserialize(new StreamSource(stream));
}
} | java | public T deserialize(InputStream stream) {
if (stream == null) {
throw new RuntimeException("Stream cannot be null");
} else {
return deserialize(new StreamSource(stream));
}
} | [
"public",
"T",
"deserialize",
"(",
"InputStream",
"stream",
")",
"{",
"if",
"(",
"stream",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Stream cannot be null\"",
")",
";",
"}",
"else",
"{",
"return",
"deserialize",
"(",
"new",
"StreamSource",
"(",
"stream",
")",
")",
";",
"}",
"}"
] | De-serializes XML from an InputStream into an object structure.
@param stream containing XML to de-serialize
@return de-serialized object | [
"De",
"-",
"serializes",
"XML",
"from",
"an",
"InputStream",
"into",
"an",
"object",
"structure",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-xml/src/main/java/org/duracloud/common/xml/XmlSerializer.java#L119-L125 |
141,384 | duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java | StorageProviderBase.getSpaceProperties | public Map<String, String> getSpaceProperties(String spaceId) {
Map<String, String> spaceProps = new HashMap<String, String>();
Map<String, String> allProps = getAllSpaceProperties(spaceId);
// ONLY include non-ACL properties.
for (String name : allProps.keySet()) {
if (!name.startsWith(PROPERTIES_SPACE_ACL)) {
spaceProps.put(name, allProps.get(name));
}
}
return spaceProps;
} | java | public Map<String, String> getSpaceProperties(String spaceId) {
Map<String, String> spaceProps = new HashMap<String, String>();
Map<String, String> allProps = getAllSpaceProperties(spaceId);
// ONLY include non-ACL properties.
for (String name : allProps.keySet()) {
if (!name.startsWith(PROPERTIES_SPACE_ACL)) {
spaceProps.put(name, allProps.get(name));
}
}
return spaceProps;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getSpaceProperties",
"(",
"String",
"spaceId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"spaceProps",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"allProps",
"=",
"getAllSpaceProperties",
"(",
"spaceId",
")",
";",
"// ONLY include non-ACL properties.",
"for",
"(",
"String",
"name",
":",
"allProps",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"!",
"name",
".",
"startsWith",
"(",
"PROPERTIES_SPACE_ACL",
")",
")",
"{",
"spaceProps",
".",
"put",
"(",
"name",
",",
"allProps",
".",
"get",
"(",
"name",
")",
")",
";",
"}",
"}",
"return",
"spaceProps",
";",
"}"
] | This method returns all of the space properties EXCEPT the ACLs
@param spaceId - ID of the space
@return map of space properties | [
"This",
"method",
"returns",
"all",
"of",
"the",
"space",
"properties",
"EXCEPT",
"the",
"ACLs"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java#L55-L67 |
141,385 | duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java | StorageProviderBase.setNewSpaceProperties | public void setNewSpaceProperties(String spaceId,
Map<String, String> spaceProperties) {
setNewSpaceProperties(spaceId, spaceProperties, getSpaceACLs(spaceId));
} | java | public void setNewSpaceProperties(String spaceId,
Map<String, String> spaceProperties) {
setNewSpaceProperties(spaceId, spaceProperties, getSpaceACLs(spaceId));
} | [
"public",
"void",
"setNewSpaceProperties",
"(",
"String",
"spaceId",
",",
"Map",
"<",
"String",
",",
"String",
">",
"spaceProperties",
")",
"{",
"setNewSpaceProperties",
"(",
"spaceId",
",",
"spaceProperties",
",",
"getSpaceACLs",
"(",
"spaceId",
")",
")",
";",
"}"
] | Sets the properties on this space. Maintains the current ACL settings.
@param spaceId
@param spaceProperties
@link setNewSpaceProperties(spaceId, spaceProperties, spaceACLs) | [
"Sets",
"the",
"properties",
"on",
"this",
"space",
".",
"Maintains",
"the",
"current",
"ACL",
"settings",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java#L76-L79 |
141,386 | duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java | StorageProviderBase.setNewSpaceProperties | public void setNewSpaceProperties(String spaceId,
Map<String, String> spaceProperties,
Map<String, AclType> spaceACLs) {
// Add ACLs to the properties list
spaceProperties.putAll(packACLs(spaceACLs));
boolean success = false;
int maxLoops = 6;
for (int loops = 0; !success && loops < maxLoops; loops++) {
try {
doSetSpaceProperties(spaceId, spaceProperties);
success = true;
} catch (NotFoundException e) {
success = false;
}
}
if (!success) {
throw new StorageException(
"Properties for space " + spaceId + " could not be created. " +
"The space cannot be found.");
}
} | java | public void setNewSpaceProperties(String spaceId,
Map<String, String> spaceProperties,
Map<String, AclType> spaceACLs) {
// Add ACLs to the properties list
spaceProperties.putAll(packACLs(spaceACLs));
boolean success = false;
int maxLoops = 6;
for (int loops = 0; !success && loops < maxLoops; loops++) {
try {
doSetSpaceProperties(spaceId, spaceProperties);
success = true;
} catch (NotFoundException e) {
success = false;
}
}
if (!success) {
throw new StorageException(
"Properties for space " + spaceId + " could not be created. " +
"The space cannot be found.");
}
} | [
"public",
"void",
"setNewSpaceProperties",
"(",
"String",
"spaceId",
",",
"Map",
"<",
"String",
",",
"String",
">",
"spaceProperties",
",",
"Map",
"<",
"String",
",",
"AclType",
">",
"spaceACLs",
")",
"{",
"// Add ACLs to the properties list",
"spaceProperties",
".",
"putAll",
"(",
"packACLs",
"(",
"spaceACLs",
")",
")",
";",
"boolean",
"success",
"=",
"false",
";",
"int",
"maxLoops",
"=",
"6",
";",
"for",
"(",
"int",
"loops",
"=",
"0",
";",
"!",
"success",
"&&",
"loops",
"<",
"maxLoops",
";",
"loops",
"++",
")",
"{",
"try",
"{",
"doSetSpaceProperties",
"(",
"spaceId",
",",
"spaceProperties",
")",
";",
"success",
"=",
"true",
";",
"}",
"catch",
"(",
"NotFoundException",
"e",
")",
"{",
"success",
"=",
"false",
";",
"}",
"}",
"if",
"(",
"!",
"success",
")",
"{",
"throw",
"new",
"StorageException",
"(",
"\"Properties for space \"",
"+",
"spaceId",
"+",
"\" could not be created. \"",
"+",
"\"The space cannot be found.\"",
")",
";",
"}",
"}"
] | Sets the properties of this space. Note that this method is intentionally
not exposed to users, as it is not meant to be used for user properties,
but only for system-level properties. The names and values need to be
kept short, and the overall number of properties needs to be tightly
limited, or there will be issues due to provider-specific limitation.
This method allows for Space Access control details to be updated at the same
time as space properties.
@param spaceId
@param spaceProperties
@param spaceACLs | [
"Sets",
"the",
"properties",
"of",
"this",
"space",
".",
"Note",
"that",
"this",
"method",
"is",
"intentionally",
"not",
"exposed",
"to",
"users",
"as",
"it",
"is",
"not",
"meant",
"to",
"be",
"used",
"for",
"user",
"properties",
"but",
"only",
"for",
"system",
"-",
"level",
"properties",
".",
"The",
"names",
"and",
"values",
"need",
"to",
"be",
"kept",
"short",
"and",
"the",
"overall",
"number",
"of",
"properties",
"needs",
"to",
"be",
"tightly",
"limited",
"or",
"there",
"will",
"be",
"issues",
"due",
"to",
"provider",
"-",
"specific",
"limitation",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java#L95-L117 |
141,387 | duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java | StorageProviderBase.deleteSpaceSync | public void deleteSpaceSync(String spaceId) {
log.debug("deleteSpaceSync(" + spaceId + ")");
throwIfSpaceNotExist(spaceId);
Map<String, String> allProps = getAllSpaceProperties(spaceId);
allProps.put("is-delete", "true");
doSetSpaceProperties(spaceId, allProps);
SpaceDeleteWorker deleteWorker = getSpaceDeleteWorker(spaceId);
deleteWorker.run();
} | java | public void deleteSpaceSync(String spaceId) {
log.debug("deleteSpaceSync(" + spaceId + ")");
throwIfSpaceNotExist(spaceId);
Map<String, String> allProps = getAllSpaceProperties(spaceId);
allProps.put("is-delete", "true");
doSetSpaceProperties(spaceId, allProps);
SpaceDeleteWorker deleteWorker = getSpaceDeleteWorker(spaceId);
deleteWorker.run();
} | [
"public",
"void",
"deleteSpaceSync",
"(",
"String",
"spaceId",
")",
"{",
"log",
".",
"debug",
"(",
"\"deleteSpaceSync(\"",
"+",
"spaceId",
"+",
"\")\"",
")",
";",
"throwIfSpaceNotExist",
"(",
"spaceId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"allProps",
"=",
"getAllSpaceProperties",
"(",
"spaceId",
")",
";",
"allProps",
".",
"put",
"(",
"\"is-delete\"",
",",
"\"true\"",
")",
";",
"doSetSpaceProperties",
"(",
"spaceId",
",",
"allProps",
")",
";",
"SpaceDeleteWorker",
"deleteWorker",
"=",
"getSpaceDeleteWorker",
"(",
"spaceId",
")",
";",
"deleteWorker",
".",
"run",
"(",
")",
";",
"}"
] | This method is only intended to be used by tests!
@param spaceId | [
"This",
"method",
"is",
"only",
"intended",
"to",
"be",
"used",
"by",
"tests!"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/provider/StorageProviderBase.java#L315-L325 |
141,388 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/TaskRest.java | TaskRest.getSupportedTasks | @GET
public Response getSupportedTasks(@QueryParam("storeID") String storeID) {
String msg = "getting suppported tasks(" + storeID + ")";
try {
TaskProvider taskProvider =
taskProviderFactory.getTaskProvider(storeID);
List<String> supportedTasks = taskProvider.getSupportedTasks();
String responseText =
SerializationUtil.serializeList(supportedTasks);
return responseOkXml(msg, responseText);
} catch (Exception e) {
return responseBad(msg, e, INTERNAL_SERVER_ERROR);
}
} | java | @GET
public Response getSupportedTasks(@QueryParam("storeID") String storeID) {
String msg = "getting suppported tasks(" + storeID + ")";
try {
TaskProvider taskProvider =
taskProviderFactory.getTaskProvider(storeID);
List<String> supportedTasks = taskProvider.getSupportedTasks();
String responseText =
SerializationUtil.serializeList(supportedTasks);
return responseOkXml(msg, responseText);
} catch (Exception e) {
return responseBad(msg, e, INTERNAL_SERVER_ERROR);
}
} | [
"@",
"GET",
"public",
"Response",
"getSupportedTasks",
"(",
"@",
"QueryParam",
"(",
"\"storeID\"",
")",
"String",
"storeID",
")",
"{",
"String",
"msg",
"=",
"\"getting suppported tasks(\"",
"+",
"storeID",
"+",
"\")\"",
";",
"try",
"{",
"TaskProvider",
"taskProvider",
"=",
"taskProviderFactory",
".",
"getTaskProvider",
"(",
"storeID",
")",
";",
"List",
"<",
"String",
">",
"supportedTasks",
"=",
"taskProvider",
".",
"getSupportedTasks",
"(",
")",
";",
"String",
"responseText",
"=",
"SerializationUtil",
".",
"serializeList",
"(",
"supportedTasks",
")",
";",
"return",
"responseOkXml",
"(",
"msg",
",",
"responseText",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"INTERNAL_SERVER_ERROR",
")",
";",
"}",
"}"
] | Gets a listing of supported tasks for a given provider
@return 200 on success | [
"Gets",
"a",
"listing",
"of",
"supported",
"tasks",
"for",
"a",
"given",
"provider"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/TaskRest.java#L68-L83 |
141,389 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/TaskRest.java | TaskRest.performTask | @Path("/{taskName}")
@POST
public Response performTask(@PathParam("taskName") String taskName,
@QueryParam("storeID") String storeID) {
String msg = "performing task(" + taskName + ", " + storeID + ")";
String taskParameters = null;
try {
taskParameters = getTaskParameters();
} catch (Exception e) {
return responseBad(msg, e, INTERNAL_SERVER_ERROR);
}
try {
TaskProvider taskProvider = taskProviderFactory.getTaskProvider(storeID);
String responseText = taskProvider.performTask(taskName, taskParameters);
return responseOk(msg, responseText);
} catch (UnsupportedTaskException e) {
return responseBad(msg, e, BAD_REQUEST);
} catch (UnauthorizedException e) {
return responseBad(msg, e, FORBIDDEN);
} catch (StorageStateException e) {
return responseBad(msg, e, CONFLICT);
} catch (ServerConflictException e) {
return responseBad(msg, e, Response.Status.CONFLICT);
} catch (Exception e) {
return responseBad(msg, e, INTERNAL_SERVER_ERROR);
}
} | java | @Path("/{taskName}")
@POST
public Response performTask(@PathParam("taskName") String taskName,
@QueryParam("storeID") String storeID) {
String msg = "performing task(" + taskName + ", " + storeID + ")";
String taskParameters = null;
try {
taskParameters = getTaskParameters();
} catch (Exception e) {
return responseBad(msg, e, INTERNAL_SERVER_ERROR);
}
try {
TaskProvider taskProvider = taskProviderFactory.getTaskProvider(storeID);
String responseText = taskProvider.performTask(taskName, taskParameters);
return responseOk(msg, responseText);
} catch (UnsupportedTaskException e) {
return responseBad(msg, e, BAD_REQUEST);
} catch (UnauthorizedException e) {
return responseBad(msg, e, FORBIDDEN);
} catch (StorageStateException e) {
return responseBad(msg, e, CONFLICT);
} catch (ServerConflictException e) {
return responseBad(msg, e, Response.Status.CONFLICT);
} catch (Exception e) {
return responseBad(msg, e, INTERNAL_SERVER_ERROR);
}
} | [
"@",
"Path",
"(",
"\"/{taskName}\"",
")",
"@",
"POST",
"public",
"Response",
"performTask",
"(",
"@",
"PathParam",
"(",
"\"taskName\"",
")",
"String",
"taskName",
",",
"@",
"QueryParam",
"(",
"\"storeID\"",
")",
"String",
"storeID",
")",
"{",
"String",
"msg",
"=",
"\"performing task(\"",
"+",
"taskName",
"+",
"\", \"",
"+",
"storeID",
"+",
"\")\"",
";",
"String",
"taskParameters",
"=",
"null",
";",
"try",
"{",
"taskParameters",
"=",
"getTaskParameters",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"INTERNAL_SERVER_ERROR",
")",
";",
"}",
"try",
"{",
"TaskProvider",
"taskProvider",
"=",
"taskProviderFactory",
".",
"getTaskProvider",
"(",
"storeID",
")",
";",
"String",
"responseText",
"=",
"taskProvider",
".",
"performTask",
"(",
"taskName",
",",
"taskParameters",
")",
";",
"return",
"responseOk",
"(",
"msg",
",",
"responseText",
")",
";",
"}",
"catch",
"(",
"UnsupportedTaskException",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"BAD_REQUEST",
")",
";",
"}",
"catch",
"(",
"UnauthorizedException",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"FORBIDDEN",
")",
";",
"}",
"catch",
"(",
"StorageStateException",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"CONFLICT",
")",
";",
"}",
"catch",
"(",
"ServerConflictException",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"Response",
".",
"Status",
".",
"CONFLICT",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"responseBad",
"(",
"msg",
",",
"e",
",",
"INTERNAL_SERVER_ERROR",
")",
";",
"}",
"}"
] | Performs a task
@return 200 on success | [
"Performs",
"a",
"task"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/TaskRest.java#L90-L121 |
141,390 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java | ContentResourceImpl.getContent | @Override
public RetrievedContent getContent(String spaceID,
String contentID,
String storeID,
String range)
throws InvalidRequestException, ResourceException {
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
return storage.getContent(spaceID, contentID, range);
} catch (NotFoundException e) {
throw new ResourceNotFoundException("get content",
spaceID,
contentID,
e);
} catch (StorageStateException e) {
throw new ResourceStateException("get content",
spaceID,
contentID,
e);
} catch (IllegalArgumentException e) {
throw new InvalidRequestException(e.getMessage());
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("get content", spaceID, contentID, e);
}
} | java | @Override
public RetrievedContent getContent(String spaceID,
String contentID,
String storeID,
String range)
throws InvalidRequestException, ResourceException {
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
return storage.getContent(spaceID, contentID, range);
} catch (NotFoundException e) {
throw new ResourceNotFoundException("get content",
spaceID,
contentID,
e);
} catch (StorageStateException e) {
throw new ResourceStateException("get content",
spaceID,
contentID,
e);
} catch (IllegalArgumentException e) {
throw new InvalidRequestException(e.getMessage());
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("get content", spaceID, contentID, e);
}
} | [
"@",
"Override",
"public",
"RetrievedContent",
"getContent",
"(",
"String",
"spaceID",
",",
"String",
"contentID",
",",
"String",
"storeID",
",",
"String",
"range",
")",
"throws",
"InvalidRequestException",
",",
"ResourceException",
"{",
"try",
"{",
"StorageProvider",
"storage",
"=",
"storageProviderFactory",
".",
"getStorageProvider",
"(",
"storeID",
")",
";",
"return",
"storage",
".",
"getContent",
"(",
"spaceID",
",",
"contentID",
",",
"range",
")",
";",
"}",
"catch",
"(",
"NotFoundException",
"e",
")",
"{",
"throw",
"new",
"ResourceNotFoundException",
"(",
"\"get content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"StorageStateException",
"e",
")",
"{",
"throw",
"new",
"ResourceStateException",
"(",
"\"get content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"throw",
"new",
"InvalidRequestException",
"(",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"storageProviderFactory",
".",
"expireStorageProvider",
"(",
"storeID",
")",
";",
"throw",
"new",
"ResourceException",
"(",
"\"get content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"}"
] | Retrieves content from a space.
@param spaceID
@param contentID
@return InputStream which can be used to read content. | [
"Retrieves",
"content",
"from",
"a",
"space",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java#L56-L83 |
141,391 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java | ContentResourceImpl.getContentProperties | @Override
public Map<String, String> getContentProperties(String spaceID,
String contentID,
String storeID)
throws ResourceException {
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
return storage.getContentProperties(spaceID, contentID);
} catch (NotFoundException e) {
throw new ResourceNotFoundException("get properties for content",
spaceID,
contentID,
e);
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("get properties for content",
spaceID,
contentID,
e);
}
} | java | @Override
public Map<String, String> getContentProperties(String spaceID,
String contentID,
String storeID)
throws ResourceException {
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
return storage.getContentProperties(spaceID, contentID);
} catch (NotFoundException e) {
throw new ResourceNotFoundException("get properties for content",
spaceID,
contentID,
e);
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("get properties for content",
spaceID,
contentID,
e);
}
} | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getContentProperties",
"(",
"String",
"spaceID",
",",
"String",
"contentID",
",",
"String",
"storeID",
")",
"throws",
"ResourceException",
"{",
"try",
"{",
"StorageProvider",
"storage",
"=",
"storageProviderFactory",
".",
"getStorageProvider",
"(",
"storeID",
")",
";",
"return",
"storage",
".",
"getContentProperties",
"(",
"spaceID",
",",
"contentID",
")",
";",
"}",
"catch",
"(",
"NotFoundException",
"e",
")",
"{",
"throw",
"new",
"ResourceNotFoundException",
"(",
"\"get properties for content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"storageProviderFactory",
".",
"expireStorageProvider",
"(",
"storeID",
")",
";",
"throw",
"new",
"ResourceException",
"(",
"\"get properties for content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"}"
] | Retrieves the properties of a piece of content.
@param spaceID
@param contentID
@return Map of content properties | [
"Retrieves",
"the",
"properties",
"of",
"a",
"piece",
"of",
"content",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java#L92-L113 |
141,392 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java | ContentResourceImpl.updateContentProperties | @Override
public void updateContentProperties(String spaceID,
String contentID,
String contentMimeType,
Map<String, String> userProperties,
String storeID)
throws ResourceException {
validateProperties(userProperties, "update properties for content", spaceID, contentID);
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
// Update content properties
if (userProperties != null) {
storage.setContentProperties(spaceID, contentID, userProperties);
}
} catch (NotFoundException e) {
throw new ResourceNotFoundException("update properties for content",
spaceID,
contentID,
e);
} catch (StorageStateException e) {
throw new ResourceStateException("update properties for content",
spaceID,
contentID,
e);
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("update properties for content",
spaceID,
contentID,
e);
}
} | java | @Override
public void updateContentProperties(String spaceID,
String contentID,
String contentMimeType,
Map<String, String> userProperties,
String storeID)
throws ResourceException {
validateProperties(userProperties, "update properties for content", spaceID, contentID);
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
// Update content properties
if (userProperties != null) {
storage.setContentProperties(spaceID, contentID, userProperties);
}
} catch (NotFoundException e) {
throw new ResourceNotFoundException("update properties for content",
spaceID,
contentID,
e);
} catch (StorageStateException e) {
throw new ResourceStateException("update properties for content",
spaceID,
contentID,
e);
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("update properties for content",
spaceID,
contentID,
e);
}
} | [
"@",
"Override",
"public",
"void",
"updateContentProperties",
"(",
"String",
"spaceID",
",",
"String",
"contentID",
",",
"String",
"contentMimeType",
",",
"Map",
"<",
"String",
",",
"String",
">",
"userProperties",
",",
"String",
"storeID",
")",
"throws",
"ResourceException",
"{",
"validateProperties",
"(",
"userProperties",
",",
"\"update properties for content\"",
",",
"spaceID",
",",
"contentID",
")",
";",
"try",
"{",
"StorageProvider",
"storage",
"=",
"storageProviderFactory",
".",
"getStorageProvider",
"(",
"storeID",
")",
";",
"// Update content properties",
"if",
"(",
"userProperties",
"!=",
"null",
")",
"{",
"storage",
".",
"setContentProperties",
"(",
"spaceID",
",",
"contentID",
",",
"userProperties",
")",
";",
"}",
"}",
"catch",
"(",
"NotFoundException",
"e",
")",
"{",
"throw",
"new",
"ResourceNotFoundException",
"(",
"\"update properties for content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"StorageStateException",
"e",
")",
"{",
"throw",
"new",
"ResourceStateException",
"(",
"\"update properties for content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"storageProviderFactory",
".",
"expireStorageProvider",
"(",
"storeID",
")",
";",
"throw",
"new",
"ResourceException",
"(",
"\"update properties for content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"}"
] | Updates the properties of a piece of content.
@return success | [
"Updates",
"the",
"properties",
"of",
"a",
"piece",
"of",
"content",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java#L120-L156 |
141,393 | duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java | ContentResourceImpl.addContent | @Override
public String addContent(String spaceID,
String contentID,
InputStream content,
String contentMimeType,
Map<String, String> userProperties,
long contentSize,
String checksum,
String storeID)
throws ResourceException, InvalidIdException, ResourcePropertiesInvalidException {
IdUtil.validateContentId(contentID);
validateProperties(userProperties, "add content", spaceID, contentID);
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
try {
// overlay new properties on top of older extended properties
// so that old tags and custom properties are preserved.
// c.f. https://jira.duraspace.org/browse/DURACLOUD-757
Map<String, String> oldUserProperties =
storage.getContentProperties(spaceID, contentID);
//remove all non extended properties
if (userProperties != null) {
oldUserProperties.putAll(userProperties);
//use old mimetype if none specified.
String oldMimetype =
oldUserProperties.remove(StorageProvider.PROPERTIES_CONTENT_MIMETYPE);
if (contentMimeType == null || contentMimeType.trim() == "") {
contentMimeType = oldMimetype;
}
oldUserProperties = StorageProviderUtil.removeCalculatedProperties(oldUserProperties);
}
userProperties = oldUserProperties;
} catch (NotFoundException ex) {
// do nothing - no properties to update
// since file did not previous exist.
}
return storage.addContent(spaceID,
contentID,
contentMimeType,
userProperties,
contentSize,
checksum,
content);
} catch (NotFoundException e) {
throw new ResourceNotFoundException("add content",
spaceID,
contentID,
e);
} catch (ChecksumMismatchException e) {
throw new ResourceChecksumException("add content",
spaceID,
contentID,
e);
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("add content", spaceID, contentID, e);
}
} | java | @Override
public String addContent(String spaceID,
String contentID,
InputStream content,
String contentMimeType,
Map<String, String> userProperties,
long contentSize,
String checksum,
String storeID)
throws ResourceException, InvalidIdException, ResourcePropertiesInvalidException {
IdUtil.validateContentId(contentID);
validateProperties(userProperties, "add content", spaceID, contentID);
try {
StorageProvider storage =
storageProviderFactory.getStorageProvider(storeID);
try {
// overlay new properties on top of older extended properties
// so that old tags and custom properties are preserved.
// c.f. https://jira.duraspace.org/browse/DURACLOUD-757
Map<String, String> oldUserProperties =
storage.getContentProperties(spaceID, contentID);
//remove all non extended properties
if (userProperties != null) {
oldUserProperties.putAll(userProperties);
//use old mimetype if none specified.
String oldMimetype =
oldUserProperties.remove(StorageProvider.PROPERTIES_CONTENT_MIMETYPE);
if (contentMimeType == null || contentMimeType.trim() == "") {
contentMimeType = oldMimetype;
}
oldUserProperties = StorageProviderUtil.removeCalculatedProperties(oldUserProperties);
}
userProperties = oldUserProperties;
} catch (NotFoundException ex) {
// do nothing - no properties to update
// since file did not previous exist.
}
return storage.addContent(spaceID,
contentID,
contentMimeType,
userProperties,
contentSize,
checksum,
content);
} catch (NotFoundException e) {
throw new ResourceNotFoundException("add content",
spaceID,
contentID,
e);
} catch (ChecksumMismatchException e) {
throw new ResourceChecksumException("add content",
spaceID,
contentID,
e);
} catch (Exception e) {
storageProviderFactory.expireStorageProvider(storeID);
throw new ResourceException("add content", spaceID, contentID, e);
}
} | [
"@",
"Override",
"public",
"String",
"addContent",
"(",
"String",
"spaceID",
",",
"String",
"contentID",
",",
"InputStream",
"content",
",",
"String",
"contentMimeType",
",",
"Map",
"<",
"String",
",",
"String",
">",
"userProperties",
",",
"long",
"contentSize",
",",
"String",
"checksum",
",",
"String",
"storeID",
")",
"throws",
"ResourceException",
",",
"InvalidIdException",
",",
"ResourcePropertiesInvalidException",
"{",
"IdUtil",
".",
"validateContentId",
"(",
"contentID",
")",
";",
"validateProperties",
"(",
"userProperties",
",",
"\"add content\"",
",",
"spaceID",
",",
"contentID",
")",
";",
"try",
"{",
"StorageProvider",
"storage",
"=",
"storageProviderFactory",
".",
"getStorageProvider",
"(",
"storeID",
")",
";",
"try",
"{",
"// overlay new properties on top of older extended properties",
"// so that old tags and custom properties are preserved.",
"// c.f. https://jira.duraspace.org/browse/DURACLOUD-757",
"Map",
"<",
"String",
",",
"String",
">",
"oldUserProperties",
"=",
"storage",
".",
"getContentProperties",
"(",
"spaceID",
",",
"contentID",
")",
";",
"//remove all non extended properties",
"if",
"(",
"userProperties",
"!=",
"null",
")",
"{",
"oldUserProperties",
".",
"putAll",
"(",
"userProperties",
")",
";",
"//use old mimetype if none specified.",
"String",
"oldMimetype",
"=",
"oldUserProperties",
".",
"remove",
"(",
"StorageProvider",
".",
"PROPERTIES_CONTENT_MIMETYPE",
")",
";",
"if",
"(",
"contentMimeType",
"==",
"null",
"||",
"contentMimeType",
".",
"trim",
"(",
")",
"==",
"\"\"",
")",
"{",
"contentMimeType",
"=",
"oldMimetype",
";",
"}",
"oldUserProperties",
"=",
"StorageProviderUtil",
".",
"removeCalculatedProperties",
"(",
"oldUserProperties",
")",
";",
"}",
"userProperties",
"=",
"oldUserProperties",
";",
"}",
"catch",
"(",
"NotFoundException",
"ex",
")",
"{",
"// do nothing - no properties to update",
"// since file did not previous exist.",
"}",
"return",
"storage",
".",
"addContent",
"(",
"spaceID",
",",
"contentID",
",",
"contentMimeType",
",",
"userProperties",
",",
"contentSize",
",",
"checksum",
",",
"content",
")",
";",
"}",
"catch",
"(",
"NotFoundException",
"e",
")",
"{",
"throw",
"new",
"ResourceNotFoundException",
"(",
"\"add content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"ChecksumMismatchException",
"e",
")",
"{",
"throw",
"new",
"ResourceChecksumException",
"(",
"\"add content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"storageProviderFactory",
".",
"expireStorageProvider",
"(",
"storeID",
")",
";",
"throw",
"new",
"ResourceException",
"(",
"\"add content\"",
",",
"spaceID",
",",
"contentID",
",",
"e",
")",
";",
"}",
"}"
] | Adds content to a space.
@return the checksum of the content as computed by the storage provider | [
"Adds",
"content",
"to",
"a",
"space",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/ContentResourceImpl.java#L192-L256 |
141,394 | duracloud/duracloud | common-notification/src/main/java/org/duracloud/common/notification/NotificationManager.java | NotificationManager.initializeNotifiers | public void initializeNotifiers(Collection<NotificationConfig> notificationConfigs) {
for (NotificationConfig config : notificationConfigs) {
for (Notifier notifier : notifiers) {
if (notifier.getNotificationType().name().equalsIgnoreCase(
config.getType())) {
notifier.initialize(config);
}
}
}
} | java | public void initializeNotifiers(Collection<NotificationConfig> notificationConfigs) {
for (NotificationConfig config : notificationConfigs) {
for (Notifier notifier : notifiers) {
if (notifier.getNotificationType().name().equalsIgnoreCase(
config.getType())) {
notifier.initialize(config);
}
}
}
} | [
"public",
"void",
"initializeNotifiers",
"(",
"Collection",
"<",
"NotificationConfig",
">",
"notificationConfigs",
")",
"{",
"for",
"(",
"NotificationConfig",
"config",
":",
"notificationConfigs",
")",
"{",
"for",
"(",
"Notifier",
"notifier",
":",
"notifiers",
")",
"{",
"if",
"(",
"notifier",
".",
"getNotificationType",
"(",
")",
".",
"name",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"config",
".",
"getType",
"(",
")",
")",
")",
"{",
"notifier",
".",
"initialize",
"(",
"config",
")",
";",
"}",
"}",
"}",
"}"
] | Initializes notifiers using the provided configuration. It is expected
that there will be exactly one config for each notifier type.
- If there is more than one config for a given type, the last
configuration of that type in the list will win.
- If there is a type not represented in the config list, then all
notifiers of that type will remain uninitialized.
@param notificationConfigs set of configuration for notifiers | [
"Initializes",
"notifiers",
"using",
"the",
"provided",
"configuration",
".",
"It",
"is",
"expected",
"that",
"there",
"will",
"be",
"exactly",
"one",
"config",
"for",
"each",
"notifier",
"type",
".",
"-",
"If",
"there",
"is",
"more",
"than",
"one",
"config",
"for",
"a",
"given",
"type",
"the",
"last",
"configuration",
"of",
"that",
"type",
"in",
"the",
"list",
"will",
"win",
".",
"-",
"If",
"there",
"is",
"a",
"type",
"not",
"represented",
"in",
"the",
"config",
"list",
"then",
"all",
"notifiers",
"of",
"that",
"type",
"will",
"remain",
"uninitialized",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-notification/src/main/java/org/duracloud/common/notification/NotificationManager.java#L38-L47 |
141,395 | duracloud/duracloud | common-notification/src/main/java/org/duracloud/common/notification/NotificationManager.java | NotificationManager.sendNotification | public void sendNotification(NotificationType type,
String subject,
String message,
String... destinations) {
for (Notifier notifier : notifiers) {
if (notifier.getNotificationType().equals(type)) {
notifier.notify(subject, message, destinations);
}
}
} | java | public void sendNotification(NotificationType type,
String subject,
String message,
String... destinations) {
for (Notifier notifier : notifiers) {
if (notifier.getNotificationType().equals(type)) {
notifier.notify(subject, message, destinations);
}
}
} | [
"public",
"void",
"sendNotification",
"(",
"NotificationType",
"type",
",",
"String",
"subject",
",",
"String",
"message",
",",
"String",
"...",
"destinations",
")",
"{",
"for",
"(",
"Notifier",
"notifier",
":",
"notifiers",
")",
"{",
"if",
"(",
"notifier",
".",
"getNotificationType",
"(",
")",
".",
"equals",
"(",
"type",
")",
")",
"{",
"notifier",
".",
"notify",
"(",
"subject",
",",
"message",
",",
"destinations",
")",
";",
"}",
"}",
"}"
] | Sends a notification through all configured notifiers of a given type.
@param type of notification to be sent
@param subject of the notification
@param message of the notification
@param destinations where notification is to be sent | [
"Sends",
"a",
"notification",
"through",
"all",
"configured",
"notifiers",
"of",
"a",
"given",
"type",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-notification/src/main/java/org/duracloud/common/notification/NotificationManager.java#L57-L66 |
141,396 | duracloud/duracloud | common-notification/src/main/java/org/duracloud/common/notification/NotificationManager.java | NotificationManager.sendAdminNotification | public void sendAdminNotification(NotificationType type,
String subject,
String message) {
for (Notifier notifier : notifiers) {
if (notifier.getNotificationType().equals(type)) {
notifier.notifyAdmins(subject, message);
}
}
} | java | public void sendAdminNotification(NotificationType type,
String subject,
String message) {
for (Notifier notifier : notifiers) {
if (notifier.getNotificationType().equals(type)) {
notifier.notifyAdmins(subject, message);
}
}
} | [
"public",
"void",
"sendAdminNotification",
"(",
"NotificationType",
"type",
",",
"String",
"subject",
",",
"String",
"message",
")",
"{",
"for",
"(",
"Notifier",
"notifier",
":",
"notifiers",
")",
"{",
"if",
"(",
"notifier",
".",
"getNotificationType",
"(",
")",
".",
"equals",
"(",
"type",
")",
")",
"{",
"notifier",
".",
"notifyAdmins",
"(",
"subject",
",",
"message",
")",
";",
"}",
"}",
"}"
] | Sends a notification to system administrators through all configured
notifiers of a given type.
@param type of notification to be sent
@param subject of the notification
@param message of the notification | [
"Sends",
"a",
"notification",
"to",
"system",
"administrators",
"through",
"all",
"configured",
"notifiers",
"of",
"a",
"given",
"type",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/common-notification/src/main/java/org/duracloud/common/notification/NotificationManager.java#L76-L84 |
141,397 | duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3storage/StringDataStore.java | StringDataStore.storeData | public String storeData(String cookieData) {
try {
String token = generateToken();
ensureSpaceExists();
s3StorageProvider.addHiddenContent(this.hiddenSpaceName, token, Constants.MEDIA_TYPE_APPLICATION_JSON,
IOUtil.writeStringToStream(cookieData));
return token;
} catch (Exception e) {
throw new DuraCloudRuntimeException(e);
}
} | java | public String storeData(String cookieData) {
try {
String token = generateToken();
ensureSpaceExists();
s3StorageProvider.addHiddenContent(this.hiddenSpaceName, token, Constants.MEDIA_TYPE_APPLICATION_JSON,
IOUtil.writeStringToStream(cookieData));
return token;
} catch (Exception e) {
throw new DuraCloudRuntimeException(e);
}
} | [
"public",
"String",
"storeData",
"(",
"String",
"cookieData",
")",
"{",
"try",
"{",
"String",
"token",
"=",
"generateToken",
"(",
")",
";",
"ensureSpaceExists",
"(",
")",
";",
"s3StorageProvider",
".",
"addHiddenContent",
"(",
"this",
".",
"hiddenSpaceName",
",",
"token",
",",
"Constants",
".",
"MEDIA_TYPE_APPLICATION_JSON",
",",
"IOUtil",
".",
"writeStringToStream",
"(",
"cookieData",
")",
")",
";",
"return",
"token",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"DuraCloudRuntimeException",
"(",
"e",
")",
";",
"}",
"}"
] | Stores string data and returns a token by which that data can be retrieved
@param cookieData serialized cookie data
@return alphanumeric token value by which data can be retrieved | [
"Stores",
"string",
"data",
"and",
"returns",
"a",
"token",
"by",
"which",
"that",
"data",
"can",
"be",
"retrieved"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3storage/StringDataStore.java#L42-L52 |
141,398 | duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3storage/StringDataStore.java | StringDataStore.retrieveData | public String retrieveData(String token) {
try {
RetrievedContent data = this.s3StorageProvider.getContent(this.hiddenSpaceName, token);
return IOUtil.readStringFromStream(data.getContentStream());
} catch (NotFoundException ex) {
return null;
} catch (Exception ex) {
throw new DuraCloudRuntimeException(ex);
}
} | java | public String retrieveData(String token) {
try {
RetrievedContent data = this.s3StorageProvider.getContent(this.hiddenSpaceName, token);
return IOUtil.readStringFromStream(data.getContentStream());
} catch (NotFoundException ex) {
return null;
} catch (Exception ex) {
throw new DuraCloudRuntimeException(ex);
}
} | [
"public",
"String",
"retrieveData",
"(",
"String",
"token",
")",
"{",
"try",
"{",
"RetrievedContent",
"data",
"=",
"this",
".",
"s3StorageProvider",
".",
"getContent",
"(",
"this",
".",
"hiddenSpaceName",
",",
"token",
")",
";",
"return",
"IOUtil",
".",
"readStringFromStream",
"(",
"data",
".",
"getContentStream",
"(",
")",
")",
";",
"}",
"catch",
"(",
"NotFoundException",
"ex",
")",
"{",
"return",
"null",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"new",
"DuraCloudRuntimeException",
"(",
"ex",
")",
";",
"}",
"}"
] | Retrieves string data given its token.
If no data is associated with the provided token, returns null
@param token
@return | [
"Retrieves",
"string",
"data",
"given",
"its",
"token",
"."
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3storage/StringDataStore.java#L68-L77 |
141,399 | duracloud/duracloud | retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalWorker.java | RetrievalWorker.retrieveToFile | protected Map<String, String> retrieveToFile(File localFile, RetrievalListener listener) throws IOException {
try {
contentStream = new Retrier(5, 4000, 3).execute(() -> {
return source.getSourceContent(contentItem, listener);
});
} catch (Exception ex) {
throw new IOException(ex);
}
try (
InputStream inStream = contentStream.getStream();
OutputStream outStream = new FileOutputStream(localFile);
) {
IOUtils.copyLarge(inStream, outStream);
} catch (IOException e) {
try {
deleteFile(localFile);
} catch (IOException ioe) {
logger.error("Exception deleting local file " +
localFile.getAbsolutePath() + " due to: " + ioe.getMessage());
}
throw e;
}
if (!checksumsMatch(localFile, contentStream.getChecksum())) {
deleteFile(localFile);
throw new IOException("Calculated checksum value for retrieved " +
"file does not match properties checksum.");
}
// Set time stamps
if (applyTimestamps) {
applyTimestamps(contentStream, localFile);
}
return contentStream.getProperties();
} | java | protected Map<String, String> retrieveToFile(File localFile, RetrievalListener listener) throws IOException {
try {
contentStream = new Retrier(5, 4000, 3).execute(() -> {
return source.getSourceContent(contentItem, listener);
});
} catch (Exception ex) {
throw new IOException(ex);
}
try (
InputStream inStream = contentStream.getStream();
OutputStream outStream = new FileOutputStream(localFile);
) {
IOUtils.copyLarge(inStream, outStream);
} catch (IOException e) {
try {
deleteFile(localFile);
} catch (IOException ioe) {
logger.error("Exception deleting local file " +
localFile.getAbsolutePath() + " due to: " + ioe.getMessage());
}
throw e;
}
if (!checksumsMatch(localFile, contentStream.getChecksum())) {
deleteFile(localFile);
throw new IOException("Calculated checksum value for retrieved " +
"file does not match properties checksum.");
}
// Set time stamps
if (applyTimestamps) {
applyTimestamps(contentStream, localFile);
}
return contentStream.getProperties();
} | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"retrieveToFile",
"(",
"File",
"localFile",
",",
"RetrievalListener",
"listener",
")",
"throws",
"IOException",
"{",
"try",
"{",
"contentStream",
"=",
"new",
"Retrier",
"(",
"5",
",",
"4000",
",",
"3",
")",
".",
"execute",
"(",
"(",
")",
"->",
"{",
"return",
"source",
".",
"getSourceContent",
"(",
"contentItem",
",",
"listener",
")",
";",
"}",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"new",
"IOException",
"(",
"ex",
")",
";",
"}",
"try",
"(",
"InputStream",
"inStream",
"=",
"contentStream",
".",
"getStream",
"(",
")",
";",
"OutputStream",
"outStream",
"=",
"new",
"FileOutputStream",
"(",
"localFile",
")",
";",
")",
"{",
"IOUtils",
".",
"copyLarge",
"(",
"inStream",
",",
"outStream",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"try",
"{",
"deleteFile",
"(",
"localFile",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"logger",
".",
"error",
"(",
"\"Exception deleting local file \"",
"+",
"localFile",
".",
"getAbsolutePath",
"(",
")",
"+",
"\" due to: \"",
"+",
"ioe",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"throw",
"e",
";",
"}",
"if",
"(",
"!",
"checksumsMatch",
"(",
"localFile",
",",
"contentStream",
".",
"getChecksum",
"(",
")",
")",
")",
"{",
"deleteFile",
"(",
"localFile",
")",
";",
"throw",
"new",
"IOException",
"(",
"\"Calculated checksum value for retrieved \"",
"+",
"\"file does not match properties checksum.\"",
")",
";",
"}",
"// Set time stamps",
"if",
"(",
"applyTimestamps",
")",
"{",
"applyTimestamps",
"(",
"contentStream",
",",
"localFile",
")",
";",
"}",
"return",
"contentStream",
".",
"getProperties",
"(",
")",
";",
"}"
] | Transfers the remote file stream to the local file
@param localFile
@param listener
@return
@throws IOException
@returns the checksum of the File upon successful retrieval. Successful
retrieval means the checksum of the local file and remote file match,
otherwise an IOException is thrown. | [
"Transfers",
"the",
"remote",
"file",
"stream",
"to",
"the",
"local",
"file"
] | dc4f3a1716d43543cc3b2e1880605f9389849b66 | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/retrievaltool/src/main/java/org/duracloud/retrieval/mgmt/RetrievalWorker.java#L233-L269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.