void countTrainingTags(TaggedFileRecord file)
throws IOException
{
int sentences = countSentences(file);
int trainSentences = (int) (sentences * trainingRatio);
TaggedFileReader reader = file.reader();
List<TaggedWord> line;
for (int i = 0; i < trainSentences && reader.hasNext(); ++i) {
line = reader.next();
addTaggedWords(line, trainingWords);
addTaggedWords(line, allWords);
}
while (reader.hasNext()) {
line = reader.next();
addTaggedWords(line, allWords);
}
}