@Test public void testToGrmmInput2() { Token<AffiliationLabel> token1 = new Token<AffiliationLabel>("sometext"); token1.setLabel(AffiliationLabel.TEXT); token1.getFeatures().add("F1"); token1.getFeatures().add("F2"); Token<AffiliationLabel> token2 = new Token<AffiliationLabel>("sometext2"); token2.setLabel(AffiliationLabel.TEXT); token2.getFeatures().add("F3"); String expected = "TEXT ---- F1 F2 Start@-1 F3@1\n" + "TEXT ---- F3 F1@-1 F2@-1 End@1\n"; String actual = GrmmUtils.toGrmmInput(Arrays.asList(token1, token2), 1); assertEquals(expected, actual); }
public static String toGrmmInput(String label, List<String> features) { StringBuilder builder = new StringBuilder(); builder.append(label); builder.append(LABEL_SEPARATOR); for (int i = 0; i < features.size(); i++) { builder.append(features.get(i)); if (i + 1 < features.size()) { builder.append(SEPARATOR); } } return builder.toString(); }
GrmmUtils { public static String toGrmmInput(String label, List<String> features) { StringBuilder builder = new StringBuilder(); builder.append(label); builder.append(LABEL_SEPARATOR); for (int i = 0; i < features.size(); i++) { builder.append(features.get(i)); if (i + 1 < features.size()) { builder.append(SEPARATOR); } } return builder.toString(); } }
GrmmUtils { public static String toGrmmInput(String label, List<String> features) { StringBuilder builder = new StringBuilder(); builder.append(label); builder.append(LABEL_SEPARATOR); for (int i = 0; i < features.size(); i++) { builder.append(features.get(i)); if (i + 1 < features.size()) { builder.append(SEPARATOR); } } return builder.toString(); }  }
GrmmUtils { public static String toGrmmInput(String label, List<String> features) { StringBuilder builder = new StringBuilder(); builder.append(label); builder.append(LABEL_SEPARATOR); for (int i = 0; i < features.size(); i++) { builder.append(features.get(i)); if (i + 1 < features.size()) { builder.append(SEPARATOR); } } return builder.toString(); }  static String toGrmmInput(String label, List<String> features); static String toGrmmInput(List<T> tokens,
            int neighborInfluenceThreshold); }
GrmmUtils { public static String toGrmmInput(String label, List<String> features) { StringBuilder builder = new StringBuilder(); builder.append(label); builder.append(LABEL_SEPARATOR); for (int i = 0; i < features.size(); i++) { builder.append(features.get(i)); if (i + 1 < features.size()) { builder.append(SEPARATOR); } } return builder.toString(); }  static String toGrmmInput(String label, List<String> features); static String toGrmmInput(List<T> tokens,
            int neighborInfluenceThreshold);  }