idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
20,400 | 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 . |
20,401 | 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 . |
20,402 | 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 . |
20,403 | public String getNameForID ( String id ) { if ( ! terms . containsKey ( id ) ) return null ; return terms . get ( id ) . getName ( ) ; } | Looks up the name for an ontology ID . |
20,404 | public String getDefinitionForID ( String id ) { if ( ! terms . containsKey ( id ) ) return null ; return terms . get ( id ) . getDef ( ) ; } | Looks up the definition for an ontology ID . |
20,405 | 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 |
20,406 | 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 |
20,407 | 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 |
20,408 | 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 |
20,409 | 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 |
20,410 | 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 |
20,411 | 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 |
20,412 | private static void addFullTextPipes ( List < String > usedPipeNames , List < Pipe > pipes ) { pipes . add ( new LongRegexSpaced ( "digit_then_other_then_digit" , Pattern . compile ( "\\d+[^\\d]+\\d+" ) , 2 , 4 ) ) ; pipes . add ( new LongRegexSpaced ( "digit_then_other_then_digit_then_other_then_digit" , Pattern . compile ( ".*\\d+[^\\d\\n]+\\d+[^\\d\\n]+\\d+.*" ) , 4 , 9 ) ) ; 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 ) ) ; pipes . add ( new RegexMatches ( "Figure" , Pattern . compile ( ".*Fig.*" ) ) ) ; } | Pipes added based on experience with full text |
20,413 | 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 |
20,414 | 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 |
20,415 | 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 |
20,416 | 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 |
20,417 | 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 |
20,418 | 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 |
20,419 | private Templates getTemplates ( String 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 . |
20,420 | 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 ) { } try { os . close ( ) ; } catch ( IOException e ) { } } } | Writes a resource file to disk . The resource file is looked up in the classpath |
20,421 | public static String autoGenerateStyleMap ( AnalysisEngineMetaData aTaeMetaData ) { 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;" } ; 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 ( ) ) ; } } } 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 . |
20,422 | public static String autoGenerateStyleMap ( TypeSystemDescription aTypeSystem ) { 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 ( ) ; 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 . |
20,423 | 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 . |
20,424 | 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 . |
20,425 | private void addCapabilities ( CollectionReaderDescription crd ) { for ( Capability capability : crd . getCollectionReaderMetaData ( ) . getCapabilities ( ) ) { for ( TypeOrFeature output : capability . getOutputs ( ) ) { outputTypes . add ( output . getName ( ) ) ; } } } | Add this crd s capabilities for other downstream aeds . |
20,426 | 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 ( ) ) { outputTypes . add ( output . getName ( ) ) ; } } } | Checks that this |
20,427 | 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 . |
20,428 | 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 . |
20,429 | 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 . |
20,430 | 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 . |
20,431 | 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 . |
20,432 | 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 . |
20,433 | 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 . |
20,434 | 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 . |
20,435 | private double [ ] getIDFArray ( BagOfTokens bag ) { double [ ] idfArray = new double [ bag . size ( ) ] ; Iterator it = bag . tokenIterator ( ) ; int i = 0 ; while ( it . hasNext ( ) ) { Token tok = ( Token ) it . next ( ) ; idfArray [ i ] = bag . getWeight ( tok ) ; i ++ ; } return idfArray ; } | getIDFArray normalize a vector of IDF weights . |
20,436 | private double algorithm1 ( String [ ] tTokens , String [ ] uTokens , double [ ] tIdfArray , double [ ] uIdfArray ) { ArrayList candidateList = obtainCandidateList ( tTokens , uTokens , tIdfArray , uIdfArray ) ; sortCandidateList ( candidateList ) ; double scoreValue = 0.0 ; HashMap tMap = new HashMap ( ) , uMap = new HashMap ( ) ; Iterator it = candidateList . iterator ( ) ; while ( it . hasNext ( ) ) { Candidates actualCandidates = ( Candidates ) it . next ( ) ; Integer tPos = new Integer ( actualCandidates . getTPos ( ) ) ; Integer uPos = new Integer ( actualCandidates . getUPos ( ) ) ; if ( ( ! tMap . containsKey ( tPos ) ) && ( ! uMap . containsKey ( uPos ) ) ) { double actualScore = actualCandidates . getScore ( ) ; scoreValue += actualScore ; tMap . put ( tPos , null ) ; uMap . put ( uPos , null ) ; } } return scoreValue ; } | algorithm1 select the considered most appropiate token pairs and compute the sum of the selected pairs . |
20,437 | private ArrayList obtainCandidateList ( String [ ] tTokens , String [ ] uTokens , double [ ] tIdfArray , double [ ] uIdfArray ) { ArrayList candidateList = new ArrayList ( ) ; double minStringSize = getMinStringSize ( tTokens , uTokens ) ; for ( int t = 0 ; t < tTokens . length ; t ++ ) { int lastTr = - 1 ; for ( int u = 0 , flag = 0 ; u < uTokens . length && flag == 0 ; u ++ ) { int tr = Math . abs ( t - u ) ; if ( lastTr >= 0 && lastTr < tr ) { flag = 1 ; } else { String tTok = tTokens [ t ] , uTok = uTokens [ u ] ; double innerScore = tokenDistance . score ( tTok , uTok ) ; if ( innerScore >= 0.0 ) { double matched = 0.0 ; if ( innerScore == 1.0 ) { matched = tTokens [ t ] . length ( ) ; } else { matched = ( ( TagLinkToken ) tokenDistance ) . getMatched ( ) ; } double weightMatched = matched / minStringSize , weightTFIDF = tIdfArray [ t ] * uIdfArray [ u ] , weight = ( weightTFIDF + weightMatched ) / 2.0 ; if ( innerScore == 1 ) { lastTr = tr ; } candidateList . add ( new Candidates ( t , u , innerScore * weight ) ) ; } } } } return candidateList ; } | obtainCandidateList set a candidate list of pair of tokens . Sometimes it will not compute all candidate pairs in oder to reduce the computational cost . |
20,438 | private void sortCandidateList ( ArrayList list ) { java . util . Collections . sort ( list , new java . util . Comparator ( ) { public int compare ( Object o1 , Object o2 ) { double scoreT = ( ( Candidates ) o1 ) . getScore ( ) , scoreU = ( ( Candidates ) o2 ) . getScore ( ) ; if ( scoreU > scoreT ) { return 1 ; } if ( scoreU < scoreT ) { return - 1 ; } return 0 ; } } ) ; } | sortCandidateList sort a list of candidate pair of tokens . |
20,439 | private double round ( double number ) { int round = ( int ) ( number * 1000.00 ) ; double rest = ( number * 1000.00 ) - round ; if ( rest >= 0.5 ) { round ++ ; } return ( round / 1000.00 ) ; } | round a double number . |
20,440 | SourcedToken getEquivalentToken ( Token tok ) { if ( unsourcedTokens . contains ( tok . getValue ( ) ) ) { for ( int i = 0 ; i < tokens . length ; i ++ ) { if ( tokens [ i ] . getValue ( ) . equals ( tok . getValue ( ) ) ) { return tokens [ i ] ; } } System . out . println ( "This is a problem" ) ; return null ; } else { return null ; } } | Test if this token appears at least once . |
20,441 | public FSArray getArguments ( ) { if ( Relation_Type . featOkTst && ( ( Relation_Type ) jcasType ) . casFeat_arguments == null ) jcasType . jcas . throwFeatMissing ( "arguments" , "de.julielab.jules.types.ace.Relation" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Relation_Type ) jcasType ) . casFeatCode_arguments ) ) ) ; } | getter for arguments - gets |
20,442 | public String getEntryId ( ) { if ( ResourceEntry_Type . featOkTst && ( ( ResourceEntry_Type ) jcasType ) . casFeat_entryId == null ) jcasType . jcas . throwFeatMissing ( "entryId" , "de.julielab.jules.types.ResourceEntry" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ResourceEntry_Type ) jcasType ) . casFeatCode_entryId ) ; } | getter for entryId - gets The identifier of the entry C |
20,443 | public void setEntryId ( String v ) { if ( ResourceEntry_Type . featOkTst && ( ( ResourceEntry_Type ) jcasType ) . casFeat_entryId == null ) jcasType . jcas . throwFeatMissing ( "entryId" , "de.julielab.jules.types.ResourceEntry" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( ResourceEntry_Type ) jcasType ) . casFeatCode_entryId , v ) ; } | setter for entryId - sets The identifier of the entry C |
20,444 | public String getVersion ( ) { if ( ResourceEntry_Type . featOkTst && ( ( ResourceEntry_Type ) jcasType ) . casFeat_version == null ) jcasType . jcas . throwFeatMissing ( "version" , "de.julielab.jules.types.ResourceEntry" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( ResourceEntry_Type ) jcasType ) . casFeatCode_version ) ; } | getter for version - gets The version of the resource C |
20,445 | public void setVersion ( String v ) { if ( ResourceEntry_Type . featOkTst && ( ( ResourceEntry_Type ) jcasType ) . casFeat_version == null ) jcasType . jcas . throwFeatMissing ( "version" , "de.julielab.jules.types.ResourceEntry" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( ResourceEntry_Type ) jcasType ) . casFeatCode_version , v ) ; } | setter for version - sets The version of the resource C |
20,446 | public int getLevel ( ) { if ( ListItem_Type . featOkTst && ( ( ListItem_Type ) jcasType ) . casFeat_level == null ) jcasType . jcas . throwFeatMissing ( "level" , "de.julielab.jules.types.ListItem" ) ; return jcasType . ll_cas . ll_getIntValue ( addr , ( ( ListItem_Type ) jcasType ) . casFeatCode_level ) ; } | getter for level - gets Level of indentation of the list item . |
20,447 | public void setLevel ( int v ) { if ( ListItem_Type . featOkTst && ( ( ListItem_Type ) jcasType ) . casFeat_level == null ) jcasType . jcas . throwFeatMissing ( "level" , "de.julielab.jules.types.ListItem" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( ListItem_Type ) jcasType ) . casFeatCode_level , v ) ; } | setter for level - sets Level of indentation of the list item . |
20,448 | public java . util . List < Object > getListItemOrX ( ) { if ( listItemOrX == null ) { listItemOrX = new ArrayList < Object > ( ) ; } return this . listItemOrX ; } | Gets the value of the listItemOrX property . |
20,449 | public void setPolarity ( String v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_polarity == null ) jcasType . jcas . throwFeatMissing ( "polarity" , "de.julielab.jules.types.ace.Event" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_polarity , v ) ; } | setter for polarity - sets |
20,450 | public String getGenericity ( ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_genericity == null ) jcasType . jcas . throwFeatMissing ( "genericity" , "de.julielab.jules.types.ace.Event" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_genericity ) ; } | getter for genericity - gets |
20,451 | public void setGenericity ( String v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_genericity == null ) jcasType . jcas . throwFeatMissing ( "genericity" , "de.julielab.jules.types.ace.Event" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_genericity , v ) ; } | setter for genericity - sets |
20,452 | public void setMentions ( int i , EventMention v ) { if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_mentions == null ) jcasType . jcas . throwFeatMissing ( "mentions" , "de.julielab.jules.types.ace.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_mentions ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_mentions ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for mentions - sets an indexed value - |
20,453 | public static void printTableMeta ( String outputDirPath , File pdfFile , String meta ) { try { File middleDir = new File ( outputDirPath , "metadata" ) ; if ( ! middleDir . exists ( ) ) { middleDir . mkdirs ( ) ; } File tableMetaFile = new File ( middleDir , pdfFile . getName ( ) + ".metadata" ) ; BufferedWriter bw0 = new BufferedWriter ( new FileWriter ( tableMetaFile ) ) ; bw0 . write ( meta ) ; bw0 . close ( ) ; } catch ( IOException e ) { System . out . printf ( "[Debug Error] IOException\n" ) ; } } | After detecting and extracting a table this method enables us to save the table metadata file locally for later performance evaluation . |
20,454 | public static void printStatInfo ( String outputDirPath , File pdfFile , int pageNum , int tableNum ) { try { File classificationData = new File ( outputDirPath , "statInfo" ) ; if ( ! classificationData . exists ( ) ) { classificationData . mkdirs ( ) ; } File fileName = new File ( classificationData , "tableNumStatInfo.txt" ) ; BufferedWriter bw0 = new BufferedWriter ( new FileWriter ( fileName , true ) ) ; bw0 . append ( outputDirPath + pdfFile . getName ( ) + "\t\t" + pageNum + " PAGES\t\t" + tableNum + " TABLES\n" ) ; bw0 . close ( ) ; } catch ( IOException e ) { System . out . printf ( "[Debug Error] IOException\n" ) ; } } | After processing all the PDF documents this method helps us to get the statistic information of all the PDF documents such as the total number of pages tables etc . |
20,455 | public String getRelatedArticle ( ) { if ( RelatedArticle_Type . featOkTst && ( ( RelatedArticle_Type ) jcasType ) . casFeat_relatedArticle == null ) jcasType . jcas . throwFeatMissing ( "relatedArticle" , "de.julielab.jules.types.RelatedArticle" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( RelatedArticle_Type ) jcasType ) . casFeatCode_relatedArticle ) ; } | getter for relatedArticle - gets |
20,456 | public void setRelatedArticle ( String v ) { if ( RelatedArticle_Type . featOkTst && ( ( RelatedArticle_Type ) jcasType ) . casFeat_relatedArticle == null ) jcasType . jcas . throwFeatMissing ( "relatedArticle" , "de.julielab.jules.types.RelatedArticle" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( RelatedArticle_Type ) jcasType ) . casFeatCode_relatedArticle , v ) ; } | setter for relatedArticle - sets |
20,457 | public FSArray getMeSHList ( ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_meSHList == null ) jcasType . jcas . throwFeatMissing ( "meSHList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_meSHList ) ) ) ; } | getter for meSHList - gets A collection of objects of type uima . julielab . uima . MeSHHeading O |
20,458 | public void setMeSHList ( FSArray v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_meSHList == null ) jcasType . jcas . throwFeatMissing ( "meSHList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_meSHList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for meSHList - sets A collection of objects of type uima . julielab . uima . MeSHHeading O |
20,459 | public MeshHeading getMeSHList ( int i ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_meSHList == null ) jcasType . jcas . throwFeatMissing ( "meSHList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_meSHList ) , i ) ; return ( MeshHeading ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_meSHList ) , i ) ) ) ; } | indexed getter for meSHList - gets an indexed value - A collection of objects of type uima . julielab . uima . MeSHHeading O |
20,460 | public void setMeSHList ( int i , MeshHeading v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_meSHList == null ) jcasType . jcas . throwFeatMissing ( "meSHList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_meSHList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_meSHList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for meSHList - sets an indexed value - A collection of objects of type uima . julielab . uima . MeSHHeading O |
20,461 | public FSArray getChemicalList ( ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_chemicalList == null ) jcasType . jcas . throwFeatMissing ( "chemicalList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_chemicalList ) ) ) ; } | getter for chemicalList - gets A collection of objects of type uima . julielab . uima . Chemical O |
20,462 | public void setChemicalList ( FSArray v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_chemicalList == null ) jcasType . jcas . throwFeatMissing ( "chemicalList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_chemicalList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for chemicalList - sets A collection of objects of type uima . julielab . uima . Chemical O |
20,463 | public Chemical getChemicalList ( int i ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_chemicalList == null ) jcasType . jcas . throwFeatMissing ( "chemicalList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_chemicalList ) , i ) ; return ( Chemical ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_chemicalList ) , i ) ) ) ; } | indexed getter for chemicalList - gets an indexed value - A collection of objects of type uima . julielab . uima . Chemical O |
20,464 | public void setChemicalList ( int i , Chemical v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_chemicalList == null ) jcasType . jcas . throwFeatMissing ( "chemicalList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_chemicalList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_chemicalList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for chemicalList - sets an indexed value - A collection of objects of type uima . julielab . uima . Chemical O |
20,465 | public FSArray getDBInfoList ( ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_dBInfoList == null ) jcasType . jcas . throwFeatMissing ( "dBInfoList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_dBInfoList ) ) ) ; } | getter for dBInfoList - gets A collection of objects of type uima . julielab . uima . DBInfo O |
20,466 | public void setDBInfoList ( FSArray v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_dBInfoList == null ) jcasType . jcas . throwFeatMissing ( "dBInfoList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_dBInfoList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for dBInfoList - sets A collection of objects of type uima . julielab . uima . DBInfo O |
20,467 | public DBInfo getDBInfoList ( int i ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_dBInfoList == null ) jcasType . jcas . throwFeatMissing ( "dBInfoList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_dBInfoList ) , i ) ; return ( DBInfo ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_dBInfoList ) , i ) ) ) ; } | indexed getter for dBInfoList - gets an indexed value - A collection of objects of type uima . julielab . uima . DBInfo O |
20,468 | public void setDBInfoList ( int i , DBInfo v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_dBInfoList == null ) jcasType . jcas . throwFeatMissing ( "dBInfoList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_dBInfoList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_dBInfoList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for dBInfoList - sets an indexed value - A collection of objects of type uima . julielab . uima . DBInfo O |
20,469 | public FSArray getKeywordList ( ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_keywordList == null ) jcasType . jcas . throwFeatMissing ( "keywordList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_keywordList ) ) ) ; } | getter for keywordList - gets A collection of objects of type uima . julielab . uima . Keyword O |
20,470 | public void setKeywordList ( FSArray v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_keywordList == null ) jcasType . jcas . throwFeatMissing ( "keywordList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_keywordList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for keywordList - sets A collection of objects of type uima . julielab . uima . Keyword O |
20,471 | public Keyword getKeywordList ( int i ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_keywordList == null ) jcasType . jcas . throwFeatMissing ( "keywordList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_keywordList ) , i ) ; return ( Keyword ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_keywordList ) , i ) ) ) ; } | indexed getter for keywordList - gets an indexed value - A collection of objects of type uima . julielab . uima . Keyword O |
20,472 | public void setKeywordList ( int i , Keyword v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_keywordList == null ) jcasType . jcas . throwFeatMissing ( "keywordList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_keywordList ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_keywordList ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | indexed setter for keywordList - sets an indexed value - A collection of objects of type uima . julielab . uima . Keyword O |
20,473 | public StringArray getGeneSymbolList ( ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_geneSymbolList == null ) jcasType . jcas . throwFeatMissing ( "geneSymbolList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_geneSymbolList ) ) ) ; } | getter for geneSymbolList - gets GeneSymbolList in PubMed |
20,474 | public void setGeneSymbolList ( StringArray v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_geneSymbolList == null ) jcasType . jcas . throwFeatMissing ( "geneSymbolList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_geneSymbolList , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for geneSymbolList - sets GeneSymbolList in PubMed |
20,475 | public String getGeneSymbolList ( int i ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_geneSymbolList == null ) jcasType . jcas . throwFeatMissing ( "geneSymbolList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_geneSymbolList ) , i ) ; return jcasType . ll_cas . ll_getStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_geneSymbolList ) , i ) ; } | indexed getter for geneSymbolList - gets an indexed value - GeneSymbolList in PubMed |
20,476 | public void setGeneSymbolList ( int i , String v ) { if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_geneSymbolList == null ) jcasType . jcas . throwFeatMissing ( "geneSymbolList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_geneSymbolList ) , i ) ; jcasType . ll_cas . ll_setStringArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_geneSymbolList ) , i , v ) ; } | indexed setter for geneSymbolList - sets an indexed value - GeneSymbolList in PubMed |
20,477 | public Event nextEvent ( ) { while ( _next == null && _ds . hasNext ( ) ) _next = createEvent ( ( String ) _ds . nextToken ( ) ) ; Event current = _next ; if ( _ds . hasNext ( ) ) { _next = createEvent ( ( String ) _ds . nextToken ( ) ) ; } else { _next = null ; } return current ; } | Returns the next Event object held in this EventStream . Each call to nextEvent advances the EventStream . |
20,478 | public boolean hasNext ( ) { while ( _next == null && _ds . hasNext ( ) ) _next = createEvent ( ( String ) _ds . nextToken ( ) ) ; return _next != null ; } | Test whether there are any Events remaining in this EventStream . |
20,479 | public String getTextValue ( ) { if ( BodyCitation_Type . featOkTst && ( ( BodyCitation_Type ) jcasType ) . casFeat_textValue == null ) jcasType . jcas . throwFeatMissing ( "textValue" , "ch.epfl.bbp.uima.types.BodyCitation" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( BodyCitation_Type ) jcasType ) . casFeatCode_textValue ) ; } | getter for textValue - gets |
20,480 | public void setTextValue ( String v ) { if ( BodyCitation_Type . featOkTst && ( ( BodyCitation_Type ) jcasType ) . casFeat_textValue == null ) jcasType . jcas . throwFeatMissing ( "textValue" , "ch.epfl.bbp.uima.types.BodyCitation" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( BodyCitation_Type ) jcasType ) . casFeatCode_textValue , v ) ; } | setter for textValue - sets |
20,481 | public String getCitationStatus ( ) { if ( Header_Type . featOkTst && ( ( Header_Type ) jcasType ) . casFeat_citationStatus == null ) jcasType . jcas . throwFeatMissing ( "citationStatus" , "de.julielab.jules.types.pubmed.Header" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Header_Type ) jcasType ) . casFeatCode_citationStatus ) ; } | getter for citationStatus - gets Indicates the status of citation of a PubMed document O |
20,482 | public void setCitationStatus ( String v ) { if ( Header_Type . featOkTst && ( ( Header_Type ) jcasType ) . casFeat_citationStatus == null ) jcasType . jcas . throwFeatMissing ( "citationStatus" , "de.julielab.jules.types.pubmed.Header" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Header_Type ) jcasType ) . casFeatCode_citationStatus , v ) ; } | setter for citationStatus - sets Indicates the status of citation of a PubMed document O |
20,483 | public Anchor getAnchor ( ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_anchor == null ) jcasType . jcas . throwFeatMissing ( "anchor" , "de.julielab.jules.types.ace.EventMention" ) ; return ( Anchor ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_anchor ) ) ) ; } | getter for anchor - gets |
20,484 | public void setAnchor ( Anchor v ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_anchor == null ) jcasType . jcas . throwFeatMissing ( "anchor" , "de.julielab.jules.types.ace.EventMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_anchor , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for anchor - sets |
20,485 | public String getLevel ( ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_level == null ) jcasType . jcas . throwFeatMissing ( "level" , "de.julielab.jules.types.ace.EventMention" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_level ) ; } | getter for level - gets |
20,486 | public void setLevel ( String v ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_level == null ) jcasType . jcas . throwFeatMissing ( "level" , "de.julielab.jules.types.ace.EventMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_level , v ) ; } | setter for level - sets |
20,487 | public LDC_Scope getLdc_scope ( ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_ldc_scope == null ) jcasType . jcas . throwFeatMissing ( "ldc_scope" , "de.julielab.jules.types.ace.EventMention" ) ; return ( LDC_Scope ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_ldc_scope ) ) ) ; } | getter for ldc_scope - gets |
20,488 | public void setLdc_scope ( LDC_Scope v ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_ldc_scope == null ) jcasType . jcas . throwFeatMissing ( "ldc_scope" , "de.julielab.jules.types.ace.EventMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_ldc_scope , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for ldc_scope - sets |
20,489 | public Event getEvent_ref ( ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_event_ref == null ) jcasType . jcas . throwFeatMissing ( "event_ref" , "de.julielab.jules.types.ace.EventMention" ) ; return ( Event ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_event_ref ) ) ) ; } | getter for event_ref - gets |
20,490 | public void setEvent_ref ( Event v ) { if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_event_ref == null ) jcasType . jcas . throwFeatMissing ( "event_ref" , "de.julielab.jules.types.ace.EventMention" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_event_ref , jcasType . ll_cas . ll_getFSRef ( v ) ) ; } | setter for event_ref - sets |
20,491 | public static void fixNoSentences ( JCas jCas ) { Collection < Sentence > sentences = select ( jCas , Sentence . class ) ; if ( sentences . size ( ) == 0 ) { String text = jCas . getDocumentText ( ) ; Sentence sentence = new Sentence ( jCas , 0 , text . length ( ) ) ; sentence . addToIndexes ( ) ; } } | If this cas has no Sentence annotation creates one with the whole cas text |
20,492 | public String getSyn ( ) { if ( GENIAConstituent_Type . featOkTst && ( ( GENIAConstituent_Type ) jcasType ) . casFeat_syn == null ) jcasType . jcas . throwFeatMissing ( "syn" , "de.julielab.jules.types.GENIAConstituent" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( GENIAConstituent_Type ) jcasType ) . casFeatCode_syn ) ; } | getter for syn - gets Marks coordinations O |
20,493 | public void setSyn ( String v ) { if ( GENIAConstituent_Type . featOkTst && ( ( GENIAConstituent_Type ) jcasType ) . casFeat_syn == null ) jcasType . jcas . throwFeatMissing ( "syn" , "de.julielab.jules.types.GENIAConstituent" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( GENIAConstituent_Type ) jcasType ) . casFeatCode_syn , v ) ; } | setter for syn - sets Marks coordinations O |
20,494 | public void writeInferredDistributions ( InstanceList instances , File distributionsFile , int numIterations , int thinning , int burnIn , double threshold , int max ) throws IOException { PrintWriter out = new PrintWriter ( distributionsFile ) ; out . print ( "#doc source topic proportion ...\n" ) ; IDSorter [ ] sortedTopics = new IDSorter [ numTopics ] ; for ( int topic = 0 ; topic < numTopics ; topic ++ ) { sortedTopics [ topic ] = new IDSorter ( topic , topic ) ; } if ( max < 0 || max > numTopics ) { max = numTopics ; } int doc = 0 ; for ( Instance instance : instances ) { double [ ] topicDistribution = getSampledDistribution ( instance , numIterations , thinning , burnIn ) ; out . print ( doc ) ; out . print ( ' ' ) ; if ( instance . getSource ( ) != null ) { out . print ( instance . getSource ( ) ) ; } else { out . print ( "null-source" ) ; } out . print ( ' ' ) ; for ( int topic = 0 ; topic < numTopics ; topic ++ ) { sortedTopics [ topic ] . set ( topic , topicDistribution [ topic ] ) ; } Arrays . sort ( sortedTopics ) ; for ( int i = 0 ; i < max ; i ++ ) { if ( sortedTopics [ i ] . getWeight ( ) < threshold ) { break ; } out . print ( sortedTopics [ i ] . getID ( ) + " " + sortedTopics [ i ] . getWeight ( ) + " " ) ; } out . print ( " \n" ) ; doc ++ ; } out . close ( ) ; } | Infer topics for the provided instances and write distributions to the provided file . |
20,495 | public String getAuthor ( ) { if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_author == null ) jcasType . jcas . throwFeatMissing ( "author" , "de.julielab.jules.types.ace.SourceFile" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_author ) ; } | getter for author - gets |
20,496 | public void setAuthor ( String v ) { if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_author == null ) jcasType . jcas . throwFeatMissing ( "author" , "de.julielab.jules.types.ace.SourceFile" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_author , v ) ; } | setter for author - sets |
20,497 | public void setUri ( String v ) { if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_uri == null ) jcasType . jcas . throwFeatMissing ( "uri" , "de.julielab.jules.types.ace.SourceFile" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_uri , v ) ; } | setter for uri - sets |
20,498 | public String getEncoding ( ) { if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_encoding == null ) jcasType . jcas . throwFeatMissing ( "encoding" , "de.julielab.jules.types.ace.SourceFile" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_encoding ) ; } | getter for encoding - gets |
20,499 | public void setEncoding ( String v ) { if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_encoding == null ) jcasType . jcas . throwFeatMissing ( "encoding" , "de.julielab.jules.types.ace.SourceFile" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_encoding , v ) ; } | setter for encoding - sets |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.