idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
20,800
public Annotation getDomain ( ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domain == null ) jcasType . jcas . throwFeatMissing ( "domain" , "de.julielab.jules.types.OntRelationMention" ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domain ) ) ) ; }
getter for domain - gets
146
6
20,801
public void setDomain ( Annotation v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domain == null ) jcasType . jcas . throwFeatMissing ( "domain" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domain , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for domain - sets
142
6
20,802
public Annotation getRange ( ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_range == null ) jcasType . jcas . throwFeatMissing ( "range" , "de.julielab.jules.types.OntRelationMention" ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_range ) ) ) ; }
getter for range - gets
146
6
20,803
public void setRange ( Annotation v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_range == null ) jcasType . jcas . throwFeatMissing ( "range" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_range , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for range - sets
142
6
20,804
public FSArray getDomainList ( ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domainList == null ) jcasType . jcas . throwFeatMissing ( "domainList" , "de.julielab.jules.types.OntRelationMention" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList ) ) ) ; }
getter for domainList - gets
150
7
20,805
public void setDomainList ( FSArray v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domainList == null ) jcasType . jcas . throwFeatMissing ( "domainList" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for domainList - sets
146
7
20,806
public Annotation getDomainList ( int i ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domainList == null ) jcasType . jcas . throwFeatMissing ( "domainList" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList ) , i ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList ) , i ) ) ) ; }
indexed getter for domainList - gets an indexed value -
225
13
20,807
public void setDomainList ( int i , Annotation v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_domainList == null ) jcasType . jcas . throwFeatMissing ( "domainList" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_domainList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
indexed setter for domainList - sets an indexed value -
222
13
20,808
public FSArray getRangeList ( ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_rangeList == null ) jcasType . jcas . throwFeatMissing ( "rangeList" , "de.julielab.jules.types.OntRelationMention" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_rangeList ) ) ) ; }
getter for rangeList - gets
150
7
20,809
public void setRangeList ( FSArray v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_rangeList == null ) jcasType . jcas . throwFeatMissing ( "rangeList" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_rangeList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for rangeList - sets
146
7
20,810
public Annotation getRangeList ( int i ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_rangeList == null ) jcasType . jcas . throwFeatMissing ( "rangeList" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_rangeList ) , i ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_rangeList ) , i ) ) ) ; }
indexed getter for rangeList - gets an indexed value -
225
13
20,811
public void setRangeList ( int i , Annotation v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_rangeList == null ) jcasType . jcas . throwFeatMissing ( "rangeList" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_rangeList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_rangeList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
indexed setter for rangeList - sets an indexed value -
222
13
20,812
public String getOntRelationId ( ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_ontRelationId == null ) jcasType . jcas . throwFeatMissing ( "ontRelationId" , "de.julielab.jules.types.OntRelationMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_ontRelationId ) ; }
getter for ontRelationId - gets ID of the ontology relation the relation mention refers to .
135
21
20,813
public void setOntRelationId ( String v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_ontRelationId == null ) jcasType . jcas . throwFeatMissing ( "ontRelationId" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_ontRelationId , v ) ; }
setter for ontRelationId - sets ID of the ontology relation the relation mention refers to .
138
21
20,814
public String getSourceOntology ( ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_sourceOntology == null ) jcasType . jcas . throwFeatMissing ( "sourceOntology" , "de.julielab.jules.types.OntRelationMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_sourceOntology ) ; }
getter for sourceOntology - gets Ontology defining the relation to which the relation mention refers to .
131
21
20,815
public void setSourceOntology ( String v ) { if ( OntRelationMention_Type . featOkTst && ( ( OntRelationMention_Type ) jcasType ) . casFeat_sourceOntology == null ) jcasType . jcas . throwFeatMissing ( "sourceOntology" , "de.julielab.jules.types.OntRelationMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( OntRelationMention_Type ) jcasType ) . casFeatCode_sourceOntology , v ) ; }
setter for sourceOntology - sets Ontology defining the relation to which the relation mention refers to .
134
21
20,816
protected static String sniffContentType ( InputStream inputStream ) throws IOException { if ( inputStream == null ) return null ; byte [ ] bytes = new byte [ 8 ] ; inputStream . read ( bytes ) ; String [ ] hex = new String [ 8 ] ; String hexString = "" ; for ( int i = 0 ; i < 8 ; i ++ ) { hex [ i ] = getHexValue ( bytes [ i ] ) ; hexString += hex [ i ] + " " ; } String prefix = new String ( bytes ) ; if ( prefix . startsWith ( "GIF87" ) || prefix . startsWith ( "GIF89" ) ) return "image/gif" ; if ( hex [ 0 ] . equals ( "ff" ) && hex [ 1 ] . equals ( "d8" ) ) return "image/jpeg" ; if ( hex [ 0 ] . equals ( "42" ) && hex [ 1 ] . equals ( "4d" ) ) return "image/bmp" ; if ( hex [ 0 ] . equals ( "00" ) && hex [ 1 ] . equals ( "00" ) && hex [ 2 ] . equals ( "01" ) && hex [ 3 ] . equals ( "00" ) ) return "image/vnd.microsoft.icon" ; if ( hexString . trim ( ) . equals ( "89 50 4e 47 0d 0a 1a 0a" ) ) return "image/png" ; return null ; }
Sniffs the content type for images and other common types
318
11
20,817
public java . util . List < Object > getDefListOrListOrNotes ( ) { if ( defListOrListOrNotes == null ) { defListOrListOrNotes = new ArrayList < Object > ( ) ; } return this . defListOrListOrNotes ; }
Gets the value of the defListOrListOrNotes property .
59
14
20,818
public List < java . lang . Object > getMonthOrDayOrSeason ( ) { if ( monthOrDayOrSeason == null ) { monthOrDayOrSeason = new ArrayList < java . lang . Object > ( ) ; } return this . monthOrDayOrSeason ; }
Gets the value of the monthOrDayOrSeason property .
59
13
20,819
public String getObjectType ( ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectType == null ) jcasType . jcas . throwFeatMissing ( "objectType" , "de.julielab.jules.types.TextObject" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectType ) ; }
getter for objectType - gets such as figure table boxed - text etc .
115
16
20,820
public void setObjectType ( String v ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectType == null ) jcasType . jcas . throwFeatMissing ( "objectType" , "de.julielab.jules.types.TextObject" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectType , v ) ; }
setter for objectType - sets such as figure table boxed - text etc .
118
16
20,821
public String getObjectId ( ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectId == null ) jcasType . jcas . throwFeatMissing ( "objectId" , "de.julielab.jules.types.TextObject" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectId ) ; }
getter for objectId - gets the id of the object as found in the text
115
17
20,822
public void setObjectId ( String v ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectId == null ) jcasType . jcas . throwFeatMissing ( "objectId" , "de.julielab.jules.types.TextObject" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectId , v ) ; }
setter for objectId - sets the id of the object as found in the text
118
17
20,823
public String getObjectLabel ( ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectLabel == null ) jcasType . jcas . throwFeatMissing ( "objectLabel" , "de.julielab.jules.types.TextObject" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectLabel ) ; }
getter for objectLabel - gets the label of an object
115
12
20,824
public void setObjectLabel ( String v ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectLabel == null ) jcasType . jcas . throwFeatMissing ( "objectLabel" , "de.julielab.jules.types.TextObject" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectLabel , v ) ; }
setter for objectLabel - sets the label of an object
118
12
20,825
public Caption getObjectCaption ( ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectCaption == null ) jcasType . jcas . throwFeatMissing ( "objectCaption" , "de.julielab.jules.types.TextObject" ) ; return ( Caption ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectCaption ) ) ) ; }
getter for objectCaption - gets the caption that comes with the object
140
15
20,826
public void setObjectCaption ( Caption v ) { if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectCaption == null ) jcasType . jcas . throwFeatMissing ( "objectCaption" , "de.julielab.jules.types.TextObject" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectCaption , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for objectCaption - sets the caption that comes with the object
137
15
20,827
public String getAce_role ( ) { if ( Annotation_Type . featOkTst && ( ( Annotation_Type ) jcasType ) . casFeat_ace_role == null ) jcasType . jcas . throwFeatMissing ( "ace_role" , "de.julielab.jules.types.ace.Annotation" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Annotation_Type ) jcasType ) . casFeatCode_ace_role ) ; }
getter for ace_role - gets
122
8
20,828
public void setAce_role ( String v ) { if ( Annotation_Type . featOkTst && ( ( Annotation_Type ) jcasType ) . casFeat_ace_role == null ) jcasType . jcas . throwFeatMissing ( "ace_role" , "de.julielab.jules.types.ace.Annotation" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Annotation_Type ) jcasType ) . casFeatCode_ace_role , v ) ; }
setter for ace_role - sets
125
8
20,829
public String [ ] sentDetect ( String s ) { int [ ] starts = sentPosDetect ( s ) ; if ( starts . length == 0 ) { return new String [ ] { s } ; } boolean leftover = starts [ starts . length - 1 ] != s . length ( ) ; String [ ] sents = new String [ leftover ? starts . length + 1 : starts . length ] ; sents [ 0 ] = s . substring ( 0 , starts [ 0 ] ) ; for ( int si = 1 ; si < starts . length ; si ++ ) { sents [ si ] = s . substring ( starts [ si - 1 ] , starts [ si ] ) ; } if ( leftover ) { sents [ sents . length - 1 ] = s . substring ( starts [ starts . length - 1 ] ) ; } return ( sents ) ; }
Detect sentences in a String .
182
6
20,830
public int [ ] sentPosDetect ( String s ) { double sentProb = 1 ; sentProbs . clear ( ) ; StringBuffer sb = new StringBuffer ( s ) ; List enders = scanner . getPositions ( s ) ; List positions = new ArrayList ( enders . size ( ) ) ; for ( int i = 0 , end = enders . size ( ) , index = 0 ; i < end ; i ++ ) { Integer candidate = ( Integer ) enders . get ( i ) ; int cint = candidate . intValue ( ) ; // skip over the leading parts of non-token final delimiters int fws = getFirstWS ( s , cint + 1 ) ; if ( ( ( i + 1 ) < end ) && ( ( ( Integer ) enders . get ( i + 1 ) ) . intValue ( ) < fws ) ) { continue ; } Pair pair = new Pair ( sb , candidate ) ; double [ ] probs = model . eval ( cgen . getContext ( pair ) ) ; String bestOutcome = model . getBestOutcome ( probs ) ; sentProb *= probs [ model . getIndex ( bestOutcome ) ] ; if ( bestOutcome . equals ( "T" ) && isAcceptableBreak ( s , index , cint ) ) { if ( index != cint ) { positions . add ( INT_POOL . get ( getFirstNonWS ( s , getFirstWS ( s , cint + 1 ) ) ) ) ; sentProbs . add ( new Double ( probs [ model . getIndex ( bestOutcome ) ] ) ) ; } index = cint + 1 ; } } int [ ] sentPositions = new int [ positions . size ( ) ] ; for ( int i = 0 ; i < sentPositions . length ; i ++ ) { sentPositions [ i ] = ( ( Integer ) positions . get ( i ) ) . intValue ( ) ; } return sentPositions ; }
Detect the position of the first words of sentences in a String .
428
13
20,831
public static GISModel train ( File inFile , int iterations , int cut , EndOfSentenceScanner scanner ) throws IOException { EventStream es ; DataStream ds ; Reader reader ; reader = new BufferedReader ( new FileReader ( inFile ) ) ; ds = new PlainTextByLineDataStream ( reader ) ; es = new SDEventStream ( ds , scanner ) ; return GIS . trainModel ( es , iterations , cut ) ; }
Use this training method if you wish to supply an end of sentence scanner which provides a different set of ending chars other than the default ones . They are \\ . |!| \\ ?| \\\ | \\ ) .
100
44
20,832
public List < java . lang . Object > getPaginationOrELocationID ( ) { if ( paginationOrELocationID == null ) { paginationOrELocationID = new ArrayList < java . lang . Object > ( ) ; } return this . paginationOrELocationID ; }
Gets the value of the paginationOrELocationID property .
64
14
20,833
public static float subsumes ( String haystack , final String needle ) { if ( needle == null || needle . length ( ) < 0 || haystack == null || haystack . length ( ) < 0 ) return 0f ; try { // index the cleaned text RAMDirectory idx = new RAMDirectory ( ) ; IndexWriterConfig iwc = new IndexWriterConfig ( LUCENE_41 , anal ) ; IndexWriter writer = new IndexWriter ( idx , iwc ) ; // index Document doc = new Document ( ) ; doc . add ( new TextField ( CONTENT_FIELD , haystack , Store . YES ) ) ; writer . addDocument ( doc ) ; writer . close ( ) ; // search IndexReader reader = open ( idx ) ; Query query = parser . parse ( getNGram ( needle , 3 ) ) ; TopDocs results = new IndexSearcher ( reader ) . search ( query , 1 ) ; float score = 0 ; for ( ScoreDoc hit : results . scoreDocs ) { score += hit . score ; } reader . close ( ) ; idx . close ( ) ; return score ; } catch ( Exception e ) { LOG . warn ( "could not computeSimilarity for " + needle , e ) ; } return 0f ; }
depends on document size but > 0 . 01 should be a good threshold
269
15
20,834
public String getPhysicalContact ( ) { if ( RegulationOfGeneExpression_Type . featOkTst && ( ( RegulationOfGeneExpression_Type ) jcasType ) . casFeat_physicalContact == null ) jcasType . jcas . throwFeatMissing ( "physicalContact" , "de.julielab.jules.types.bootstrep.RegulationOfGeneExpression" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( RegulationOfGeneExpression_Type ) jcasType ) . casFeatCode_physicalContact ) ; }
getter for physicalContact - gets yes no unknown
132
10
20,835
public void setPhysicalContact ( String v ) { if ( RegulationOfGeneExpression_Type . featOkTst && ( ( RegulationOfGeneExpression_Type ) jcasType ) . casFeat_physicalContact == null ) jcasType . jcas . throwFeatMissing ( "physicalContact" , "de.julielab.jules.types.bootstrep.RegulationOfGeneExpression" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( RegulationOfGeneExpression_Type ) jcasType ) . casFeatCode_physicalContact , v ) ; }
setter for physicalContact - sets yes no unknown
135
10
20,836
public java . util . List < Object > getDispQuoteOrSpeechOrStatement ( ) { if ( dispQuoteOrSpeechOrStatement == null ) { dispQuoteOrSpeechOrStatement = new ArrayList < Object > ( ) ; } return this . dispQuoteOrSpeechOrStatement ; }
Gets the value of the dispQuoteOrSpeechOrStatement property .
64
15
20,837
public java . util . List < Object > getTableWrapFootOrAttribOrPermissions ( ) { if ( tableWrapFootOrAttribOrPermissions == null ) { tableWrapFootOrAttribOrPermissions = new ArrayList < Object > ( ) ; } return this . tableWrapFootOrAttribOrPermissions ; }
Gets the value of the tableWrapFootOrAttribOrPermissions property .
75
18
20,838
public StringArray getCategories ( ) { if ( GOMention_Type . featOkTst && ( ( GOMention_Type ) jcasType ) . casFeat_categories == null ) jcasType . jcas . throwFeatMissing ( "categories" , "de.julielab.jules.types.GOMention" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_categories ) ) ) ; }
getter for categories - gets created for the shared task here we add the group
142
16
20,839
public void setCategories ( StringArray v ) { if ( GOMention_Type . featOkTst && ( ( GOMention_Type ) jcasType ) . casFeat_categories == null ) jcasType . jcas . throwFeatMissing ( "categories" , "de.julielab.jules.types.GOMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_categories , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for categories - sets created for the shared task here we add the group
138
16
20,840
public String getCategories ( int i ) { if ( GOMention_Type . featOkTst && ( ( GOMention_Type ) jcasType ) . casFeat_categories == null ) jcasType . jcas . throwFeatMissing ( "categories" , "de.julielab.jules.types.GOMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_categories ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_categories ) , i ) ; }
indexed getter for categories - gets an indexed value - created for the shared task here we add the group
192
22
20,841
public void setCategories ( int i , String v ) { if ( GOMention_Type . featOkTst && ( ( GOMention_Type ) jcasType ) . casFeat_categories == null ) jcasType . jcas . throwFeatMissing ( "categories" , "de.julielab.jules.types.GOMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_categories ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_categories ) , i , v ) ; }
indexed setter for categories - sets an indexed value - created for the shared task here we add the group
196
22
20,842
public String getGoID ( ) { if ( GOMention_Type . featOkTst && ( ( GOMention_Type ) jcasType ) . casFeat_goID == null ) jcasType . jcas . throwFeatMissing ( "goID" , "de.julielab.jules.types.GOMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_goID ) ; }
getter for goID - gets
119
7
20,843
public void setGoID ( String v ) { if ( GOMention_Type . featOkTst && ( ( GOMention_Type ) jcasType ) . casFeat_goID == null ) jcasType . jcas . throwFeatMissing ( "goID" , "de.julielab.jules.types.GOMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( GOMention_Type ) jcasType ) . casFeatCode_goID , v ) ; }
setter for goID - sets
122
7
20,844
public java . util . List < Object > getPOrDefListOrList ( ) { if ( pOrDefListOrList == null ) { pOrDefListOrList = new ArrayList < Object > ( ) ; } return this . pOrDefListOrList ; }
Gets the value of the pOrDefListOrList property .
59
14
20,845
public Parse parse ( Parse tokens ) { Parse p = parse ( tokens , 1 ) [ 0 ] ; setParents ( p ) ; return p ; }
Returns a parse for the specified parse of tokens .
34
10
20,846
private int mapParseIndex ( int index , Parse [ ] nonPunctParses , Parse [ ] parses ) { int parseIndex = index ; while ( parses [ parseIndex ] != nonPunctParses [ index ] ) { parseIndex ++ ; } return parseIndex ; }
Determines the mapping between the specified index into the specified parses without punctuation to the coresponding index into the specified parses .
65
29
20,847
public static Parse [ ] collapsePunctuation ( Parse [ ] chunks , Set punctSet ) { List collapsedParses = new ArrayList ( chunks . length ) ; int lastNonPunct = - 1 ; int nextNonPunct = - 1 ; for ( int ci = 0 , cn = chunks . length ; ci < cn ; ci ++ ) { if ( punctSet . contains ( chunks [ ci ] . getType ( ) ) ) { if ( lastNonPunct >= 0 ) { chunks [ lastNonPunct ] . addNextPunctuation ( chunks [ ci ] ) ; } for ( nextNonPunct = ci + 1 ; nextNonPunct < cn ; nextNonPunct ++ ) { if ( ! punctSet . contains ( chunks [ nextNonPunct ] . getType ( ) ) ) { break ; } } if ( nextNonPunct < cn ) { chunks [ nextNonPunct ] . addPreviousPunctuation ( chunks [ ci ] ) ; } } else { collapsedParses . add ( chunks [ ci ] ) ; lastNonPunct = ci ; } } if ( collapsedParses . size ( ) == chunks . length ) { return chunks ; } //System.err.println("collapsedPunctuation: collapsedParses"+collapsedParses); return ( Parse [ ] ) collapsedParses . toArray ( new Parse [ collapsedParses . size ( ) ] ) ; }
Removes the punctuation from the specified set of chunks adds it to the parses adjacent to the punctuation is specified and returns a new array of parses with the punctuation removed .
323
38
20,848
public int getTableId ( ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_tableId == null ) jcasType . jcas . throwFeatMissing ( "tableId" , "ch.epfl.bbp.uima.types.DataTable" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_tableId ) ; }
getter for tableId - gets the id of this table in the document
116
15
20,849
public void setTableId ( int v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_tableId == null ) jcasType . jcas . throwFeatMissing ( "tableId" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_tableId , v ) ; }
setter for tableId - sets the id of this table in the document
119
15
20,850
public int getRowCount ( ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_rowCount == null ) jcasType . jcas . throwFeatMissing ( "rowCount" , "ch.epfl.bbp.uima.types.DataTable" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_rowCount ) ; }
getter for rowCount - gets the nr of rows
116
12
20,851
public void setRowCount ( int v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_rowCount == null ) jcasType . jcas . throwFeatMissing ( "rowCount" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_rowCount , v ) ; }
setter for rowCount - sets the nr of rows
119
12
20,852
public int getColumnCount ( ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_columnCount == null ) jcasType . jcas . throwFeatMissing ( "columnCount" , "ch.epfl.bbp.uima.types.DataTable" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_columnCount ) ; }
getter for columnCount - gets
116
7
20,853
public void setColumnCount ( int v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_columnCount == null ) jcasType . jcas . throwFeatMissing ( "columnCount" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_columnCount , v ) ; }
setter for columnCount - sets
119
7
20,854
public String getCaption ( ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_caption == null ) jcasType . jcas . throwFeatMissing ( "caption" , "ch.epfl.bbp.uima.types.DataTable" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_caption ) ; }
getter for caption - gets
116
6
20,855
public void setCaption ( String v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_caption == null ) jcasType . jcas . throwFeatMissing ( "caption" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_caption , v ) ; }
setter for caption - sets
119
6
20,856
public StringArray getHeadings ( ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_headings == null ) jcasType . jcas . throwFeatMissing ( "headings" , "ch.epfl.bbp.uima.types.DataTable" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_headings ) ) ) ; }
getter for headings - gets
139
7
20,857
public void setHeadings ( StringArray v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_headings == null ) jcasType . jcas . throwFeatMissing ( "headings" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_headings , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for headings - sets
135
7
20,858
public String getHeadings ( int i ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_headings == null ) jcasType . jcas . throwFeatMissing ( "headings" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_headings ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_headings ) , i ) ; }
indexed getter for headings - gets an indexed value -
188
13
20,859
public void setHeadings ( int i , String v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_headings == null ) jcasType . jcas . throwFeatMissing ( "headings" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_headings ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_headings ) , i , v ) ; }
indexed setter for headings - sets an indexed value -
192
13
20,860
public StringArray getBody ( ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_body == null ) jcasType . jcas . throwFeatMissing ( "body" , "ch.epfl.bbp.uima.types.DataTable" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_body ) ) ) ; }
getter for body - gets the body of the table that contains data
135
14
20,861
public void setBody ( StringArray v ) { if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_body == null ) jcasType . jcas . throwFeatMissing ( "body" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_body , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for body - sets the body of the table that contains data
131
14
20,862
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
183
20
20,863
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
187
20
20,864
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
116
7
20,865
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
119
7
20,866
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
116
18
20,867
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
119
18
20,868
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
136
18
20,869
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
132
18
20,870
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
208
24
20,871
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
205
24
20,872
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
214
5
20,873
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
139
9
20,874
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
135
10
20,875
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
138
10
20,876
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
64
9
20,877
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 ) ; } }
Sets the table heading rows
188
6
20,878
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 ( ) ) ; }
Sets the metadata of a valid table
168
8
20,879
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
133
9
20,880
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
136
9
20,881
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
153
8
20,882
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
149
8
20,883
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
144
6
20,884
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
386
10
20,885
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
741
3
20,886
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
94
8
20,887
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
317
16
20,888
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
156
34
20,889
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 .
313
24
20,890
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
121
8
20,891
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
124
8
20,892
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
129
10
20,893
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
132
10
20,894
public java . util . List < Object > getAppOrRefList ( ) { if ( appOrRefList == null ) { appOrRefList = new ArrayList < Object > ( ) ; } return this . appOrRefList ; }
Gets the value of the appOrRefList property .
51
12
20,895
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 .
546
7
20,896
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 .
131
6
20,897
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 .
151
6
20,898
public void dataset ( String dataFile ) throws MatchData . InputFormatException { datasets . add ( new MatchData ( dataFile ) ) ; datasetNames . add ( dataFile ) ; expt = null ; }
Load a dataset .
44
4
20,899
public void learner ( String learnerClass ) { learners . add ( DistanceLearnerFactory . build ( learnerClass ) ) ; learnerNames . add ( learnerClass ) ; expt = null ; }
Load a learner .
45
5