idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
20,300 | public String getAnchor_dir ( ) { if ( Timex2_Type . featOkTst && ( ( Timex2_Type ) jcasType ) . casFeat_anchor_dir == null ) jcasType . jcas . throwFeatMissing ( "anchor_dir" , "de.julielab.jules.types.ace.Timex2" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Timex2_Type ) jcasType ) . casFeatCode_anchor_dir ) ; } | getter for anchor_dir - gets | 130 | 8 |
20,301 | public void setAnchor_dir ( String v ) { if ( Timex2_Type . featOkTst && ( ( Timex2_Type ) jcasType ) . casFeat_anchor_dir == null ) jcasType . jcas . throwFeatMissing ( "anchor_dir" , "de.julielab.jules.types.ace.Timex2" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Timex2_Type ) jcasType ) . casFeatCode_anchor_dir , v ) ; } | setter for anchor_dir - sets | 133 | 8 |
20,302 | public String getEvent_type ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_event_type == null ) jcasType . jcas . throwFeatMissing ( "event_type" , "ch.epfl.bbp.uima.genia.Event" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_event_type ) ; } | getter for event_type - gets | 117 | 8 |
20,303 | public void setEvent_type ( String v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_event_type == null ) jcasType . jcas . throwFeatMissing ( "event_type" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_event_type , v ) ; } | setter for event_type - sets | 120 | 8 |
20,304 | public FSArray getThemes_protein ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_protein == null ) jcasType . jcas . throwFeatMissing ( "themes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein ) ) ) ; } | getter for themes_protein - gets | 144 | 8 |
20,305 | public void setThemes_protein ( FSArray v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_protein == null ) jcasType . jcas . throwFeatMissing ( "themes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for themes_protein - sets | 140 | 8 |
20,306 | public Protein getThemes_protein ( int i ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_protein == null ) jcasType . jcas . throwFeatMissing ( "themes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein ) , i ) ; return ( Protein ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein ) , i ) ) ) ; } | indexed getter for themes_protein - gets an indexed value - | 215 | 14 |
20,307 | public void setThemes_protein ( int i , Protein v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_protein == null ) jcasType . jcas . throwFeatMissing ( "themes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_protein ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for themes_protein - sets an indexed value - | 213 | 14 |
20,308 | public FSArray getCauses_protein ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_protein == null ) jcasType . jcas . throwFeatMissing ( "causes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_protein ) ) ) ; } | getter for causes_protein - gets | 144 | 8 |
20,309 | public void setCauses_protein ( FSArray v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_protein == null ) jcasType . jcas . throwFeatMissing ( "causes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_protein , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for causes_protein - sets | 140 | 8 |
20,310 | public Protein getCauses_protein ( int i ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_protein == null ) jcasType . jcas . throwFeatMissing ( "causes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_protein ) , i ) ; return ( Protein ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_protein ) , i ) ) ) ; } | indexed getter for causes_protein - gets an indexed value - | 215 | 14 |
20,311 | public void setCauses_protein ( int i , Protein v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_protein == null ) jcasType . jcas . throwFeatMissing ( "causes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_protein ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_protein ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for causes_protein - sets an indexed value - | 213 | 14 |
20,312 | public String getSite ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_site == null ) jcasType . jcas . throwFeatMissing ( "site" , "ch.epfl.bbp.uima.genia.Event" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_site ) ; } | getter for site - gets | 109 | 6 |
20,313 | public void setSite ( String v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_site == null ) jcasType . jcas . throwFeatMissing ( "site" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_site , v ) ; } | setter for site - sets | 112 | 6 |
20,314 | public FSArray getThemes_event ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_event == null ) jcasType . jcas . throwFeatMissing ( "themes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) ) ) ; } | getter for themes_event - gets | 144 | 8 |
20,315 | public void setThemes_event ( FSArray v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_event == null ) jcasType . jcas . throwFeatMissing ( "themes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for themes_event - sets | 140 | 8 |
20,316 | public Event getThemes_event ( int i ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_event == null ) jcasType . jcas . throwFeatMissing ( "themes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) , i ) ; return ( Event ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) , i ) ) ) ; } | indexed getter for themes_event - gets an indexed value - | 215 | 14 |
20,317 | public void setThemes_event ( int i , Event v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_event == null ) jcasType . jcas . throwFeatMissing ( "themes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for themes_event - sets an indexed value - | 213 | 14 |
20,318 | public FSArray getCauses_event ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_event == null ) jcasType . jcas . throwFeatMissing ( "causes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event ) ) ) ; } | getter for causes_event - gets | 144 | 8 |
20,319 | public void setCauses_event ( FSArray v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_event == null ) jcasType . jcas . throwFeatMissing ( "causes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for causes_event - sets | 140 | 8 |
20,320 | public Event getCauses_event ( int i ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_event == null ) jcasType . jcas . throwFeatMissing ( "causes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event ) , i ) ; return ( Event ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event ) , i ) ) ) ; } | indexed getter for causes_event - gets an indexed value - | 215 | 14 |
20,321 | public void setCauses_event ( int i , Event v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_causes_event == null ) jcasType . jcas . throwFeatMissing ( "causes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_causes_event ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for causes_event - sets an indexed value - | 213 | 14 |
20,322 | private String punct ( Parse punct , int i ) { StringBuffer feat = new StringBuffer ( 5 ) ; feat . append ( i ) . append ( "=" ) ; feat . append ( punct . getType ( ) ) ; return ( feat . toString ( ) ) ; } | Creates punctuation feature for the specified punctuation at the specfied index . | 59 | 17 |
20,323 | public String getGender ( ) { if ( NounFeats_Type . featOkTst && ( ( NounFeats_Type ) jcasType ) . casFeat_gender == null ) jcasType . jcas . throwFeatMissing ( "gender" , "de.julielab.jules.types.NounFeats" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( NounFeats_Type ) jcasType ) . casFeatCode_gender ) ; } | getter for gender - gets Gender C | 119 | 8 |
20,324 | public String getLdcatr ( ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_ldcatr == null ) jcasType . jcas . throwFeatMissing ( "ldcatr" , "de.julielab.jules.types.ace.EntityMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_ldcatr ) ; } | getter for ldcatr - gets | 126 | 9 |
20,325 | public void setLdcatr ( String v ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_ldcatr == null ) jcasType . jcas . throwFeatMissing ( "ldcatr" , "de.julielab.jules.types.ace.EntityMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_ldcatr , v ) ; } | setter for ldcatr - sets | 129 | 9 |
20,326 | public String getRole ( ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_role == null ) jcasType . jcas . throwFeatMissing ( "role" , "de.julielab.jules.types.ace.EntityMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_role ) ; } | getter for role - gets | 117 | 6 |
20,327 | public String getMetonymy_mention ( ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_metonymy_mention == null ) jcasType . jcas . throwFeatMissing ( "metonymy_mention" , "de.julielab.jules.types.ace.EntityMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_metonymy_mention ) ; } | getter for metonymy_mention - gets | 137 | 11 |
20,328 | public void setMetonymy_mention ( String v ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_metonymy_mention == null ) jcasType . jcas . throwFeatMissing ( "metonymy_mention" , "de.julielab.jules.types.ace.EntityMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_metonymy_mention , v ) ; } | setter for metonymy_mention - sets | 140 | 11 |
20,329 | public String getMention_type ( ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_mention_type == null ) jcasType . jcas . throwFeatMissing ( "mention_type" , "de.julielab.jules.types.ace.EntityMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_mention_type ) ; } | getter for mention_type - gets | 129 | 8 |
20,330 | public void setMention_type ( String v ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_mention_type == null ) jcasType . jcas . throwFeatMissing ( "mention_type" , "de.julielab.jules.types.ace.EntityMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_mention_type , v ) ; } | setter for mention_type - sets | 132 | 8 |
20,331 | public String getMention_ldctype ( ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_mention_ldctype == null ) jcasType . jcas . throwFeatMissing ( "mention_ldctype" , "de.julielab.jules.types.ace.EntityMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_mention_ldctype ) ; } | getter for mention_ldctype - gets | 137 | 10 |
20,332 | public void setMention_ldctype ( String v ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_mention_ldctype == null ) jcasType . jcas . throwFeatMissing ( "mention_ldctype" , "de.julielab.jules.types.ace.EntityMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_mention_ldctype , v ) ; } | setter for mention_ldctype - sets | 140 | 10 |
20,333 | public Entity getEntity_ref ( ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_entity_ref == null ) jcasType . jcas . throwFeatMissing ( "entity_ref" , "de.julielab.jules.types.ace.EntityMention" ) ; return ( Entity ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_entity_ref ) ) ) ; } | getter for entity_ref - gets | 146 | 8 |
20,334 | public void setEntity_ref ( Entity v ) { if ( EntityMention_Type . featOkTst && ( ( EntityMention_Type ) jcasType ) . casFeat_entity_ref == null ) jcasType . jcas . throwFeatMissing ( "entity_ref" , "de.julielab.jules.types.ace.EntityMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( EntityMention_Type ) jcasType ) . casFeatCode_entity_ref , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for entity_ref - sets | 143 | 8 |
20,335 | public String getSpecificType ( ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_specificType == null ) jcasType . jcas . throwFeatMissing ( "specificType" , "de.julielab.jules.types.ConceptMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_specificType ) ; } | getter for specificType - gets | 120 | 7 |
20,336 | public void setSpecificType ( String v ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_specificType == null ) jcasType . jcas . throwFeatMissing ( "specificType" , "de.julielab.jules.types.ConceptMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_specificType , v ) ; } | setter for specificType - sets | 123 | 7 |
20,337 | public TOP getRef ( ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_ref == null ) jcasType . jcas . throwFeatMissing ( "ref" , "de.julielab.jules.types.ConceptMention" ) ; return ( TOP ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_ref ) ) ) ; } | getter for ref - gets The reference to the Concept we use here the super type TOP in order to avoid the recursive dependencies between type systems | 137 | 28 |
20,338 | public void setRef ( TOP v ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_ref == null ) jcasType . jcas . throwFeatMissing ( "ref" , "de.julielab.jules.types.ConceptMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_ref , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for ref - sets The reference to the Concept we use here the super type TOP in order to avoid the recursive dependencies between type systems | 134 | 28 |
20,339 | public FSArray getResourceEntryList ( ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_resourceEntryList == null ) jcasType . jcas . throwFeatMissing ( "resourceEntryList" , "de.julielab.jules.types.ConceptMention" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) ) ) ; } | getter for resourceEntryList - gets | 147 | 8 |
20,340 | public void setResourceEntryList ( FSArray v ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_resourceEntryList == null ) jcasType . jcas . throwFeatMissing ( "resourceEntryList" , "de.julielab.jules.types.ConceptMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for resourceEntryList - sets | 143 | 8 |
20,341 | public ResourceEntry getResourceEntryList ( int i ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_resourceEntryList == null ) jcasType . jcas . throwFeatMissing ( "resourceEntryList" , "de.julielab.jules.types.ConceptMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) , i ) ; return ( ResourceEntry ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) , i ) ) ) ; } | indexed getter for resourceEntryList - gets an indexed value - | 221 | 14 |
20,342 | public void setResourceEntryList ( int i , ResourceEntry v ) { if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_resourceEntryList == null ) jcasType . jcas . throwFeatMissing ( "resourceEntryList" , "de.julielab.jules.types.ConceptMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for resourceEntryList - sets an indexed value - | 218 | 14 |
20,343 | @ SuppressWarnings ( "unchecked" ) public ArrayList < ArrayList < TextPiece > > getTextPiecesByPage ( File pdfFile ) { assert ( pdfFile . exists ( ) ) : "pdfFile does not exist" ; m_wordsByPage = new ArrayList < ArrayList < TextPiece > > ( ) ; PDDocument document = null ; try { document = PDDocument . load ( pdfFile ) ; resetEngine ( ) ; m_currentPageNo = 0 ; // No support for encrypted file in the current version if ( document . isEncrypted ( ) ) { // TODO: log } else { ArrayList < PDPage > pages = ( ArrayList < PDPage > ) document . getDocumentCatalog ( ) . getAllPages ( ) ; for ( PDPage page : pages ) { m_currentPageNo ++ ; PDStream contentStream = page . getContents ( ) ; if ( contentStream != null ) { COSStream contents = contentStream . getStream ( ) ; processPage ( page , contents ) ; } } } } catch ( Exception e ) { System . out . printf ( "[Error] Fail to extract words\n" ) ; m_wordsByPage = null ; } catch ( OutOfMemoryError e ) { System . out . printf ( "[Error] Out Of Memory\n" ) ; m_wordsByPage = null ; } finally { if ( document != null ) { try { document . close ( ) ; } catch ( IOException e ) { // ignore } } } return m_wordsByPage ; } | Get text pieces from a PDF document | 336 | 7 |
20,344 | @ Override public String stem ( String token ) { if ( token != null && token . length ( ) > 3 && token . endsWith ( "s" ) ) { return token . substring ( 0 , token . length ( ) - 1 ) ; } return token ; } | Removes ending s of words longer than 3 chars | 58 | 10 |
20,345 | private static File materializeDescriptor ( ResourceSpecifier resource ) throws IOException , SAXException { File tempDesc = File . createTempFile ( "desc" , ".xml" ) ; // tempDesc.deleteOnExit(); BufferedWriter out = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( tempDesc ) , "UTF-8" ) ) ; resource . toXML ( out ) ; out . close ( ) ; return tempDesc ; } | Writes a temporary file containing a xml descriptor of the given resource . Returns the file . | 101 | 18 |
20,346 | public String getCat ( ) { if ( CoordinationElement_Type . featOkTst && ( ( CoordinationElement_Type ) jcasType ) . casFeat_cat == null ) jcasType . jcas . throwFeatMissing ( "cat" , "de.julielab.jules.types.CoordinationElement" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( CoordinationElement_Type ) jcasType ) . casFeatCode_cat ) ; } | getter for cat - gets | 116 | 6 |
20,347 | public void setCat ( String v ) { if ( CoordinationElement_Type . featOkTst && ( ( CoordinationElement_Type ) jcasType ) . casFeat_cat == null ) jcasType . jcas . throwFeatMissing ( "cat" , "de.julielab.jules.types.CoordinationElement" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( CoordinationElement_Type ) jcasType ) . casFeatCode_cat , v ) ; } | setter for cat - sets | 119 | 6 |
20,348 | public Set < String > getSynonyms ( final String canonical ) { Set < String > syn = Sets . newHashSet ( ) ; for ( Map < String , Concept > lexica : lexicon ) { for ( String lexCanonical : lexica . keySet ( ) ) { Set < String > variants = lexica . get ( lexCanonical ) . getVariants ( ) ; for ( String variant : variants ) { if ( canonical . equals ( variant ) ) { for ( String v : variants ) { syn . add ( v . toLowerCase ( ) ) ; } } } } } return syn ; } | given a canonical form ( found with a lex - NER return all variants if any | 131 | 17 |
20,349 | public int codePointConversion ( String fontName , int codePoint ) { NonStandardFontFamily nonStandardFontFamily = get ( fontName ) ; if ( nonStandardFontFamily == null ) return codePoint ; CodePointSet codePointSet = nonStandardFontFamily . getCodePointSet ( ) ; if ( codePointSet == null ) return codePoint ; CodePoint decimalCodePoint = codePointSet . getByDecimal ( codePoint ) ; if ( decimalCodePoint != null ) // Fetches the correct unicode point return decimalCodePoint . getUnicodeDecimal ( ) ; CodePoint nameCodePoint = codePointSet . getByName ( charNameByCodePoint . get ( codePoint ) ) ; if ( nameCodePoint != null ) return nameCodePoint . getUnicodeDecimal ( ) ; return codePoint ; } | Takes in argument a codepoint . If for the given police the codepoint doesn t correspond to what the font actually displays the conversion is made . Otherwise the old codepoint is return . | 178 | 41 |
20,350 | public String getPerson ( ) { if ( VerbFeats_Type . featOkTst && ( ( VerbFeats_Type ) jcasType ) . casFeat_person == null ) jcasType . jcas . throwFeatMissing ( "person" , "de.julielab.jules.types.VerbFeats" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( VerbFeats_Type ) jcasType ) . casFeatCode_person ) ; } | getter for person - gets Person | 116 | 7 |
20,351 | public void setPerson ( String v ) { if ( VerbFeats_Type . featOkTst && ( ( VerbFeats_Type ) jcasType ) . casFeat_person == null ) jcasType . jcas . throwFeatMissing ( "person" , "de.julielab.jules.types.VerbFeats" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( VerbFeats_Type ) jcasType ) . casFeatCode_person , v ) ; } | setter for person - sets Person | 119 | 7 |
20,352 | public String getVoice ( ) { if ( VerbFeats_Type . featOkTst && ( ( VerbFeats_Type ) jcasType ) . casFeat_voice == null ) jcasType . jcas . throwFeatMissing ( "voice" , "de.julielab.jules.types.VerbFeats" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( VerbFeats_Type ) jcasType ) . casFeatCode_voice ) ; } | getter for voice - gets Voice | 116 | 7 |
20,353 | public void setVoice ( String v ) { if ( VerbFeats_Type . featOkTst && ( ( VerbFeats_Type ) jcasType ) . casFeat_voice == null ) jcasType . jcas . throwFeatMissing ( "voice" , "de.julielab.jules.types.VerbFeats" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( VerbFeats_Type ) jcasType ) . casFeatCode_voice , v ) ; } | setter for voice - sets Voice | 119 | 7 |
20,354 | public String getAspect ( ) { if ( VerbFeats_Type . featOkTst && ( ( VerbFeats_Type ) jcasType ) . casFeat_aspect == null ) jcasType . jcas . throwFeatMissing ( "aspect" , "de.julielab.jules.types.VerbFeats" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( VerbFeats_Type ) jcasType ) . casFeatCode_aspect ) ; } | getter for aspect - gets Aspect | 120 | 8 |
20,355 | public void setAspect ( String v ) { if ( VerbFeats_Type . featOkTst && ( ( VerbFeats_Type ) jcasType ) . casFeat_aspect == null ) jcasType . jcas . throwFeatMissing ( "aspect" , "de.julielab.jules.types.VerbFeats" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( VerbFeats_Type ) jcasType ) . casFeatCode_aspect , v ) ; } | setter for aspect - sets Aspect | 123 | 8 |
20,356 | public FSArray getFullTextLinks ( ) { if ( FullTextLinkList_Type . featOkTst && ( ( FullTextLinkList_Type ) jcasType ) . casFeat_fullTextLinks == null ) jcasType . jcas . throwFeatMissing ( "fullTextLinks" , "de.julielab.jules.types.FullTextLinkList" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) ) ) ; } | getter for fullTextLinks - gets | 150 | 8 |
20,357 | public void setFullTextLinks ( FSArray v ) { if ( FullTextLinkList_Type . featOkTst && ( ( FullTextLinkList_Type ) jcasType ) . casFeat_fullTextLinks == null ) jcasType . jcas . throwFeatMissing ( "fullTextLinks" , "de.julielab.jules.types.FullTextLinkList" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for fullTextLinks - sets | 146 | 8 |
20,358 | public FullTextLink getFullTextLinks ( int i ) { if ( FullTextLinkList_Type . featOkTst && ( ( FullTextLinkList_Type ) jcasType ) . casFeat_fullTextLinks == null ) jcasType . jcas . throwFeatMissing ( "fullTextLinks" , "de.julielab.jules.types.FullTextLinkList" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) , i ) ; return ( FullTextLink ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) , i ) ) ) ; } | indexed getter for fullTextLinks - gets an indexed value - | 227 | 14 |
20,359 | public void setFullTextLinks ( int i , FullTextLink v ) { if ( FullTextLinkList_Type . featOkTst && ( ( FullTextLinkList_Type ) jcasType ) . casFeat_fullTextLinks == null ) jcasType . jcas . throwFeatMissing ( "fullTextLinks" , "de.julielab.jules.types.FullTextLinkList" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for fullTextLinks - sets an indexed value - | 223 | 14 |
20,360 | public void read ( File f ) throws IOException { FileInputStream fis = new FileInputStream ( f ) ; try { read ( new BufferedReader ( new InputStreamReader ( fis , "UTF-8" ) ) ) ; } finally { IOUtils . closeQuietly ( fis ) ; } } | Read a . obo file | 70 | 6 |
20,361 | public void addTerm ( OntologyTerm term ) { terms . put ( term . getId ( ) , term ) ; indexTerm ( term ) ; isTypeOfIsBuilt = false ; } | Add a single OntologyTerm to the ontology . | 40 | 11 |
20,362 | public void addOntology ( OBOOntology ont ) { for ( String id : ont . terms . keySet ( ) ) { addTerm ( ont . terms . get ( id ) ) ; } } | Merge a whole ontology into the current one . | 43 | 11 |
20,363 | public void writeOntTxt ( PrintWriter pw ) { for ( String id : terms . keySet ( ) ) { OntologyTerm term = terms . get ( id ) ; Set < String > synSet = new HashSet < String > ( ) ; synSet . add ( term . getName ( ) ) ; for ( Synonym s : term . getSynonyms ( ) ) { String st = s . getType ( ) ; if ( id . startsWith ( "PTCO" ) || ( st != null && ! st . matches ( ".*(InChI|SMILES|FORMULA).*" ) ) ) { String synonym = s . getSyn ( ) ; if ( ! synonym . matches ( "\\S" ) ) { // reject ontology terms // consisting of a single // letter as these produce too // many false positives synSet . add ( synonym ) ; } } } pw . println ( "[" + id + "]" ) ; for ( String syn : synSet ) pw . println ( syn ) ; pw . println ( ) ; } pw . flush ( ) ; } | Writes a file suitable for use as onotology . txt . | 241 | 15 |
20,364 | public Set < String > getIdsForIdsWithAncestors ( Collection < String > termIds ) { Stack < String > idsToConsider = new Stack < String > ( ) ; idsToConsider . addAll ( termIds ) ; Set < String > resultIds = new HashSet < String > ( ) ; while ( ! idsToConsider . isEmpty ( ) ) { String id = idsToConsider . pop ( ) ; if ( ! resultIds . contains ( id ) ) { resultIds . add ( id ) ; if ( terms . containsKey ( id ) ) idsToConsider . addAll ( terms . get ( id ) . getIsA ( ) ) ; } } return resultIds ; } | Given a set of IDs return a set that contains all of the IDs the parents of those IDs the grandparents etc . | 160 | 23 |
20,365 | public Set < String > getIdsForIdWithAncestors ( String termId ) { if ( ! terms . containsKey ( termId ) ) return new HashSet < String > ( ) ; Stack < String > idsToConsider = new Stack < String > ( ) ; idsToConsider . add ( termId ) ; Set < String > resultIds = new HashSet < String > ( ) ; while ( ! idsToConsider . isEmpty ( ) ) { String id = idsToConsider . pop ( ) ; if ( ! resultIds . contains ( id ) ) { resultIds . add ( id ) ; idsToConsider . addAll ( terms . get ( id ) . getIsA ( ) ) ; } } return resultIds ; } | Given a single ID return that ID its parents grandparents etc . | 165 | 12 |
20,366 | public Set < String > getIdsForTermWithAncestors ( String s ) { if ( ! indexByName . containsKey ( s ) ) return new HashSet < String > ( ) ; Stack < String > idsToConsider = new Stack < String > ( ) ; idsToConsider . addAll ( getIdsForTerm ( s ) ) ; Set < String > resultIds = new HashSet < String > ( ) ; while ( ! idsToConsider . isEmpty ( ) ) { String id = idsToConsider . pop ( ) ; if ( ! resultIds . contains ( id ) ) { resultIds . add ( id ) ; idsToConsider . addAll ( terms . get ( id ) . getIsA ( ) ) ; } } return resultIds ; } | Look up a term by name and return its ID and the IDs of all of its ancestors . | 172 | 19 |
20,367 | public Set < String > getIdsForIdWithDescendants ( String s ) { buildIsTypeOf ( ) ; Stack < String > idsToConsider = new Stack < String > ( ) ; idsToConsider . add ( s ) ; Set < String > resultIds = new HashSet < String > ( ) ; while ( ! idsToConsider . isEmpty ( ) ) { String id = idsToConsider . pop ( ) ; if ( ! resultIds . contains ( id ) ) { resultIds . add ( id ) ; if ( terms . containsKey ( id ) ) idsToConsider . addAll ( terms . get ( id ) . getIsTypeOf ( ) ) ; } } return resultIds ; } | Given a set of IDs return a set that contains all of the IDs the children of those IDs the grandchildren etc . | 158 | 23 |
20,368 | public String getNameForID ( String id ) { if ( ! terms . containsKey ( id ) ) return null ; return terms . get ( id ) . getName ( ) ; } | Looks up the name for an ontology ID . | 39 | 10 |
20,369 | public String getDefinitionForID ( String id ) { if ( ! terms . containsKey ( id ) ) return null ; return terms . get ( id ) . getDef ( ) ; } | Looks up the definition for an ontology ID . | 39 | 10 |
20,370 | public Set < String > processMentionString ( String mention ) { Set < String > result = new HashSet < String > ( ) ; result . add ( mention ) ; for ( MentionEditor editor : editors ) { Set < String > newResult = new HashSet < String > ( ) ; for ( String mentionEdit : result ) { newResult . addAll ( editor . editMention ( mentionEdit ) ) ; } result . addAll ( newResult ) ; } return result ; } | Run the input string through all of the mention editors to clean and edit it | 103 | 15 |
20,371 | public void add ( T value ) { if ( value == null ) return ; if ( map . containsKey ( value ) ) { map . put ( value , map . get ( value ) + 1 ) ; } else { map . put ( value , 1l ) ; } } | Adds an occurence of this value into the Histogram | 58 | 12 |
20,372 | public List < MedlineCitation > parseAsArticles ( InputStream is ) { try { MedlineCitationSet parse = ( MedlineCitationSet ) unmarshaller . unmarshal ( is ) ; return parse . getMedlineCitation ( ) ; } catch ( Exception e ) { LOG . warn ( "could not parse article " , e ) ; return null ; } finally { IOUtils . closeQuietly ( is ) ; } } | Parse Medline gzipped archives | 96 | 7 |
20,373 | public String getUrl ( ) { if ( FullTextLink_Type . featOkTst && ( ( FullTextLink_Type ) jcasType ) . casFeat_url == null ) jcasType . jcas . throwFeatMissing ( "url" , "de.julielab.jules.types.FullTextLink" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( FullTextLink_Type ) jcasType ) . casFeatCode_url ) ; } | getter for url - gets | 115 | 6 |
20,374 | public void setUrl ( String v ) { if ( FullTextLink_Type . featOkTst && ( ( FullTextLink_Type ) jcasType ) . casFeat_url == null ) jcasType . jcas . throwFeatMissing ( "url" , "de.julielab.jules.types.FullTextLink" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( FullTextLink_Type ) jcasType ) . casFeatCode_url , v ) ; } | setter for url - sets | 118 | 6 |
20,375 | public String getIconUrl ( ) { if ( FullTextLink_Type . featOkTst && ( ( FullTextLink_Type ) jcasType ) . casFeat_iconUrl == null ) jcasType . jcas . throwFeatMissing ( "iconUrl" , "de.julielab.jules.types.FullTextLink" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( FullTextLink_Type ) jcasType ) . casFeatCode_iconUrl ) ; } | getter for iconUrl - gets | 119 | 7 |
20,376 | public void setIconUrl ( String v ) { if ( FullTextLink_Type . featOkTst && ( ( FullTextLink_Type ) jcasType ) . casFeat_iconUrl == null ) jcasType . jcas . throwFeatMissing ( "iconUrl" , "de.julielab.jules.types.FullTextLink" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( FullTextLink_Type ) jcasType ) . casFeatCode_iconUrl , v ) ; } | setter for iconUrl - sets | 122 | 7 |
20,377 | private static void addFullTextPipes ( List < String > usedPipeNames , List < Pipe > pipes ) { // blabla 24 24 pipes . add ( new LongRegexSpaced ( "digit_then_other_then_digit" , Pattern . compile ( "\\d+[^\\d]+\\d+" ) , 2 , 4 ) ) ; // 30 mM K SO , 5 mM MgCl 6H O, 10 mM 24 24 22 HEPES pipes . add ( new LongRegexSpaced ( "digit_then_other_then_digit_then_other_then_digit" , Pattern . compile ( ".*\\d+[^\\d\\n]+\\d+[^\\d\\n]+\\d+.*" ) , 4 , 9 ) ) ; // n 19 // n 5 pipes . add ( new LongRegexSpaced ( "n_space_digit" , Pattern . compile ( "n \\d+" ) , 2 , 2 ) ) ; pipes . add ( new LongRegexSpaced ( "parenthesis_n_space_digit_parenthesis" , Pattern . compile ( "\\( n \\d+ \\)" ) , 3 , 4 ) ) ; pipes . add ( new LongRegexSpaced ( "n_space_digit_parenthesis" , Pattern . compile ( "n \\d+ \\)" ) , 3 , 4 ) ) ; pipes . add ( new LongRegexSpaced ( "parenthesis_n_space_digit" , Pattern . compile ( "\\( n \\d+" ) , 3 , 4 ) ) ; // Fig is never found in any lexicon pipes . add ( new RegexMatches ( "Figure" , Pattern . compile ( ".*Fig.*" ) ) ) ; } | Pipes added based on experience with full text | 381 | 9 |
20,378 | public String getValue ( ) { if ( MMAXAttribute_Type . featOkTst && ( ( MMAXAttribute_Type ) jcasType ) . casFeat_value == null ) jcasType . jcas . throwFeatMissing ( "value" , "de.julielab.jules.types.mmax.MMAXAttribute" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( MMAXAttribute_Type ) jcasType ) . casFeatCode_value ) ; } | getter for value - gets Value of the MMAX attribute | 118 | 12 |
20,379 | public void write ( File f ) { try { ObjectOutputStream oos = new ObjectOutputStream ( new GZIPOutputStream ( new FileOutputStream ( f ) ) ) ; oos . writeObject ( textDirection ) ; if ( textDirection . doForward ( ) ) oos . writeObject ( forwardCRF ) ; if ( textDirection . doReverse ( ) ) oos . writeObject ( reverseCRF ) ; oos . writeObject ( basePipe ) ; oos . writeInt ( order ) ; oos . writeBoolean ( useFeatureInduction ) ; oos . writeObject ( format ) ; oos . close ( ) ; } catch ( IOException e ) { System . err . println ( "Exception writing file " + f + ": " + e ) ; } } | Serializes and writes this CRFTagger to the specified file | 175 | 12 |
20,380 | public String getEntityId ( ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_entityId == null ) jcasType . jcas . throwFeatMissing ( "entityId" , "ch.epfl.bbp.uima.types.DictTerm" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_entityId ) ; } | getter for entityId - gets | 120 | 7 |
20,381 | public void setEntityId ( String v ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_entityId == null ) jcasType . jcas . throwFeatMissing ( "entityId" , "ch.epfl.bbp.uima.types.DictTerm" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_entityId , v ) ; } | setter for entityId - sets | 123 | 7 |
20,382 | public String getAnnotType ( ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_annotType == null ) jcasType . jcas . throwFeatMissing ( "annotType" , "ch.epfl.bbp.uima.types.DictTerm" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_annotType ) ; } | getter for annotType - gets | 121 | 7 |
20,383 | public void setAnnotType ( String v ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_annotType == null ) jcasType . jcas . throwFeatMissing ( "annotType" , "ch.epfl.bbp.uima.types.DictTerm" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_annotType , v ) ; } | setter for annotType - sets | 124 | 7 |
20,384 | private Templates getTemplates ( String filename ) { // InputStream is = // AnnotationViewGenerator.class.getResourceAsStream(filename); Templates templates ; InputStream is = null ; try { is = ResourceHelper . getInputStream ( "viewer/" + filename ) ; templates = mTFactory . newTemplates ( new StreamSource ( is ) ) ; } catch ( Exception e ) { throw new UIMARuntimeException ( e ) ; } finally { IOUtils . closeQuietly ( is ) ; } return templates ; } | Parses an XML file and produces a Templates object . | 119 | 13 |
20,385 | private void writeToFile ( String filename , File outputDir ) { File outFile = new File ( outputDir , filename ) ; OutputStream os ; try { os = new FileOutputStream ( outFile ) ; } catch ( FileNotFoundException e ) { throw new UIMARuntimeException ( e ) ; } InputStream is = null ; try { is = ResourceHelper . getInputStream ( "viewer/" + filename ) ; byte [ ] buf = new byte [ 1024 ] ; int numRead ; while ( ( numRead = is . read ( buf ) ) > 0 ) { os . write ( buf , 0 , numRead ) ; } } catch ( IOException e ) { throw new UIMARuntimeException ( e ) ; } finally { try { is . close ( ) ; } catch ( IOException e ) { // ignore close errors } try { os . close ( ) ; } catch ( IOException e ) { // ignore close errors } } } | Writes a resource file to disk . The resource file is looked up in the classpath | 204 | 18 |
20,386 | public static String autoGenerateStyleMap ( AnalysisEngineMetaData aTaeMetaData ) { // styles used in automatically generated style maps final String [ ] STYLES = { "color:black; background:lightblue;" , "color:black; background:lightgreen;" , "color:black; background:orange;" , "color:black; background:yellow;" , "color:black; background:pink;" , "color:black; background:salmon;" , "color:black; background:cyan;" , "color:black; background:violet;" , "color:black; background:tan;" , "color:white; background:brown;" , "color:white; background:blue;" , "color:white; background:green;" , "color:white; background:red;" , "color:white; background:mediumpurple;" } ; // get list of output types from TAE ArrayList outputTypes = new ArrayList ( ) ; Capability [ ] capabilities = aTaeMetaData . getCapabilities ( ) ; for ( int i = 0 ; i < capabilities . length ; i ++ ) { TypeOrFeature [ ] outputs = capabilities [ i ] . getOutputs ( ) ; for ( int j = 0 ; j < outputs . length ; j ++ ) { if ( outputs [ j ] . isType ( ) && ! outputTypes . contains ( outputs [ j ] . getName ( ) ) ) { outputTypes . add ( outputs [ j ] . getName ( ) ) ; } } } // generate style map by mapping each type to a background color StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ) ; buf . append ( "<styleMap>\n" ) ; int i = 0 ; Iterator it = outputTypes . iterator ( ) ; while ( it . hasNext ( ) ) { String outputType = ( String ) it . next ( ) ; String label = outputType ; int lastDot = outputType . lastIndexOf ( ' ' ) ; if ( lastDot > - 1 ) { label = outputType . substring ( lastDot + 1 ) ; } buf . append ( "<rule>\n" ) ; buf . append ( "<pattern>" ) ; buf . append ( outputType ) ; buf . append ( "</pattern>\n" ) ; buf . append ( "<label>" ) ; buf . append ( label ) ; buf . append ( "</label>\n" ) ; buf . append ( "<style>" ) ; buf . append ( STYLES [ i % STYLES . length ] ) ; buf . append ( "</style>\n" ) ; buf . append ( "</rule>\n" ) ; i ++ ; } buf . append ( "</styleMap>\n" ) ; return buf . toString ( ) ; } | Automatically generates a style map for the given text analysis engine . The style map will be returned as an XML string . | 628 | 24 |
20,387 | public static String autoGenerateStyleMap ( TypeSystemDescription aTypeSystem ) { // styles used in automatically generated style maps final String [ ] STYLES = { "color:black; background:lightblue;" , "color:black; background:lightgreen;" , "color:black; background:orange;" , "color:black; background:yellow;" , "color:black; background:pink;" , "color:black; background:salmon;" , "color:black; background:cyan;" , "color:black; background:violet;" , "color:black; background:tan;" , "color:white; background:brown;" , "color:white; background:blue;" , "color:white; background:green;" , "color:white; background:red;" , "color:white; background:mediumpurple;" } ; TypeDescription [ ] types = aTypeSystem . getTypes ( ) ; // generate style map by mapping each type to a background color StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" ) ; buf . append ( "<styleMap>\n" ) ; for ( int i = 0 ; i < types . length ; i ++ ) { String outputType = types [ i ] . getName ( ) ; String label = outputType ; int lastDot = outputType . lastIndexOf ( ' ' ) ; if ( lastDot > - 1 ) { label = outputType . substring ( lastDot + 1 ) ; } buf . append ( "<rule>\n" ) ; buf . append ( "<pattern>" ) ; buf . append ( outputType ) ; buf . append ( "</pattern>\n" ) ; buf . append ( "<label>" ) ; buf . append ( label ) ; buf . append ( "</label>\n" ) ; buf . append ( "<style>" ) ; buf . append ( STYLES [ i % STYLES . length ] ) ; buf . append ( "</style>\n" ) ; buf . append ( "</rule>\n" ) ; } buf . append ( "</styleMap>\n" ) ; return buf . toString ( ) ; } | Automatically generates a style map for the given type system . The style map will be returned as an XML string . | 490 | 23 |
20,388 | public static String toLine ( Event event ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( event . getOutcome ( ) ) ; String [ ] context = event . getContext ( ) ; for ( int ci = 0 , cl = context . length ; ci < cl ; ci ++ ) { sb . append ( " " + context [ ci ] ) ; } sb . append ( System . getProperty ( "line.separator" ) ) ; return sb . toString ( ) ; } | Generates a string representing the specified event . | 116 | 9 |
20,389 | public static void main ( String [ ] args ) throws IOException { if ( args . length == 0 ) { System . err . println ( "Usage: FileEventStream eventfile [iterations cutoff]" ) ; System . exit ( 1 ) ; } int ai = 0 ; String eventFile = args [ ai ++ ] ; EventStream es = new FileEventStream ( eventFile ) ; int iterations = 100 ; int cutoff = 5 ; if ( ai < args . length ) { iterations = Integer . parseInt ( args [ ai ++ ] ) ; cutoff = Integer . parseInt ( args [ ai ++ ] ) ; } GISModel model = GIS . trainModel ( es , iterations , cutoff ) ; new SuffixSensitiveGISModelWriter ( model , new File ( eventFile + ".bin.gz" ) ) . persist ( ) ; } | Trains and writes a model based on the events in the specified event file . the name of the model created is based on the event file name . | 182 | 30 |
20,390 | private void addCapabilities ( CollectionReaderDescription crd ) { for ( Capability capability : crd . getCollectionReaderMetaData ( ) . getCapabilities ( ) ) { for ( TypeOrFeature output : capability . getOutputs ( ) ) { // LOG.info("add @TypeCapability: " + output.getName()); outputTypes . add ( output . getName ( ) ) ; } } } | Add this crd s capabilities for other downstream aeds . | 87 | 12 |
20,391 | private void checkAndAddCapabilities ( AnalysisEngineDescription aed ) { for ( Capability capability : aed . getAnalysisEngineMetaData ( ) . getCapabilities ( ) ) { for ( TypeOrFeature input : capability . getInputs ( ) ) if ( ! outputTypes . contains ( input . getName ( ) ) ) LOG . error ( "AnalysisEngine " + aed . getAnnotatorImplementationName ( ) + " is missing input @TypeCapability: " + input . getName ( ) ) ; } for ( Capability capability : aed . getAnalysisEngineMetaData ( ) . getCapabilities ( ) ) { for ( TypeOrFeature output : capability . getOutputs ( ) ) { // LOG.info("add @TypeCapability: " + output.getName()); outputTypes . add ( output . getName ( ) ) ; } } } | Checks that this | 186 | 4 |
20,392 | public String getMostProbableSpeciesId ( ) { if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_mostProbableSpeciesId == null ) jcasType . jcas . throwFeatMissing ( "mostProbableSpeciesId" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_mostProbableSpeciesId ) ; } | getter for mostProbableSpeciesId - gets This feature contains the value of the most probable NCBI Taxonomy Id for the annotated species occurence . | 144 | 34 |
20,393 | public void setMostProbableSpeciesId ( String v ) { if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_mostProbableSpeciesId == null ) jcasType . jcas . throwFeatMissing ( "mostProbableSpeciesId" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_mostProbableSpeciesId , v ) ; } | setter for mostProbableSpeciesId - sets This feature contains the value of the most probable NCBI Taxonomy Id for the annotated species occurence . | 147 | 34 |
20,394 | public String getAllIdsString ( ) { if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_allIdsString == null ) jcasType . jcas . throwFeatMissing ( "allIdsString" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_allIdsString ) ; } | getter for allIdsString - gets This feature contains all possible NCBI Taxonomy IDs . | 136 | 20 |
20,395 | public void setAllIdsString ( String v ) { if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_allIdsString == null ) jcasType . jcas . throwFeatMissing ( "allIdsString" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_allIdsString , v ) ; } | setter for allIdsString - sets This feature contains all possible NCBI Taxonomy IDs . | 139 | 20 |
20,396 | public boolean getAmbigous ( ) { if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_ambigous == null ) jcasType . jcas . throwFeatMissing ( "ambigous" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_ambigous ) ; } | getter for ambigous - gets True if the species tagging is ambigous . | 133 | 16 |
20,397 | public void setAmbigous ( boolean v ) { if ( LinnaeusSpecies_Type . featOkTst && ( ( LinnaeusSpecies_Type ) jcasType ) . casFeat_ambigous == null ) jcasType . jcas . throwFeatMissing ( "ambigous" , "ch.epfl.bbp.uima.types.LinnaeusSpecies" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( LinnaeusSpecies_Type ) jcasType ) . casFeatCode_ambigous , v ) ; } | setter for ambigous - sets True if the species tagging is ambigous . | 136 | 16 |
20,398 | private double getMinStringSize ( String [ ] tTokens , String [ ] uTokens ) { double tSize = 0 , uSize = 0 ; for ( int i = 0 ; i < tTokens . length ; i ++ ) { tSize += tTokens [ i ] . length ( ) ; } for ( int i = 0 ; i < uTokens . length ; i ++ ) { uSize += uTokens [ i ] . length ( ) ; } return Math . min ( tSize , uSize ) ; } | getMinStringSize count the number of characters in String array tTokens and String array uTokens and return the minimun size . | 108 | 26 |
20,399 | public double score ( StringWrapper s , StringWrapper t ) { checkTrainingHasHappened ( s , t ) ; UnitVector sBag = asUnitVector ( s ) ; UnitVector tBag = asUnitVector ( t ) ; if ( s . unwrap ( ) . equals ( t . unwrap ( ) ) ) { return 1.0 ; } else { String [ ] sTokens = getTokenArray ( sBag ) , tTokens = getTokenArray ( tBag ) ; double [ ] sIdfArray = getIDFArray ( sBag ) , tIdfArray = getIDFArray ( tBag ) ; return algorithm1 ( sTokens , tTokens , sIdfArray , tIdfArray ) ; } } | getStringMetric computes the similarity between a pair of strings T and U . | 164 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.