protected static void addTriple(Map<String, List<Triple>> dict, String token, Triple[] triple) { for (Triple t : triple) { addTriple(dict, token, t); } }
public void serialize(ExtendedPOSDictionary artifact, OutputStream out) throws IOException { artifact.serialize(out); }
public String[] getCompleteTag(String word) { if (caseSensitive) { return getCompleteTag(dictionary.get(word)); } else { return getCompleteTag(dictionary.get(word.toLowerCase())); } }
throws IOException, InvalidFormatException { final ExtendedPOSDictionary newPosDict = new ExtendedPOSDictionary(); addTriple(newPosDict.dictionary, word.getToken(0), createTriple(tags, lemmas, feats)); });
ExtendedPOSDictionary dictionary = new ExtendedPOSDictionary(); dictionary.addTriple(word, new Triple("pron-det", lemmaTag[0], featsString)); dictionary.addTriple(word, new Triple("pron-indp", lemmaTag[0], featsString)); && knownPostags.contains(classString) && (knownFeats.contains(featsString) || allowInvalidFeats)) { dictionary.addTriple(word, new Triple(classString, lemmaTag[0], featsString)); } else {
@Override public String toString() { StringBuilder dictionaryString = new StringBuilder(); int i = 0; for (String word : dictionary.keySet()) { dictionaryString.append(word).append(" -> ") .append(tagsToString(getTags(word))); dictionaryString.append("\n"); if (i > 3) break; i++; } // remove last new line if (dictionaryString.length() > 0) { dictionaryString.setLength(dictionaryString.length() - 1); } return dictionaryString.toString(); }
public ExtendedPOSDictionary create(InputStream in) throws IOException, InvalidFormatException { return ExtendedPOSDictionary.create(new UncloseableInputStream(in)); }
/** * Returns a list of valid tags for the specified word. * * @param word * The word. * * @return A list of valid tags for the specified word or null if no * information is available for that word. */ public String[] getTags(String word) { if (caseSensitive) { return getTags(dictionary.get(word)); } else { return getTags(dictionary.get(word.toLowerCase())); } }
throws IOException, InvalidFormatException { final ExtendedPOSDictionary newPosDict = new ExtendedPOSDictionary(); addTriple(newPosDict.dictionary, word.getToken(0), createTriple(tags, lemmas, feats)); });
ExtendedPOSDictionary dictionary = new ExtendedPOSDictionary(); dictionary.addTriple(word, new Triple("pron-det", lemmaTag[0], featsString)); dictionary.addTriple(word, new Triple("pron-indp", lemmaTag[0], featsString)); && knownPostags.contains(classString) && (knownFeats.contains(featsString) || allowInvalidFeats)) { dictionary.addTriple(word, new Triple(classString, lemmaTag[0], featsString)); } else {
@Override public String toString() { StringBuilder dictionaryString = new StringBuilder(); int i = 0; for (String word : dictionary.keySet()) { dictionaryString.append(word).append(" -> ") .append(tagsToString(getTags(word))); dictionaryString.append("\n"); if (i > 3) break; i++; } // remove last new line if (dictionaryString.length() > 0) { dictionaryString.setLength(dictionaryString.length() - 1); } return dictionaryString.toString(); }
public ExtendedPOSDictionary create(InputStream in) throws IOException, InvalidFormatException { return ExtendedPOSDictionary.create(new UncloseableInputStream(in)); }
/** * Returns a list of valid tags for the specified word. * * @param word * The word. * * @return A list of valid tags for the specified word or null if no * information is available for that word. */ public String[] getTags(String word) { if (caseSensitive) { return getTags(dictionary.get(word)); } else { return getTags(dictionary.get(word.toLowerCase())); } }
protected static void addTriple(Map<String, List<Triple>> dict, String token, Triple[] triple) { for (Triple t : triple) { addTriple(dict, token, t); } }
public void serialize(ExtendedPOSDictionary artifact, OutputStream out) throws IOException { artifact.serialize(out); }
if (params.getDict() != null) { long start = System.nanoTime(); tagdict = ExtendedPOSDictionary.create(new FileInputStream(params .getDict())); System.out.println("ExtendedPOSDictionary loaded in "
public String[] getCompleteTag(String word) { if (caseSensitive) { return getCompleteTag(dictionary.get(word)); } else { return getCompleteTag(dictionary.get(word.toLowerCase())); } }
void addTriple(String word, Triple triple) { addTriple(dictionary, word, triple); }