idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
20,900
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 ) . ...
getter for referenceText - gets
20,901
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 ) . ...
setter for referenceText - sets
20,902
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_pag...
getter for pageNumber - gets the number of the page where the table is located in
20,903
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_pag...
setter for pageNumber - sets the number of the page where the table is located in
20,904
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...
getter for wordForms - gets A Token is related to one or more WordForm
20,905
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 , jcasTy...
setter for wordForms - sets A Token is related to one or more WordForm
20,906
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 ) jcasTy...
indexed getter for wordForms - gets an indexed value - A Token is related to one or more WordForm
20,907
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...
indexed setter for wordForms - sets an indexed value - A Token is related to one or more WordForm
20,908
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 > > trueLabel...
Trains on full corpus
20,909
public boolean trainOnCandidates ( ) { List < String > corpus = loadTrainingCorpus ( _trainingCorpusFile ) ; List < List < Acronym > > trainingExtractedCandidates = new ArrayList < List < Acronym > > ( ) ; for ( Integer docID = 0 ; docID < corpus . size ( ) ; ++ docID ) { trainingExtractedCandidates . add ( extractCand...
Trains on candidate pairs extracted from the corpus
20,910
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 ) . casFeatC...
getter for biolexicon_id - gets
20,911
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 ) . casFeatC...
setter for biolexicon_id - sets
20,912
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
20,913
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 ) ; ...
Sets the table heading rows
20,914
public void setValidTable ( TableCandidate tc ) { 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 . ...
Sets the metadata of a valid table
20,915
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 ,...
getter for lexical_condition - gets
20,916
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 ,...
setter for lexical_condition - sets
20,917
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 ( jcasTyp...
getter for relation_ref - gets
20,918
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 , ( ( RelationMen...
setter for relation_ref - sets
20,919
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 ( ...
load mappings of constituent names
20,920
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 la...
provide annotations from Parse result to CAS object
20,921
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 (...
make Fun annotations
20,922
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
20,923
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" ) ; fu...
init table wit fun tags and corresponfing attributes of a Constituent
20,924
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...
pubmed_id region_1_name region_1_start region_1_end region_2_name region_2_start region_2_end
20,925
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 ] ] ; activ...
Use this model to evaluate a context and populate the specified outsums array with the likelihood of each outcome given that context .
20,926
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 ) . ...
getter for hasBold - gets
20,927
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 ) . ...
setter for hasBold - sets
20,928
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 , ( ( Documen...
getter for hasManyFontsizes - gets
20,929
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 , ( ( Documen...
setter for hasManyFontsizes - sets
20,930
public java . util . List < Object > getAppOrRefList ( ) { if ( appOrRefList == null ) { appOrRefList = new ArrayList < Object > ( ) ; } return this . appOrRefList ; }
Gets the value of the appOrRefList property .
20,931
private static String getHelp ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "\njSRE: Simple Relation Extraction V1.10\t 30.08.06\n" ) ; sb . append ( "developed by Claudio Giuliano (giuliano@itc.it)\n\n" ) ; sb . append ( "Copyright 2005 FBK-irst (http://www.fbk.eu)\n" ) ; sb . append ( "\n" ) ; sb . app...
Returns a command - line help .
20,932
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 ( "lear...
Clear datasets blockers or learners .
20,933
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 (...
Show datasets blockers or learners .
20,934
public void dataset ( String dataFile ) throws MatchData . InputFormatException { datasets . add ( new MatchData ( dataFile ) ) ; datasetNames . add ( dataFile ) ; expt = null ; }
Load a dataset .
20,935
public void learner ( String learnerClass ) { learners . add ( DistanceLearnerFactory . build ( learnerClass ) ) ; learnerNames . add ( learnerClass ) ; expt = null ; }
Load a learner .
20,936
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 .
20,937
public void blocker ( String blockerClass , String param , String value ) throws ClassNotFoundException , InstantiationException , IllegalAccessException , InvocationTargetException , NoSuchMethodException { Blocker blocker = ( Blocker ) Class . forName ( BLOCKER_PACKAGE + blockerClass ) . newInstance ( ) ; param = par...
Load a blocker with optional boolean value
20,938
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 ) b...
Compute learners .
20,939
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 ( ...
Show a table of some expt - wide numeric measurement .
20,940
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
20,941
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 . readObjec...
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 .
20,942
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 ( ) ...
Load commands from a file and execute them .
20,943
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 . getMe...
execute a single command
20,944
public StringWrapper prepare ( String s ) { BagOfTokens bag = new BagOfTokens ( s , tokenizer . tokenize ( s ) ) ; double normalizer = 0.0 ; for ( Iterator i = bag . tokenIterator ( ) ; i . hasNext ( ) ; ) { Token tok = ( Token ) i . next ( ) ; if ( collectionSize > 0 ) { Integer dfInteger = ( Integer ) documentFrequen...
Preprocess a string by finding tokens and giving them appropriate weights
20,945
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 ( a...
Similar to Slf4J logger
20,946
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 ( inter...
Return tokenized version of a string . Tokens are all character n - grams that are part of a token produced by the inner tokenizer .
20,947
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_g...
getter for categories - gets List of Wikipedia categories associated with a Wikipedia page .
20,948
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 ...
setter for categories - sets List of Wikipedia categories associated with a Wikipedia page .
20,949
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...
indexed getter for categories - gets an indexed value - List of Wikipedia categories associated with a Wikipedia page .
20,950
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_getRefVal...
indexed setter for categories - sets an indexed value - List of Wikipedia categories associated with a Wikipedia page .
20,951
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_c...
getter for outgoingLinks - gets List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page .
20,952
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 ) ...
setter for outgoingLinks - sets List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page .
20,953
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_getRefVal...
indexed getter for outgoingLinks - gets an indexed value - List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page .
20,954
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_...
indexed setter for outgoingLinks - sets an indexed value - List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page .
20,955
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 ....
getter for redirects - gets List of redirects pointing to a Wikipedia page .
20,956
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...
setter for redirects - sets List of redirects pointing to a Wikipedia page .
20,957
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 ,...
indexed getter for redirects - gets an indexed value - List of redirects pointing to a Wikipedia page .
20,958
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...
indexed setter for redirects - sets an indexed value - List of redirects pointing to a Wikipedia page .
20,959
public java . util . List < Object > getRid ( ) { if ( rid == null ) { rid = new ArrayList < Object > ( ) ; } return this . rid ; }
Gets the value of the rid property .
20,960
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...
Parses a pipeline script file .
20,961
public static Pipeline parse ( List < String > scriptLines , String parentFilePath , List < String > replacementVars ) throws ParseException , IOException { if ( replacementVars == null ) replacementVars = new ArrayList < String > ( ) ; Pipeline pipeline = parseAndDispatch ( scriptLines , new Pipeline ( ) , parentFileP...
Parses lines from a pipeline script .
20,962
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 Par...
Parses inline raw Python code and executes it with Jython
20,963
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 ( "e...
Parses inline raw java code and executes it with Beanshell
20,964
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 . sta...
parse include commands
20,965
private static void validateParams ( List < Object > params , Class < ? > classz ) { if ( ! JCasAnnotator_ImplBase . class . isAssignableFrom ( classz ) && ! JCasCollectionReader_ImplBase . class . isAssignableFrom ( classz ) ) { LOG . warn ( " +- Could not validate parameters in {}. You might want to check it manua...
check that this ae or cr has the right parameters
20,966
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 ...
This is small debug utility available to voters in this package .
20,967
public S3TaskClient get ( String storeId ) throws ContentStoreException { ContentStore contentStore = contentStoreManager . getContentStore ( storeId ) ; return new S3TaskClientImpl ( contentStore ) ; }
Retrieve an S3TaskClient
20,968
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 ( Syste...
Adds the specified file to the zip output stream .
20,969
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 al...
Recognize and handle exceptions due to content which resides in Glacier but has not been retrieved for access .
20,970
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 = MessageFo...
Generates a manifest file asynchronously and uploads to DuraCloud
20,971
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 .
20,972
public StorageProvider getStorageProvider ( String storageAccountId ) throws StorageException { storageAccountId = checkStorageAccountId ( storageAccountId ) ; if ( storageProviders . containsKey ( storageAccountId ) ) { return storageProviders . get ( storageAccountId ) ; } StorageAccountManager storageAccountManager ...
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
20,973
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 .
20,974
public void initialize ( DuraStoreInitConfig initConfig , String instanceHost , String instancePort , String accountId ) throws StorageException { this . initConfig = initConfig ; storageAccountManager . initialize ( initConfig . getStorageAccounts ( ) ) ; storageAccountManager . setEnvironment ( instanceHost , instanc...
Initializes DuraStore with account information necessary to connect to Storage Providers .
20,975
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 .
20,976
public String performTask ( String taskParameters ) { GetSignedCookiesUrlTaskParameters taskParams = GetSignedCookiesUrlTaskParameters . deserialize ( taskParameters ) ; String spaceId = taskParams . getSpaceId ( ) ; String ipAddress = taskParams . getIpAddress ( ) ; int minutesToExpire = taskParams . getMinutesToExpir...
Create and store signed cookies
20,977
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 . erro...
Begins the content retrieval process
20,978
public void shutdown ( ) { logger . info ( "Closing Retrieval Manager" ) ; workerPool . shutdown ( ) ; try { workerPool . awaitTermination ( 30 , TimeUnit . MINUTES ) ; } catch ( InterruptedException e ) { } complete = true ; }
Stops the retrieval no further files will be retrieved after those which are in progress have completed .
20,979
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 ) { th...
Serializes the data stored within a java bean to XML . The bean and any ancillary beans should include JAXB binding annotations .
20,980
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 .
20,981
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 .
20,982
public Map < String , String > getSpaceProperties ( String spaceId ) { Map < String , String > spaceProps = new HashMap < String , String > ( ) ; Map < String , String > allProps = getAllSpaceProperties ( spaceId ) ; for ( String name : allProps . keySet ( ) ) { if ( ! name . startsWith ( PROPERTIES_SPACE_ACL ) ) { spa...
This method returns all of the space properties EXCEPT the ACLs
20,983
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 .
20,984
public void setNewSpaceProperties ( String spaceId , Map < String , String > spaceProperties , Map < String , AclType > spaceACLs ) { spaceProperties . putAll ( packACLs ( spaceACLs ) ) ; boolean success = false ; int maxLoops = 6 ; for ( int loops = 0 ; ! success && loops < maxLoops ; loops ++ ) { try { doSetSpaceProp...
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 d...
20,985
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 delete...
This method is only intended to be used by tests!
20,986
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 =...
Gets a listing of supported tasks for a given provider
20,987
@ Path ( "/{taskName}" ) 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 ) { re...
Performs a task
20,988
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 ( ...
Retrieves content from a space .
20,989
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 ) ...
Retrieves the properties of a piece of content .
20,990
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 = storageP...
Updates the properties of a piece of content .
20,991
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 ( c...
Adds content to a space .
20,992
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...
20,993
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 .
20,994
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 .
20,995
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 ) { thro...
Stores string data and returns a token by which that data can be retrieved
20,996
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 DuraCloudRun...
Retrieves string data given its token .
20,997
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 ) ; } tr...
Transfers the remote file stream to the local file
20,998
public void generateSchema ( Class ... classes ) throws JAXBException , IOException { if ( ! baseDir . exists ( ) ) { baseDir . mkdirs ( ) ; } JAXBContext context = JAXBContext . newInstance ( classes ) ; context . generateSchema ( this ) ; }
Generates an XML Schema which includes the given classes
20,999
public Result createOutput ( String namespaceUri , String defaultFileName ) throws IOException { if ( null == fileName ) { fileName = defaultFileName ; } return new StreamResult ( new File ( baseDir , fileName ) ) ; }
Called by the schema generation process . There is no need to call this method directly .