idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
20,200
public String getOntClassId ( ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_ontClassId == null ) jcasType . jcas . throwFeatMissing ( "ontClassId" , "de.julielab.jules.types.OntClassMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_ontClassId ) ; }
getter for ontClassId - gets ID of the corresponding ontology class
20,201
public void setOntClassId ( String v ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_ontClassId == null ) jcasType . jcas . throwFeatMissing ( "ontClassId" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_ontClassId , v ) ; }
setter for ontClassId - sets ID of the corresponding ontology class
20,202
public StringArray getSemanticTypes ( ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_semanticTypes == null ) jcasType . jcas . throwFeatMissing ( "semanticTypes" , "de.julielab.jules.types.OntClassMention" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_semanticTypes ) ) ) ; }
getter for semanticTypes - gets Names or IDs of associated semantic types .
20,203
public void setSemanticTypes ( StringArray v ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_semanticTypes == null ) jcasType . jcas . throwFeatMissing ( "semanticTypes" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_semanticTypes , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for semanticTypes - sets Names or IDs of associated semantic types .
20,204
public String getSemanticTypes ( int i ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_semanticTypes == null ) jcasType . jcas . throwFeatMissing ( "semanticTypes" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_semanticTypes ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_semanticTypes ) , i ) ; }
indexed getter for semanticTypes - gets an indexed value - Names or IDs of associated semantic types .
20,205
public void setSemanticTypes ( int i , String v ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_semanticTypes == null ) jcasType . jcas . throwFeatMissing ( "semanticTypes" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_semanticTypes ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_semanticTypes ) , i , v ) ; }
indexed setter for semanticTypes - sets an indexed value - Names or IDs of associated semantic types .
20,206
public String getPreferredTerm ( ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_preferredTerm == null ) jcasType . jcas . throwFeatMissing ( "preferredTerm" , "de.julielab.jules.types.OntClassMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_preferredTerm ) ; }
getter for preferredTerm - gets The preferred term associated with the corresponding ontology class .
20,207
public void setPreferredTerm ( String v ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_preferredTerm == null ) jcasType . jcas . throwFeatMissing ( "preferredTerm" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_preferredTerm , v ) ; }
setter for preferredTerm - sets The preferred term associated with the corresponding ontology class .
20,208
public Token getMatchedTokens ( int i ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_matchedTokens == null ) jcasType . jcas . throwFeatMissing ( "matchedTokens" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_matchedTokens ) , i ) ; return ( Token ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_matchedTokens ) , i ) ) ) ; }
indexed getter for matchedTokens - gets an indexed value - List of tokens the ontology class mention is comprised of .
20,209
public void setMatchedTokens ( int i , Token v ) { if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_matchedTokens == null ) jcasType . jcas . throwFeatMissing ( "matchedTokens" , "de.julielab.jules.types.OntClassMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_matchedTokens ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( OntClassMention_Type ) jcasType ) . casFeatCode_matchedTokens ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
indexed setter for matchedTokens - sets an indexed value - List of tokens the ontology class mention is comprised of .
20,210
public String generateDrop ( String table ) { StringBuffer result = new StringBuffer ( ) ; result . append ( "DROP TABLE " ) ; result . append ( table ) ; result . append ( ";\n" ) ; return result . toString ( ) ; }
Generate the DROP statement for a table .
20,211
public Collection < String > listTables ( ) throws SQLException { Collection < String > result = new ArrayList < String > ( ) ; DatabaseMetaData dbm = connection . getMetaData ( ) ; String types [ ] = { "TABLE" } ; ResultSet rs = dbm . getTables ( null , null , "" , types ) ; while ( rs . next ( ) ) { String str = rs . getString ( "TABLE_NAME" ) ; result . add ( str ) ; } return result ; }
Get a list of all tables in the database .
20,212
public Collection < String > listColumns ( String table ) throws SQLException { Collection < String > result = new ArrayList < String > ( ) ; DatabaseMetaData dbm = connection . getMetaData ( ) ; ResultSet rs = dbm . getColumns ( null , null , table , null ) ; while ( rs . next ( ) ) { result . add ( rs . getString ( "COLUMN_NAME" ) ) ; } return result ; }
Get a list of all of the columns on a table .
20,213
public void startUsingModel ( ) { if ( replacementThread != null ) { try { replacementThread . join ( ) ; } catch ( InterruptedException e ) { } } replacementCanProceed = false ; users ++ ; }
Inform the manager that a thread is using the model . If a replacement is underway the thread is forced to join the replacement thread and thus wait until it is finished to begin using the model .
20,214
public synchronized void replaceModel ( MaxentModel model ) { replacementThread = Thread . currentThread ( ) ; while ( ! replacementCanProceed ) Thread . yield ( ) ; setter . setModel ( model ) ; replacementThread = null ; }
Replace the old model with a new one forcing the replacement to wait until all threads using the old model have finished using it .
20,215
public void toIdFile ( OutputStream os ) throws IOException { BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( os ) ) ; for ( TrieNodeData < T > child : root . children . values ( ) ) { child . writeIds ( writer , new char [ 0 ] ) ; } writer . close ( ) ; }
one entry per line . word first then tab then data
20,216
public java . util . List < Glossary > getGlossary ( ) { if ( glossary == null ) { glossary = new ArrayList < Glossary > ( ) ; } return this . glossary ; }
Gets the value of the glossary property .
20,217
public String getDescriptorName ( ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_descriptorName == null ) jcasType . jcas . throwFeatMissing ( "descriptorName" , "de.julielab.jules.types.MeshHeading" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_descriptorName ) ; }
getter for descriptorName - gets see MeSH
20,218
public void setDescriptorName ( String v ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_descriptorName == null ) jcasType . jcas . throwFeatMissing ( "descriptorName" , "de.julielab.jules.types.MeshHeading" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_descriptorName , v ) ; }
setter for descriptorName - sets see MeSH
20,219
public String getQualifierName ( ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_qualifierName == null ) jcasType . jcas . throwFeatMissing ( "qualifierName" , "de.julielab.jules.types.MeshHeading" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_qualifierName ) ; }
getter for qualifierName - gets see MeSH
20,220
public void setQualifierName ( String v ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_qualifierName == null ) jcasType . jcas . throwFeatMissing ( "qualifierName" , "de.julielab.jules.types.MeshHeading" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_qualifierName , v ) ; }
setter for qualifierName - sets see MeSH
20,221
public boolean getDescriptorNameMajorTopic ( ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_descriptorNameMajorTopic == null ) jcasType . jcas . throwFeatMissing ( "descriptorNameMajorTopic" , "de.julielab.jules.types.MeshHeading" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_descriptorNameMajorTopic ) ; }
getter for descriptorNameMajorTopic - gets see MeSH
20,222
public void setDescriptorNameMajorTopic ( boolean v ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_descriptorNameMajorTopic == null ) jcasType . jcas . throwFeatMissing ( "descriptorNameMajorTopic" , "de.julielab.jules.types.MeshHeading" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_descriptorNameMajorTopic , v ) ; }
setter for descriptorNameMajorTopic - sets see MeSH
20,223
public boolean getQualifierNameMajorTopic ( ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_qualifierNameMajorTopic == null ) jcasType . jcas . throwFeatMissing ( "qualifierNameMajorTopic" , "de.julielab.jules.types.MeshHeading" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_qualifierNameMajorTopic ) ; }
getter for qualifierNameMajorTopic - gets see MeSH
20,224
public void setQualifierNameMajorTopic ( boolean v ) { if ( MeshHeading_Type . featOkTst && ( ( MeshHeading_Type ) jcasType ) . casFeat_qualifierNameMajorTopic == null ) jcasType . jcas . throwFeatMissing ( "qualifierNameMajorTopic" , "de.julielab.jules.types.MeshHeading" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( MeshHeading_Type ) jcasType ) . casFeatCode_qualifierNameMajorTopic , v ) ; }
setter for qualifierNameMajorTopic - sets see MeSH
20,225
public String getRef_id ( ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_ref_id == null ) jcasType . jcas . throwFeatMissing ( "ref_id" , "ch.epfl.bbp.uima.types.BioVerb" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_ref_id ) ; }
getter for ref_id - gets
20,226
public void setRef_id ( String v ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_ref_id == null ) jcasType . jcas . throwFeatMissing ( "ref_id" , "ch.epfl.bbp.uima.types.BioVerb" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_ref_id , v ) ; }
setter for ref_id - sets
20,227
public String getCanonical ( ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_canonical == null ) jcasType . jcas . throwFeatMissing ( "canonical" , "ch.epfl.bbp.uima.types.BioVerb" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_canonical ) ; }
getter for canonical - gets
20,228
public void setCanonical ( String v ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_canonical == null ) jcasType . jcas . throwFeatMissing ( "canonical" , "ch.epfl.bbp.uima.types.BioVerb" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_canonical , v ) ; }
setter for canonical - sets
20,229
public String getMatchedText ( ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_matchedText == null ) jcasType . jcas . throwFeatMissing ( "matchedText" , "ch.epfl.bbp.uima.types.BioVerb" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_matchedText ) ; }
getter for matchedText - gets
20,230
public void setMatchedText ( String v ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_matchedText == null ) jcasType . jcas . throwFeatMissing ( "matchedText" , "ch.epfl.bbp.uima.types.BioVerb" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_matchedText , v ) ; }
setter for matchedText - sets
20,231
public FSArray getMatchedTokens ( ) { if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_matchedTokens == null ) jcasType . jcas . throwFeatMissing ( "matchedTokens" , "ch.epfl.bbp.uima.types.BioVerb" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_matchedTokens ) ) ) ; }
getter for matchedTokens - gets
20,232
public String getDegree ( ) { if ( AdjectiveFeats_Type . featOkTst && ( ( AdjectiveFeats_Type ) jcasType ) . casFeat_degree == null ) jcasType . jcas . throwFeatMissing ( "degree" , "de.julielab.jules.types.AdjectiveFeats" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( AdjectiveFeats_Type ) jcasType ) . casFeatCode_degree ) ; }
getter for degree - gets Degree
20,233
public void setDegree ( String v ) { if ( AdjectiveFeats_Type . featOkTst && ( ( AdjectiveFeats_Type ) jcasType ) . casFeat_degree == null ) jcasType . jcas . throwFeatMissing ( "degree" , "de.julielab.jules.types.AdjectiveFeats" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( AdjectiveFeats_Type ) jcasType ) . casFeatCode_degree , v ) ; }
setter for degree - sets Degree
20,234
public SourcedToken [ ] sourcedTokenize ( String input , String source ) { Token [ ] tokens = tokenize ( input ) ; SourcedToken [ ] sourcedTokens = new SourcedToken [ tokens . length ] ; for ( int i = 0 ; i < tokens . length ; i ++ ) { String key = tokens [ i ] . getValue ( ) + "@" + source ; if ( tokMap . get ( key ) == null ) { tokMap . put ( key , new Integer ( ++ nextId ) ) ; } int id = ( ( Integer ) tokMap . get ( key ) ) . intValue ( ) ; sourcedTokens [ i ] = new BasicSourcedToken ( id , tokens [ i ] . getValue ( ) , source ) ; } return sourcedTokens ; }
Return tokenized version of a string .
20,235
void setWeight ( Token tok , double d ) { Double oldWeight = ( Double ) weightMap . get ( tok ) ; totalWeight += oldWeight == null ? d : ( d - oldWeight . doubleValue ( ) ) ; weightMap . put ( tok , new Double ( d ) ) ; }
Change the weight of a token in the bag
20,236
public StringArray getAcList ( ) { if ( DBInfo_Type . featOkTst && ( ( DBInfo_Type ) jcasType ) . casFeat_acList == null ) jcasType . jcas . throwFeatMissing ( "acList" , "de.julielab.jules.types.DBInfo" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DBInfo_Type ) jcasType ) . casFeatCode_acList ) ) ) ; }
getter for acList - gets A list of accession numbers for this DB C
20,237
public void setAcList ( StringArray v ) { if ( DBInfo_Type . featOkTst && ( ( DBInfo_Type ) jcasType ) . casFeat_acList == null ) jcasType . jcas . throwFeatMissing ( "acList" , "de.julielab.jules.types.DBInfo" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( DBInfo_Type ) jcasType ) . casFeatCode_acList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for acList - sets A list of accession numbers for this DB C
20,238
public String getAcList ( int i ) { if ( DBInfo_Type . featOkTst && ( ( DBInfo_Type ) jcasType ) . casFeat_acList == null ) jcasType . jcas . throwFeatMissing ( "acList" , "de.julielab.jules.types.DBInfo" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DBInfo_Type ) jcasType ) . casFeatCode_acList ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DBInfo_Type ) jcasType ) . casFeatCode_acList ) , i ) ; }
indexed getter for acList - gets an indexed value - A list of accession numbers for this DB C
20,239
public void setAcList ( int i , String v ) { if ( DBInfo_Type . featOkTst && ( ( DBInfo_Type ) jcasType ) . casFeat_acList == null ) jcasType . jcas . throwFeatMissing ( "acList" , "de.julielab.jules.types.DBInfo" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DBInfo_Type ) jcasType ) . casFeatCode_acList ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DBInfo_Type ) jcasType ) . casFeatCode_acList ) , i , v ) ; }
indexed setter for acList - sets an indexed value - A list of accession numbers for this DB C
20,240
public int getDay ( ) { if ( Date_Type . featOkTst && ( ( Date_Type ) jcasType ) . casFeat_day == null ) jcasType . jcas . throwFeatMissing ( "day" , "de.julielab.jules.types.Date" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( Date_Type ) jcasType ) . casFeatCode_day ) ; }
getter for day - gets day of the month C
20,241
public void setDay ( int v ) { if ( Date_Type . featOkTst && ( ( Date_Type ) jcasType ) . casFeat_day == null ) jcasType . jcas . throwFeatMissing ( "day" , "de.julielab.jules.types.Date" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( Date_Type ) jcasType ) . casFeatCode_day , v ) ; }
setter for day - sets day of the month C
20,242
public int getMonth ( ) { if ( Date_Type . featOkTst && ( ( Date_Type ) jcasType ) . casFeat_month == null ) jcasType . jcas . throwFeatMissing ( "month" , "de.julielab.jules.types.Date" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( Date_Type ) jcasType ) . casFeatCode_month ) ; }
getter for month - gets month of the year C
20,243
public void setMonth ( int v ) { if ( Date_Type . featOkTst && ( ( Date_Type ) jcasType ) . casFeat_month == null ) jcasType . jcas . throwFeatMissing ( "month" , "de.julielab.jules.types.Date" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( Date_Type ) jcasType ) . casFeatCode_month , v ) ; }
setter for month - sets month of the year C
20,244
public Double averagePrecision ( ) { double n = 0 ; double sumPrecision = 0 ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( correctPair ( i ) ) { n ++ ; double precisionAtRankI = n / ( i + 1.0 ) ; sumPrecision += precisionAtRankI ; } } return new Double ( sumPrecision / numCorrectPairs ) ; }
non - interpolated average precision
20,245
public Double maxF1 ( ) { double maxF1 = - Double . MAX_VALUE ; double n = 0 ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( correctPair ( i ) ) { n ++ ; double precisionAtRankI = n / ( i + 1.0 ) ; double recallAtRankI = n / numCorrectPairs ; if ( precisionAtRankI > 0 && recallAtRankI > 0 ) { double f1 = 2 * ( precisionAtRankI * recallAtRankI ) / ( precisionAtRankI + recallAtRankI ) ; maxF1 = Math . max ( f1 , maxF1 ) ; } } } return new Double ( maxF1 ) ; }
max F1 for any threshold
20,246
public Double blockerRecall ( ) { double n = 0 ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( correctPair ( i ) ) { n ++ ; } } return new Double ( n / numCorrectPairs ) ; }
performance of the blocker
20,247
public double [ ] interpolated11PointPrecision ( ) { double [ ] interpolatedPrecision = new double [ 11 ] ; int numCorrectAtRankI = 0 ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( correctPair ( i ) ) ++ numCorrectAtRankI ; double recall = numCorrectAtRankI / ( ( double ) numCorrectPairs ) ; double precision = numCorrectAtRankI / ( i + 1.0 ) ; for ( int j = 0 ; j < elevenPoints . length ; j ++ ) { if ( recall >= elevenPoints [ j ] ) { interpolatedPrecision [ j ] = Math . max ( interpolatedPrecision [ j ] , precision ) ; } } } return interpolatedPrecision ; }
Return an array of interpolated precision at various different recall levels .
20,248
public void graphPrecisionRecall ( PrintStream out ) throws IOException { double [ ] interpolatedPrecision = new double [ pairs . length ] ; double n = numCorrectPairs ; double maxPrecision = n / pairs . length ; for ( int i = pairs . length - 1 ; i >= 0 ; i -- ) { if ( correctPair ( i ) ) { interpolatedPrecision [ i ] = maxPrecision ; n -- ; maxPrecision = Math . max ( maxPrecision , n / ( i + 1 ) ) ; } } n = 0 ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( correctPair ( i ) ) { n ++ ; double recallAtRankI = n / numCorrectPairs ; out . println ( recallAtRankI + "\t" + interpolatedPrecision [ i ] ) ; } } }
Graph interpolated precision vs recall
20,249
public void displayResults ( boolean showMismatches , PrintStream out ) throws IOException { PrintfFormat fmt = new PrintfFormat ( "%s %3d %7.2f | %30s | %30s\n" ) ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( pairs [ i ] != null ) { String label = pairs [ i ] . isCorrect ( ) ? "+" : "-" ; String aText = ( pairs [ i ] . getA ( ) == null ) ? "***" : pairs [ i ] . getA ( ) . unwrap ( ) ; String bText = ( pairs [ i ] . getB ( ) == null ) ? "***" : pairs [ i ] . getB ( ) . unwrap ( ) ; if ( showMismatches || "+" . equals ( label ) ) { out . print ( fmt . sprintf ( new Object [ ] { label , new Integer ( i + 1 ) , new Double ( pairs [ i ] . getDistance ( ) ) , aText , bText } ) ) ; } } } }
Show results in a simple format .
20,250
public void dumpResults ( PrintStream out ) throws IOException { PrintfFormat fmt = new PrintfFormat ( "%7.2f\t%s\t%s\n" ) ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( pairs [ i ] != null ) { String aText = ( pairs [ i ] . getA ( ) == null ) ? "***" : pairs [ i ] . getA ( ) . unwrap ( ) ; String bText = ( pairs [ i ] . getB ( ) == null ) ? "***" : pairs [ i ] . getB ( ) . unwrap ( ) ; out . print ( fmt . sprintf ( new Object [ ] { new Double ( pairs [ i ] . getDistance ( ) ) , aText , bText } ) ) ; } } }
Show results in an easily machine - readable format .
20,251
public static void main ( String [ ] args ) throws IOException { ch . epfl . bbp . shaded . opennlp . maxent . GISModel m = new SuffixSensitiveGISModelReader ( new File ( args [ 0 ] ) ) . getModel ( ) ; new SuffixSensitiveGISModelWriter ( m , new File ( args [ 1 ] ) ) . persist ( ) ; }
To convert between different formats of the new style .
20,252
private boolean unknownByPDFExtractor ( ArrayList < ArrayList < TextPiece > > wordsByPage ) { ArrayList < TextPiece > wordsOfPageOne = wordsByPage . get ( 0 ) ; boolean isUnknownCode = false ; int i = 0 ; float codeSize = 0.0f ; while ( i < wordsOfPageOne . size ( ) ) { codeSize = codeSize + Math . max ( wordsOfPageOne . get ( i ) . getXScale ( ) , wordsOfPageOne . get ( i ) . getFontSize ( ) ) ; i ++ ; } codeSize = codeSize / ( float ) wordsOfPageOne . size ( ) ; if ( codeSize <= 1.2 ) isUnknownCode = true ; return ( isUnknownCode ) ; }
Detects PDF documents encoded in unknown codes
20,253
private Vector getDistinctSortedY ( Vector distinctY , Vector piecesEachY , ArrayList < TextPiece > wordsOfAPage , TableCandidate tc ) { int pieceNumThisPage = wordsOfAPage . size ( ) ; float x_columnToGetYs = m_docInfo . getMinX ( ) ; float endX_columnToGetYs = m_docInfo . getMiddleX ( ) ; if ( ( tc . isWideTable ( ) == false ) && ( tc . getCaptionX ( ) >= m_docInfo . getMiddleX ( ) ) ) { x_columnToGetYs = m_docInfo . getMiddleX ( ) ; endX_columnToGetYs = m_docInfo . getMaxX ( ) ; } float [ ] sortY = new float [ pieceNumThisPage ] ; for ( int bb = 0 ; bb < pieceNumThisPage ; bb ++ ) { if ( ( wordsOfAPage . get ( bb ) . getX ( ) >= x_columnToGetYs ) && ( wordsOfAPage . get ( bb ) . getEndX ( ) <= endX_columnToGetYs ) ) { sortY [ bb ] = wordsOfAPage . get ( bb ) . getY ( ) ; } } Arrays . sort ( sortY ) ; int bb = 0 ; float lastY = 0.0f ; while ( bb < pieceNumThisPage ) { if ( distinctY . size ( ) > 0 ) lastY = ( ( Float ) distinctY . lastElement ( ) ) . floatValue ( ) ; if ( ( sortY [ bb ] - lastY ) >= m_docInfo . getAverageLineGap ( ) / 2.0 ) distinctY . addElement ( new Float ( sortY [ bb ] ) ) ; bb ++ ; } return distinctY ; }
We do not sort the text pieces according to Y values in the WHOLE page because if a document contains more than one column and the table is within one document column this action will bring the text pieces in other document columns as noise texts . By default we sort Y coordinate values based on the text pieces in the left part of the page If we find a table is not a wide table and located in the right part we only process the right half of the page
20,254
private String getMatchedTabledKeyword ( String line ) { for ( String keyword : Config . TABLE_KEYWORDS ) { if ( line . startsWith ( keyword ) ) { return keyword ; } } return null ; }
Checks and returns the table caption keyword at the beginning of a give line
20,255
private String getMatchedFigureKeyword ( String line ) { for ( String keyword : Config . FIGURE_KEYWORDS ) { if ( line . startsWith ( keyword ) ) { return keyword ; } } return null ; }
Checks and returns the figure caption keyword at the beginning of a give line
20,256
private void findFootnoteBeginRow ( TableCandidate tc ) { for ( int i = 0 ; i < tc . getRows ( ) . size ( ) ; i ++ ) { TableRow row = tc . getRows ( ) . get ( i ) ; TextPiece firstCell = row . getCells ( ) . get ( 0 ) ; String text = firstCell . getText ( ) ; if ( text . startsWith ( "*" ) || text . startsWith ( "t " ) || text . startsWith ( "$" ) || text . startsWith ( "?" ) || text . startsWith ( "''" ) || text . startsWith ( "Note:" ) || ( text . startsWith ( "a" ) && i >= tc . getRows ( ) . size ( ) - 2 && row . isSuperScriptRow ( ) ) ) { tc . setFootnoteBeginRow ( i ) ; break ; } } if ( tc . getFootnoteBeginRow ( ) == - 1 ) tc . setFootnoteBeginRow ( tc . getRows ( ) . size ( ) ) ; }
Finds the first line of the potential table footnote
20,257
private void determineFootnoteHeading ( TableCandidate tc ) { int maxColumnNum = 0 ; for ( int i = 0 ; i < tc . getFootnoteBeginRow ( ) ; i ++ ) { TableRow row = tc . getRows ( ) . get ( i ) ; if ( row . getCells ( ) . size ( ) > maxColumnNum ) { maxColumnNum = row . getCells ( ) . size ( ) ; } } tc . setMaxColumnNumber ( maxColumnNum ) ; int headingLineNumber = 0 ; for ( int i = 0 ; i < tc . getFootnoteBeginRow ( ) ; i ++ ) { TableRow row = tc . getRows ( ) . get ( i ) ; if ( row . getCells ( ) . size ( ) < maxColumnNum ) { headingLineNumber ++ ; } else break ; } if ( headingLineNumber > 0 ) headingLineNumber -- ; tc . setHeadingLineNumber ( Math . max ( 0 , headingLineNumber ) ) ; }
Adjusts the table heading rows and footnote rows
20,258
public void getTableStructure ( int cc , TableCandidate tc , ArrayList < TextPiece > wordsOfAPage ) { float minGapBtwColumns = 1000.0f ; float [ ] leftX_tableColumns = tc . getLeftX_tableColumns ( ) ; float [ ] rightX_tableColumns = tc . getRightX_tableColumns ( ) ; int YNum = tc . getRows ( ) . size ( ) ; for ( int zz = 1 ; zz < cc ; zz ++ ) { float thisColumnGap = leftX_tableColumns [ zz ] - rightX_tableColumns [ zz - 1 ] ; if ( thisColumnGap < minGapBtwColumns ) minGapBtwColumns = thisColumnGap ; } double columnGapThreshold = 0.0 ; if ( minGapBtwColumns > columnGapThreshold ) { getEachCellContent ( YNum , cc , tc ) ; getRealHeadingBasedOnCells ( YNum , cc , tc ) ; getColumnHeading ( tc ) ; getRowHeadingBasedOnCells ( tc ) ; tc . setMetadataStructureLevel ( YNum , cc , wordsOfAPage , m_docInfo ) ; if ( ( tc . getFootnoteBeginRow ( ) > 1 ) & ( tc . getMaxColumnNumber ( ) > 1 ) ) { } else tc . setValid ( false ) ; } else { m_docInfo . setErrorMsg ( "Although we detected some tabular structures in page " + ( tc . getPageId_thisTable ( ) + 1 ) + ", we do not treat them as tables because the space gaps between columns are not large enough." ) ; } }
Implements the table structure decomposition step
20,259
public void getRealHeadingBasedOnCells ( int YNum , int cc , TableCandidate tc ) { int footnoteLineIndex = tc . getFootnoteBeginRow ( ) ; String [ ] [ ] cells = tc . getCells ( ) ; int i = 0 ; while ( i < footnoteLineIndex ) { int j = 0 , nonNullCellNum = 0 ; while ( j < cc ) { if ( cells [ i ] [ j ] == "" ) { break ; } nonNullCellNum ++ ; j ++ ; } if ( nonNullCellNum == cc ) break ; else i ++ ; } if ( ( i + 1 ) < footnoteLineIndex ) { boolean hasUnitSymbols = false ; int j = 0 ; while ( j < cc ) { if ( ( cells [ i + 1 ] [ j ] . indexOf ( "/yg rnI--" ) > 0 ) || ( cells [ i + 1 ] [ j ] . indexOf ( "(%)" ) > 0 ) || ( cells [ i + 1 ] [ j ] . indexOf ( "w-'" ) > 0 ) || ( cells [ i + 1 ] [ j ] . indexOf ( "CLg g-'" ) > 0 ) || ( cells [ i + 1 ] [ j ] . indexOf ( "pg ml-1" ) >= 0 ) ) { i ++ ; break ; } j ++ ; } } if ( i == YNum ) i = 0 ; if ( i > 0 ) i -- ; tc . setHeadingLineNumber ( i ) ; }
Adjusts the real table heading rows based on the cell information
20,260
public void getColumnHeading ( TableCandidate tc ) { int headings = tc . getHeadingLineNumber ( ) ; String [ ] [ ] cells = tc . getCells ( ) ; String columnHeadings = "" ; for ( int i = 0 ; i <= headings ; i ++ ) { int j = cells [ i ] . length ; for ( int k = 0 ; k < j ; k ++ ) { cells [ i ] [ k ] = tc . replaceAllSpecialChracters ( cells [ i ] [ k ] ) ; columnHeadings = columnHeadings + cells [ i ] [ k ] + "; " ; } columnHeadings = columnHeadings + "\n" ; } tc . setColumnHeadings ( columnHeadings ) ; }
Gets the table column headings
20,261
private void addEvents ( String sentence ) { String [ ] parts = sentence . split ( " " ) ; String outcome = NameFinderME . OTHER ; List toks = new ArrayList ( ) ; List outcomes = new ArrayList ( ) ; for ( int pi = 0 , pl = parts . length ; pi < pl ; pi ++ ) { if ( parts [ pi ] . equals ( "<START>" ) ) { outcome = NameFinderME . START ; } else if ( parts [ pi ] . equals ( "<END>" ) ) { outcome = NameFinderME . OTHER ; } else { toks . add ( parts [ pi ] ) ; outcomes . add ( outcome ) ; if ( outcome . equals ( NameFinderME . START ) ) { outcome = NameFinderME . CONTINUE ; } } } events = new Event [ toks . size ( ) ] ; for ( int ti = 0 , tl = toks . size ( ) ; ti < tl ; ti ++ ) { events [ ti ] = new Event ( ( String ) outcomes . get ( ti ) , cg . getContext ( ti , toks , outcomes , prevTags ) ) ; } for ( int ti = 0 , tl = toks . size ( ) ; ti < tl ; ti ++ ) { prevTags . put ( toks . get ( ti ) , outcomes . get ( ti ) ) ; } }
Adds name events for the specified sentence .
20,262
public java . util . List < ObjectId > getObjectId ( ) { if ( objectId == null ) { objectId = new ArrayList < ObjectId > ( ) ; } return this . objectId ; }
Gets the value of the objectId property .
20,263
public java . util . List < Caption > getCaption ( ) { if ( caption == null ) { caption = new ArrayList < Caption > ( ) ; } return this . caption ; }
Gets the value of the caption property .
20,264
public java . util . List < Object > getAltTextOrLongDescOrEmail ( ) { if ( altTextOrLongDescOrEmail == null ) { altTextOrLongDescOrEmail = new ArrayList < Object > ( ) ; } return this . altTextOrLongDescOrEmail ; }
Gets the value of the altTextOrLongDescOrEmail property .
20,265
public java . util . List < Object > getDispFormulaOrDispFormulaGroupOrChemStructWrap ( ) { if ( dispFormulaOrDispFormulaGroupOrChemStructWrap == null ) { dispFormulaOrDispFormulaGroupOrChemStructWrap = new ArrayList < Object > ( ) ; } return this . dispFormulaOrDispFormulaGroupOrChemStructWrap ; }
Gets the value of the dispFormulaOrDispFormulaGroupOrChemStructWrap property .
20,266
public java . util . List < Object > getAttribOrPermissions ( ) { if ( attribOrPermissions == null ) { attribOrPermissions = new ArrayList < Object > ( ) ; } return this . attribOrPermissions ; }
Gets the value of the attribOrPermissions property .
20,267
public Constituent getParent ( ) { if ( Constituent_Type . featOkTst && ( ( Constituent_Type ) jcasType ) . casFeat_parent == null ) jcasType . jcas . throwFeatMissing ( "parent" , "de.julielab.jules.types.Constituent" ) ; return ( Constituent ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Constituent_Type ) jcasType ) . casFeatCode_parent ) ) ) ; }
getter for parent - gets The parent in a constituency tree C
20,268
public void setParent ( Constituent v ) { if ( Constituent_Type . featOkTst && ( ( Constituent_Type ) jcasType ) . casFeat_parent == null ) jcasType . jcas . throwFeatMissing ( "parent" , "de.julielab.jules.types.Constituent" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Constituent_Type ) jcasType ) . casFeatCode_parent , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for parent - sets The parent in a constituency tree C
20,269
public boolean hasNextQuery ( ) { for ( int i = 0 ; i < innerLearners . length ; i ++ ) { if ( innerLearners [ i ] . hasNextQuery ( ) ) return true ; } return comboHasNextQuery ( ) ; }
See if someone has a query
20,270
public DistanceInstance nextQuery ( ) { ArrayList indices = new ArrayList ( innerLearners . length + 1 ) ; for ( int i = 0 ; i < indices . size ( ) ; i ++ ) indices . set ( i , new Integer ( i ) ) ; Collections . shuffle ( indices ) ; for ( int i = 0 ; i < indices . size ( ) ; i ++ ) { int k = ( ( Integer ) indices . get ( i ) ) . intValue ( ) ; if ( k == innerLearners . length && comboHasNextQuery ( ) ) { return comboNextQuery ( ) ; } else if ( innerLearners [ k ] . hasNextQuery ( ) ) { return innerLearners [ k ] . nextQuery ( ) ; } } throw new IllegalStateException ( "someone seems to have forgotten they want a query" ) ; }
Get a next query from one of the sublearners
20,271
public void addExample ( DistanceInstance answeredQuery ) { MyMultiDistanceInstance di = asMultiDistanceInstance ( answeredQuery ) ; for ( int i = 0 ; i < innerLearners . length ; i ++ ) { innerLearners [ i ] . addExample ( di . get ( i ) ) ; } comboAddExample ( di ) ; }
Pass new labels to the sublearners .
20,272
public StringWrapperIterator prepare ( StringWrapperIterator it ) { List multiWrappers = asMultiStringWrapperList ( it ) ; if ( multiWrappers . size ( ) == 0 ) return new BasicStringWrapperIterator ( Collections . EMPTY_SET . iterator ( ) ) ; MultiStringWrapper prototype = ( MultiStringWrapper ) multiWrappers . get ( 0 ) ; for ( int i = 0 ; i < prototype . size ( ) ; i ++ ) { int j = prototype . getDistanceLearnerIndex ( i ) ; StringDistanceLearner learner = innerLearners [ j ] ; StringWrapperIterator prepped = learner . prepare ( new JthStringWrapperValueIterator ( j , multiWrappers . iterator ( ) ) ) ; for ( int k = 0 ; k < multiWrappers . size ( ) ; k ++ ) { MultiStringWrapper msw = ( MultiStringWrapper ) multiWrappers . get ( k ) ; StringWrapper w = prepped . nextStringWrapper ( ) ; msw . set ( i , w ) ; } } return new BasicStringWrapperIterator ( multiWrappers . iterator ( ) ) ; }
Prepare data for the sublearners .
20,273
public DistanceInstanceIterator prepare ( DistanceInstanceIterator it ) { List multiDistances = asMultiDistanceInstanceList ( it ) ; return new BasicDistanceInstanceIterator ( multiDistances . iterator ( ) ) ; }
Prepare data for the learners .
20,274
private StringWrapper prepareForLearner ( StringWrapper w , StringDistanceLearner learner ) { StringWrapperIterator it = new BasicStringWrapperIterator ( Collections . singleton ( w ) . iterator ( ) ) ; return learner . prepare ( it ) . nextStringWrapper ( ) ; }
Prepare a single StringWrapper for a learner
20,275
protected StringDistance [ ] getInnerDistances ( ) { StringDistance [ ] innerDistances = new StringDistance [ innerLearners . length ] ; for ( int j = 0 ; j < innerLearners . length ; j ++ ) { innerDistances [ j ] = innerLearners [ j ] . getDistance ( ) ; } return innerDistances ; }
Get an array of trained inner distances .
20,276
public String getOntologyId ( ) { if ( Developmental_Type . featOkTst && ( ( Developmental_Type ) jcasType ) . casFeat_ontologyId == null ) jcasType . jcas . throwFeatMissing ( "ontologyId" , "neuroner.NeuroNER.Developmental" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Developmental_Type ) jcasType ) . casFeatCode_ontologyId ) ; }
getter for ontologyId - gets ontologyId
20,277
private static void showUsage ( ) { System . out . println ( "BatchExtractor <pdf-dir-path> <output-dir-path> <parser>" ) ; System . out . println ( "BatchExtractor <pdf-dir-path> <output-dir-path> <parser> --debug" ) ; System . out . println ( "BatchExtractor <pdf-dir-path> <output-dir-path> <parser> --small" ) ; System . out . println ( "\tparser= pdfbox | tet" ) ; }
Shows usages by displaying the information on the screen such as the PDF path output path the PDF parser process mode etc .
20,278
public List < java . lang . Object > getYearOrMonthOrDayOrSeasonOrMedlineDate ( ) { if ( yearOrMonthOrDayOrSeasonOrMedlineDate == null ) { yearOrMonthOrDayOrSeasonOrMedlineDate = new ArrayList < java . lang . Object > ( ) ; } return this . yearOrMonthOrDayOrSeasonOrMedlineDate ; }
Gets the value of the yearOrMonthOrDayOrSeasonOrMedlineDate property .
20,279
public NGram createNGram ( List words ) { int [ ] nums = new int [ words . size ( ) ] ; for ( int wi = 0 ; wi < nums . length ; wi ++ ) { nums [ wi ] = wordMap . getIndex ( words . get ( wi ) ) ; if ( nums [ wi ] == - 1 ) { return null ; } } return new NGram ( nums ) ; }
Creates a new n - gram for the specified list of words .
20,280
private static boolean shouldDehyphenate ( String w1 , String w2 ) { boolean dehyphenate = true ; String rule = "DH" ; if ( w1 . length ( ) <= 1 ) { dehyphenate = false ; rule = "N11" ; } else if ( w2 . length ( ) <= 1 ) { dehyphenate = false ; rule = "N12" ; } else if ( numberEnd . matcher ( w1 ) . find ( ) ) { dehyphenate = false ; rule = "N21" ; } else if ( numberStart . matcher ( w2 ) . find ( ) ) { dehyphenate = false ; rule = "N22" ; } else if ( greekEnd . matcher ( w1 ) . find ( ) ) { dehyphenate = false ; rule = "N31" ; } else if ( greekStart . matcher ( w2 ) . find ( ) ) { dehyphenate = false ; rule = "N32" ; } if ( dehyphenate ) { String word = w1 . substring ( 0 , w1 . length ( ) - 1 ) + w2 ; LOG . debug ( "\"" + w1 + "\",\"" + w2 + "\",\"" + rule + "\",\"" + word + "\"\n" ) ; } else { LOG . debug ( "\"" + w1 + "\",\"" + w2 + "\",\"" + rule + "\",\"" + w1 + w2 + "\"\n" ) ; } return dehyphenate ; }
Decides whether a word should be dehyphenated
20,281
public < R > void visit ( String key , Visitor < T , R > visitor ) { if ( root != null ) { visit ( key , visitor , null , root ) ; } }
visit the node those key matches the given key
20,282
private < R > void visit ( String prefix , Visitor < T , R > visitor , RadixTreeNode < T > parent , RadixTreeNode < T > node ) { int numberOfMatchingCharacters = node . getNumberOfMatchingCharacters ( prefix ) ; if ( numberOfMatchingCharacters == prefix . length ( ) && numberOfMatchingCharacters == node . getKey ( ) . length ( ) ) { visitor . visit ( prefix , parent , node ) ; } else if ( node . getKey ( ) . equals ( "" ) == true || ( numberOfMatchingCharacters < prefix . length ( ) && numberOfMatchingCharacters >= node . getKey ( ) . length ( ) ) ) { String newText = prefix . substring ( numberOfMatchingCharacters , prefix . length ( ) ) ; for ( RadixTreeNode < T > child : node . getChildern ( ) ) { if ( child . getKey ( ) . startsWith ( newText . charAt ( 0 ) + "" ) ) { visit ( newText , visitor , node , child ) ; break ; } } } }
recursively visit the tree based on the supplied key . calls the Visitor for the node those key matches the given prefix
20,283
private void formatNodeTo ( Formatter f , int level , RadixTreeNode < T > node ) { for ( int i = 0 ; i < level ; i ++ ) { f . format ( " " ) ; } f . format ( "|" ) ; for ( int i = 0 ; i < level ; i ++ ) { f . format ( "-" ) ; } if ( node . isReal ( ) == true ) f . format ( "%s[%s]*%n" , node . getKey ( ) , node . getValue ( ) ) ; else f . format ( "%s%n" , node . getKey ( ) ) ; for ( RadixTreeNode < T > child : node . getChildern ( ) ) { formatNodeTo ( f , level + 1 , child ) ; } }
WARNING! Do not use this for a large Trie it s for testing purpose only .
20,284
public void formatTo ( Formatter formatter , int flags , int width , int precision ) { formatNodeTo ( formatter , 0 , root ) ; }
Writes a textual representation of this tree to the given formatter .
20,285
private ValueUnitWrapper normalizeSpecialCases ( double value , String unit ) throws UnknownUnitException { if ( unit . equals ( "mol/dm3" ) ) { return new ValueUnitWrapper ( value , MOLAR_NORMALIZED_UNIT ) ; } else { throw new UnknownUnitException ( unit ) ; } }
deals with the normalization of special cases
20,286
private ValueUnitWrapper normalizeMassUnit ( final double value , final String unit ) throws UnknownUnitException { Matcher matcher = mMassUnitPatter . matcher ( unit ) ; if ( matcher . find ( ) ) { double normalizationFactor = 1.0 ; String numeratorSIPrefix = matcher . group ( 1 ) ; Double numeratorFactor = getSIFactor ( numeratorSIPrefix ) ; if ( numeratorFactor != null ) { normalizationFactor *= numeratorFactor ; } String denominatorSIPrefix = matcher . group ( 3 ) ; String denominatorUnit = matcher . group ( 4 ) ; Double denominatorFactor = getSIFactor ( denominatorSIPrefix ) ; if ( denominatorFactor != null ) { int power = ( denominatorUnit . endsWith ( "3" ) ) ? 3 : 1 ; normalizationFactor /= Math . pow ( denominatorFactor , power ) ; } if ( denominatorUnit . equals ( "l" ) || denominatorUnit . equals ( "L" ) ) { normalizationFactor *= 1000 ; } assert mSIPrefixes . get ( "kilo" ) != null : "kilo seems not to be in the table !" ; double normalizedValue = ( normalizationFactor * value ) / mSIPrefixes . get ( "kilo" ) ; return new ValueUnitWrapper ( normalizedValue , MASS_NORMALIZED_UNIT ) ; } else { throw new UnknownUnitException ( unit ) ; } }
deals with the normalization of unit confronting weight and volume
20,287
private ValueUnitWrapper normalizeMolarUnit ( final double value , final String unit ) throws UnknownUnitException { Matcher matcher = mMolarUnitPattern . matcher ( unit ) ; if ( matcher . find ( ) ) { String siPrefix = matcher . group ( 1 ) ; Double convFactor = getSIFactor ( siPrefix ) ; if ( convFactor == null ) { throw new UnknownUnitException ( unit ) ; } else { double normalizedValue = convFactor * value ; return new ValueUnitWrapper ( normalizedValue , MOLAR_NORMALIZED_UNIT ) ; } } else { throw new UnknownUnitException ( unit ) ; } }
deals with normalization of measure of molarity
20,288
public StringArray getTokens ( ) { if ( FeatureTokens_Type . featOkTst && ( ( FeatureTokens_Type ) jcasType ) . casFeat_tokens == null ) jcasType . jcas . throwFeatMissing ( "tokens" , "ch.epfl.bbp.uima.types.FeatureTokens" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . casFeatCode_tokens ) ) ) ; }
getter for tokens - gets
20,289
public void setTokens ( StringArray v ) { if ( FeatureTokens_Type . featOkTst && ( ( FeatureTokens_Type ) jcasType ) . casFeat_tokens == null ) jcasType . jcas . throwFeatMissing ( "tokens" , "ch.epfl.bbp.uima.types.FeatureTokens" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . casFeatCode_tokens , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for tokens - sets
20,290
public String getTokens ( int i ) { if ( FeatureTokens_Type . featOkTst && ( ( FeatureTokens_Type ) jcasType ) . casFeat_tokens == null ) jcasType . jcas . throwFeatMissing ( "tokens" , "ch.epfl.bbp.uima.types.FeatureTokens" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . casFeatCode_tokens ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . casFeatCode_tokens ) , i ) ; }
indexed getter for tokens - gets an indexed value -
20,291
public void setTokens ( int i , String v ) { if ( FeatureTokens_Type . featOkTst && ( ( FeatureTokens_Type ) jcasType ) . casFeat_tokens == null ) jcasType . jcas . throwFeatMissing ( "tokens" , "ch.epfl.bbp.uima.types.FeatureTokens" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . casFeatCode_tokens ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . casFeatCode_tokens ) , i , v ) ; }
indexed setter for tokens - sets an indexed value -
20,292
public String getDictCanon ( ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_DictCanon == null ) jcasType . jcas . throwFeatMissing ( "DictCanon" , "org.apache.uima.conceptMapper.DictTerm" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_DictCanon ) ; }
getter for DictCanon - gets canonical form
20,293
public void setDictCanon ( String v ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_DictCanon == null ) jcasType . jcas . throwFeatMissing ( "DictCanon" , "org.apache.uima.conceptMapper.DictTerm" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_DictCanon , v ) ; }
setter for DictCanon - sets canonical form
20,294
public void setMatchedTokens ( FSArray v ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_matchedTokens == null ) jcasType . jcas . throwFeatMissing ( "matchedTokens" , "org.apache.uima.conceptMapper.DictTerm" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_matchedTokens , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for matchedTokens - sets
20,295
public TOP getMatchedTokens ( int i ) { if ( DictTerm_Type . featOkTst && ( ( DictTerm_Type ) jcasType ) . casFeat_matchedTokens == null ) jcasType . jcas . throwFeatMissing ( "matchedTokens" , "org.apache.uima.conceptMapper.DictTerm" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_matchedTokens ) , i ) ; return ( TOP ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( DictTerm_Type ) jcasType ) . casFeatCode_matchedTokens ) , i ) ) ) ; }
indexed getter for matchedTokens - gets an indexed value -
20,296
public void setCount ( Object o , int c ) { int [ ] nums = ( int [ ] ) cset . get ( o ) ; if ( nums != null ) { nums [ 0 ] = c ; } else { cset . put ( o , new int [ ] { c , 1 } ) ; } }
Assigns the specified object the specified count in the set .
20,297
protected Context [ ] getParameters ( int [ ] [ ] outcomePatterns ) throws java . io . IOException { Context [ ] params = new Context [ NUM_PREDS ] ; int pid = 0 ; for ( int i = 0 ; i < outcomePatterns . length ; i ++ ) { int [ ] outcomePattern = new int [ outcomePatterns [ i ] . length - 1 ] ; for ( int k = 1 ; k < outcomePatterns [ i ] . length ; k ++ ) { outcomePattern [ k - 1 ] = outcomePatterns [ i ] [ k ] ; } for ( int j = 0 ; j < outcomePatterns [ i ] [ 0 ] ; j ++ ) { double [ ] contextParameters = new double [ outcomePatterns [ i ] . length - 1 ] ; for ( int k = 1 ; k < outcomePatterns [ i ] . length ; k ++ ) { contextParameters [ k - 1 ] = readDouble ( ) ; } params [ pid ] = new Context ( outcomePattern , contextParameters ) ; pid ++ ; } } return params ; }
Reads the parameters from a file and populates an array of context objects .
20,298
public Annotation getEnclosingAnnot ( ) { if ( TopicToken_Type . featOkTst && ( ( TopicToken_Type ) jcasType ) . casFeat_enclosingAnnot == null ) jcasType . jcas . throwFeatMissing ( "enclosingAnnot" , "ch.epfl.bbp.uima.types.TopicToken" ) ; return ( Annotation ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( TopicToken_Type ) jcasType ) . casFeatCode_enclosingAnnot ) ) ) ; }
getter for enclosingAnnot - gets
20,299
public void setEnclosingAnnot ( Annotation v ) { if ( TopicToken_Type . featOkTst && ( ( TopicToken_Type ) jcasType ) . casFeat_enclosingAnnot == null ) jcasType . jcas . throwFeatMissing ( "enclosingAnnot" , "ch.epfl.bbp.uima.types.TopicToken" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( TopicToken_Type ) jcasType ) . casFeatCode_enclosingAnnot , jcasType . ll_cas . ll_getFSRef ( v ) ) ; }
setter for enclosingAnnot - sets