public char match ( ISense source , ISense target ) throws MatcherLibraryException { String sSynset = source . getGloss ( ) ; String tSynset = target . getGloss ( ) ; StringTokenizer stSource = new StringTokenizer ( sSynset , " ,.\"'();" ) ; StringTokenizer stTarget = new StringTokenizer ( tSynset , " ,.\"'();" ) ; String lemma ; int counter = 0 ; while ( stSource . hasMoreTokens ( ) ) { lemma = stSource . nextToken ( ) ; if ( ! meaninglessWords . contains ( lemma ) ) { List < String > lemmas = target . getLemmas ( ) ; for ( String lemmaToCompare : lemmas ) { if ( lemma . equals ( lemmaToCompare ) ) { counter ++ ; } } } } if ( counter >= threshold ) { return IMappingElement . LESS_GENERAL ; } while ( stTarget . hasMoreTokens ( ) ) { lemma = stTarget . nextToken ( ) ; if ( ! meaninglessWords . contains ( lemma ) ) { List < String > lemmas = source . getLemmas ( ) ; for ( String lemmaToCompare : lemmas ) { if ( lemma . equals ( lemmaToCompare ) ) { counter ++ ; } } } } if ( counter >= threshold ) { return IMappingElement . MORE_GENERAL ; } return IMappingElement . IDK ; }
Computes the relations with WordNet gloss matcher .