@Override public String toString() { return this.tag + "/" + this.simplifiedTag.name(); } }
public Tag(String tag, Tagset tagset) { super(); this.tag = tag; this.simplifiedTag = TagMapping.getSimplifiedTag(tag, tagset); }
@Override public double getProbability(String phrase) throws Exception { long n = getNrOfNgrams(CoreUtils.getPhraseLength(phrase)); if (n == 0) { return 0; } else { return (double) getFrequency(phrase) / n; } }
public Tag(SimplifiedTag simplifiedTag) { super(); this.tag = simplifiedTag.name(); this.simplifiedTag = simplifiedTag; }
@Override public long getFrequency(String phrase) throws Exception { int phraseLength = CoreUtils.getPhraseLength(phrase); if (cfd.hasCondition(phraseLength)) { return cfd.getCount(phraseLength, phrase); } else { return 0; } }