@Nullable @Override public final StringPair tab2StringPair(String line) { if (line == null) { return null; } String[] fields = line.split("\t"); sentencePos = fields[4].length() + 1; return new StringPair(fields[4], fields[6]); }
@Nullable protected StringPair tab2StringPair(String line) { if (line == null) { return null; } String[] fields = line.split("\t"); if (fields.length < 2) { throw new RuntimeException("Unexpected format, expected two tab-separated columns: " + line); } return new StringPair(fields[0], fields[1]); }
case EXAMPLE: if (inCorrectExample) { correctExamples.add(new StringPair(srcExample.getExample(), trgExample.getExample())); } else if (inIncorrectExample) { StringPair examplePair = new StringPair(srcExample.getExample(), trgExample.getExample()); if (trgExample.getCorrections().isEmpty()) { incorrectExamples.add(new IncorrectBitextExample(examplePair));
builderStringPairs.add(instance.new StringPair(a, b));
cache.get(new StringPair("AB", "AB")).addAndGet(123)
public static void main(String[] args) { HashSet<StringPair> pairs = new HashSet<StringPair>(); pairs.add(new StringPair("A", "B")); pairs.add(new StringPair("B", "A")); pairs.add(new StringPair("B", "C")); pairs.add(new StringPair("B", "C")); pairs.add(new StringPair("B", "B")); for (Iterator<StringPair> i = pairs.iterator(); i.hasNext();) { StringPair stringPair = (StringPair) i.next(); System.out.println(stringPair.s1+" "+stringPair.s2); } }
AtomicInteger value = cache.get(new StringPair("AB", "AB")); value.addAndGet(123);
@Nullable @Override public final StringPair tab2StringPair(String line) { if (line == null) { return null; } String[] fields = line.split("\t"); sentencePos = fields[4].length() + 1; return new StringPair(fields[4], fields[6]); }
@Nullable protected StringPair tab2StringPair(String line) { if (line == null) { return null; } String[] fields = line.split("\t"); if (fields.length < 2) { throw new RuntimeException("Unexpected format, expected two tab-separated columns: " + line); } return new StringPair(fields[0], fields[1]); }
case EXAMPLE: if (inCorrectExample) { correctExamples.add(new StringPair(srcExample.getExample(), trgExample.getExample())); } else if (inIncorrectExample) { StringPair examplePair = new StringPair(srcExample.getExample(), trgExample.getExample()); if (trgExample.getCorrections().isEmpty()) { incorrectExamples.add(new IncorrectBitextExample(examplePair));