MCPcopy Create free account
hub / github.com/antlr/codebuff / trainOnSampleDocs

Method trainOnSampleDocs

src/org/antlr/codebuff/Corpus.java:142–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140 }
141
142 public void trainOnSampleDocs() throws Exception {
143 documentsPerExemplar = new ArrayList<>();
144 featureVectors = new ArrayList<>();
145 injectWhitespace = new ArrayList<>();
146 hpos = new ArrayList<>();
147
148 for (InputDocument doc : documents) {
149 if ( showFileNames ) System.out.println(doc);
150 // Parse document, add feature vectors to this corpus
151 Trainer trainer = new Trainer(this, doc, language.indentSize);
152 trainer.computeFeatureVectors();
153 }
154 }
155
156 /** Feature vectors in X are lumped together as they are read in each
157 * document. In kNN, this tends to find features from the same document

Callers 1

trainMethod · 0.95

Calls 1

computeFeatureVectorsMethod · 0.95

Tested by

no test coverage detected