@Test public void testMinimal() { final String[] shadokAlph = new String[] { new String("GA"), new String("BU"), new String("ZO"), new String("MEU") }; final List<String> sentenceBefore = new ArrayList<String>(); final List<String> sentenceAfter = new ArrayList<String>(); sentenceBefore.add(shadokAlph[0]); sentenceBefore.add(shadokAlph[2]); sentenceBefore.add(shadokAlph[3]); sentenceBefore.add(shadokAlph[1]); sentenceBefore.add(shadokAlph[0]); sentenceBefore.add(shadokAlph[0]); sentenceBefore.add(shadokAlph[2]); sentenceBefore.add(shadokAlph[1]); sentenceBefore.add(shadokAlph[3]); sentenceBefore.add(shadokAlph[0]); sentenceBefore.add(shadokAlph[2]); sentenceBefore.add(shadokAlph[1]); sentenceBefore.add(shadokAlph[3]); sentenceBefore.add(shadokAlph[2]); sentenceBefore.add(shadokAlph[2]); sentenceBefore.add(shadokAlph[0]); sentenceBefore.add(shadokAlph[1]); sentenceBefore.add(shadokAlph[3]); sentenceBefore.add(shadokAlph[0]); sentenceBefore.add(shadokAlph[3]); final Random random = new Random(4564634237452342L); for (int nbCom = 0; nbCom <= 40; nbCom+=5) { sentenceAfter.clear(); sentenceAfter.addAll(sentenceBefore); for (int i = 0; i<nbCom; i++) { if (random.nextInt(2) == 0) { sentenceAfter.add(random.nextInt(sentenceAfter.size() + 1), shadokAlph[random.nextInt(4)]); } else { sentenceAfter.remove(random.nextInt(sentenceAfter.size())); } } final SequencesComparator<String> comparator = new SequencesComparator<String>(sentenceBefore, sentenceAfter); Assert.assertTrue(comparator.getScript().getModifications() <= nbCom); } }
public EditScript<T> getScript() { final EditScript<T> script = new EditScript<T>(); buildScript(0, sequence1.size(), 0, sequence2.size(), script); return script; }
SequencesComparator { public EditScript<T> getScript() { final EditScript<T> script = new EditScript<T>(); buildScript(0, sequence1.size(), 0, sequence2.size(), script); return script; } }
SequencesComparator { public EditScript<T> getScript() { final EditScript<T> script = new EditScript<T>(); buildScript(0, sequence1.size(), 0, sequence2.size(), script); return script; } SequencesComparator(final List<T> sequence1, final List<T> sequence2);  SequencesComparator(final List<T> sequence1, final List<T> sequence2, final Equator<? super T> equator); }
SequencesComparator { public EditScript<T> getScript() { final EditScript<T> script = new EditScript<T>(); buildScript(0, sequence1.size(), 0, sequence2.size(), script); return script; } SequencesComparator(final List<T> sequence1, final List<T> sequence2);  SequencesComparator(final List<T> sequence1, final List<T> sequence2, final Equator<? super T> equator); EditScript<T> getScript(); }
SequencesComparator { public EditScript<T> getScript() { final EditScript<T> script = new EditScript<T>(); buildScript(0, sequence1.size(), 0, sequence2.size(), script); return script; } SequencesComparator(final List<T> sequence1, final List<T> sequence2);  SequencesComparator(final List<T> sequence1, final List<T> sequence2, final Equator<? super T> equator); EditScript<T> getScript();  }