0
How do I save words I get in a string new?
gravarArq.println(token.getLexeme() + "_" + token.getPOSTag() + "_" + token.getFeatures());
How to take what comes from token.getPOSTag()
and save all the words that come from it in a string new?
for (org.cogroo.text.Token token : sentence.getTokens()) { // lista de tokens
token.getStart(); token.getEnd(); // caracteres onde o token comeca e termina
token.getLexeme(); // o texto do token (palavra que ele separa e pega exp: "clinico"
token.getLemmas(); // um array com os possiveis lemas para o par lexeme+postag
token.getPOSTag(); // classe morfologica de acordo com o contexto("coloca "prp, adj,n(noun))
token.getFeatures(); // genero, numero, tempo etc
contadorTokens++;
System.out.println(token.getLexeme() + "_" + token.getPOSTag() + "_" + token.getFeatures());// imprime a palavra com o tag
gravarArq.println(token.getLexeme() + "_" + token.getPOSTag() + "_" + token.getFeatures());
//System.out.println(token.getLexeme());
}
Welcome to [en.so]. Could you clarify what your question is? What part of the code exactly are you having problems with? From what I understand is just take what comes from
token.getPOSTag()
and play in a new variable, right? Enjoy and make a [tour] through the site and check out the guide to [Ask].– Math