public IndexWord createIndexWord(POS pos, String lemma, Synset synset) throws JWNLException { return new IndexWord(dictionary, lemma, pos, synset); }
public IndexWord createIndexWord(POS pos, String lemma, Synset synset) throws JWNLException { return new IndexWord(dictionary, lemma, pos, synset); }
public IndexWord createIndexWord(POS pos, String lemma, ResultSet rs) throws SQLException, JWNLException { List<Long> offsets = new ArrayList<>(); while (rs.next()) { offsets.add(rs.getLong(1)); } if (offsets.isEmpty()) { return null; } long[] offsetArray = new long[offsets.size()]; for (int i = 0; i < offsets.size(); i++) { offsetArray[i] = offsets.get(i); } return new IndexWord(dictionary, stringCache.replace(lemma), pos, offsetArray); }
public IndexWord createIndexWord(POS pos, String lemma, ResultSet rs) throws SQLException, JWNLException { List<Long> offsets = new ArrayList<>(); while (rs.next()) { offsets.add(rs.getLong(1)); } if (offsets.isEmpty()) { return null; } long[] offsetArray = new long[offsets.size()]; for (int i = 0; i < offsets.size(); i++) { offsetArray[i] = offsets.get(i); } return new IndexWord(dictionary, stringCache.replace(lemma), pos, offsetArray); }
public IndexWord createIndexWord(POS pos, CharSequence line) throws JWNLException { CharSequenceParser p = new CharSequenceParser(line); String lemma = stringCache.replace(p.nextToken().replace('_', ' ')); p.skipToken(); // pos p.skipToken(); // sense_cnt int pointerCount = p.nextInt(); for (int i = 0; i < pointerCount; ++i) { p.skipToken(); // ptr_symbol } // Same as sense_cnt above. This is redundant, but the field was preserved for compatibility reasons. int senseCount = p.nextInt(); // Number of senses of lemma that are ranked according to their // frequency of occurrence in semantic concordance texts. p.skipToken(); // tagged sense count long[] synsetOffsets = new long[senseCount]; for (int i = 0; i < senseCount; i++) { synsetOffsets[i] = p.nextLong(); } if (log.isTraceEnabled()) { log.trace(dictionary.getMessages().resolveMessage("PRINCETON_INFO_003", new Object[]{lemma, pos})); } return new IndexWord(dictionary, lemma, pos, synsetOffsets); }
public IndexWord createIndexWord(POS pos, CharSequence line) throws JWNLException { CharSequenceParser p = new CharSequenceParser(line); String lemma = stringCache.replace(p.nextToken().replace('_', ' ')); p.skipToken(); // pos p.skipToken(); // sense_cnt int pointerCount = p.nextInt(); for (int i = 0; i < pointerCount; ++i) { p.skipToken(); // ptr_symbol } // Same as sense_cnt above. This is redundant, but the field was preserved for compatibility reasons. int senseCount = p.nextInt(); // Number of senses of lemma that are ranked according to their // frequency of occurrence in semantic concordance texts. p.skipToken(); // tagged sense count long[] synsetOffsets = new long[senseCount]; for (int i = 0; i < senseCount; i++) { synsetOffsets[i] = p.nextLong(); } if (log.isTraceEnabled()) { log.trace(dictionary.getMessages().resolveMessage("PRINCETON_INFO_003", new Object[]{lemma, pos})); } return new IndexWord(dictionary, lemma, pos, synsetOffsets); }