Details
-
Wish
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.9.3
Description
The "opennlp.tools.util.Sequence" class has a "getOutcomes" method that returns the outcomes as the underlying list without copying the data. However, the "getProbs" method returns the probabilities as an array copy of the underlying probabilities list.
It would be useful to have the following accessor methods to avoid the copy (and an accessor for the outcomes for API consistency):
public int getSize() { return outcomes.size(); } public String getOutcome(int index) { return outcomes.get(index); } public double getProb(int index) { return probs.get(index); }
The motivation is that I want to convert the "POSTagger.topKSequences" to a "Map<String, Double>", in addition to locating the highest probability tag in the result.