/** * Tag a single word and return a n-best list of Part-of-Speech tags. * * @param is set of sentences * @param instanceIndex index to the sentence in question * @param word word to be tagged * @return n-best list of Part-of-Speech tags */ public ArrayList<POS> tag(InstancesTagger is,int instanceIndex, int word, String wordForm) { return pipe.classify( wordForm , params, word, is, instanceIndex, is.pposs[instanceIndex], li); }
public ArrayList<String> tagStrings(InstancesTagger is,int instanceIndex, int word, String wordForm) { ArrayList<POS> plist = pipe.classify( wordForm , params, word, is, instanceIndex, is.pposs[instanceIndex], li); String pos[] = mf.reverse(this.pipe.mf.getFeatureSet().get(ExtractorT2.POS)); ArrayList<String> postags =null; for(POS p : plist) { try { postags.add(pos[p.p]); }catch(Exception e) { e.printStackTrace(); } } return postags; }