@Test public void testToString() throws IOException { LemmaSample sample = new LemmaSample(createSentence(), createTags(), createLemmas()); String[] sentence = createSentence(); String[] tags = createTags(); String[] lemmas = createLemmas(); StringReader sr = new StringReader(sample.toString()); BufferedReader reader = new BufferedReader(sr); for (int i = 0; i < sentence.length; i++) { String line = reader.readLine(); String[] parts = line.split("\t"); Assert.assertEquals(3, parts.length); Assert.assertEquals(sentence[i], parts[0]); Assert.assertEquals(tags[i], parts[1]); Assert.assertEquals(lemmas[i], parts[2]); } }
@Override public String toString() { StringBuilder lemmaString = new StringBuilder(); for (int ci = 0; ci < lemmas.size(); ci++) { lemmaString.append(tokens.get(ci)).append("\t").append(tags.get(ci)) .append("\t").append(lemmas.get(ci)).append("\n"); } return lemmaString.toString(); }
LemmaSample implements Serializable { @Override public String toString() { StringBuilder lemmaString = new StringBuilder(); for (int ci = 0; ci < lemmas.size(); ci++) { lemmaString.append(tokens.get(ci)).append("\t").append(tags.get(ci)) .append("\t").append(lemmas.get(ci)).append("\n"); } return lemmaString.toString(); } }
LemmaSample implements Serializable { @Override public String toString() { StringBuilder lemmaString = new StringBuilder(); for (int ci = 0; ci < lemmas.size(); ci++) { lemmaString.append(tokens.get(ci)).append("\t").append(tags.get(ci)) .append("\t").append(lemmas.get(ci)).append("\n"); } return lemmaString.toString(); } LemmaSample(String[] tokens, String[] tags, String[] lemmas);  LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas); }
LemmaSample implements Serializable { @Override public String toString() { StringBuilder lemmaString = new StringBuilder(); for (int ci = 0; ci < lemmas.size(); ci++) { lemmaString.append(tokens.get(ci)).append("\t").append(tags.get(ci)) .append("\t").append(lemmas.get(ci)).append("\n"); } return lemmaString.toString(); } LemmaSample(String[] tokens, String[] tags, String[] lemmas);  LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas); String[] getTokens(); String[] getTags(); String[] getLemmas(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
LemmaSample implements Serializable { @Override public String toString() { StringBuilder lemmaString = new StringBuilder(); for (int ci = 0; ci < lemmas.size(); ci++) { lemmaString.append(tokens.get(ci)).append("\t").append(tags.get(ci)) .append("\t").append(lemmas.get(ci)).append("\n"); } return lemmaString.toString(); } LemmaSample(String[] tokens, String[] tags, String[] lemmas);  LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas); String[] getTokens(); String[] getTags(); String[] getLemmas(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }