public static String printableName(IWord word, boolean bUseLexFileName) { ISynset syn = word.getSynset(); StringBuilder sb = new StringBuilder(); sb.append(word.getLemma()); sb.append(NAME_PART_SEP); sb.append(syn.getPOS().getTag()); sb.append(NAME_PART_SEP); // This is the sense number or name if (bUseLexFileName) sb.append(syn.getLexicalFile().getName().toLowerCase()); else sb.append(syn.getLexicalFile().getNumber()); sb.append(NAME_PART_SEP); sb.append(word.getLexicalID()); String res = sb.toString(); return res.replaceAll("[_]", NAME_PART_SEP); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final ILexFile other = (ILexFile) obj; if (desc == null) { if(other.getDescription() != null) return false; } else if (!desc.equals(other.getDescription())) return false; if (name == null) { if (other.getName() != null) return false; } else if (!name.equals(other.getName())) return false; if (num != other.getNumber()) return false; if (pos == null) { if (other.getPOS() != null) return false; } else if (!pos.equals(other.getPOS())) return false; return true; }
syn.getLexicalFile().getName().toLowerCase() : syn.getLexicalFile().getNumber() + "";