}
sourceVocab = new Vocabulary(sourceWords);
corpusSentence = new BasicPhrase(corpusString, sourceVocab);
targetCorpusString = "das macht ihn und es beschädigt ihn , es setzt ihn auf und es führt ihn aus .";
Set<String> targetWords = new HashSet<String>();
for (String targetWord : targetCorpusString.split("\\s+")) {
targetWords.add(targetWord);
}
targetVocab = new Vocabulary(targetWords);
ntVocab = new HashMap<Integer,String>();
ntVocab.put(-1, "X");
{
// create the suffix array...
int[] sentenceStartPositions = {0};
Assert.assertEquals(corpusSentence.size(), 18);
int[] corpus = new int[corpusSentence.size()];
for(int i = 0; i < corpusSentence.size(); i++) {
corpus[i] = corpusSentence.getWordID(i);
}
CorpusArray corpusArray = new CorpusArray(corpus, sentenceStartPositions, sourceVocab);
suffixArray = new SuffixArray(corpusArray);
int[] targetSentenceStartPositions = {0};
BasicPhrase targetCorpusSentence = new BasicPhrase(targetCorpusString, targetVocab);
Assert.assertEquals(targetCorpusSentence.size(), 18);
int[] targetCorpus = new int[targetCorpusSentence.size()];
for(int i = 0; i < targetCorpusSentence.size(); i++) {
targetCorpus[i] = targetCorpusSentence.getWordID(i);
}
CorpusArray targetCorpusArray = new CorpusArray(targetCorpus, targetSentenceStartPositions, targetVocab);
targetSuffixArray = new SuffixArray(targetCorpusArray);
int[] lowestAlignedTargetIndex = new int[corpusSentence.size()];
int[] highestAlignedTargetIndex = new int[corpusSentence.size()];
int[] lowestAlignedSourceIndex = new int[targetCorpusSentence.size()];
int[] highestAlignedSourceIndex = new int[targetCorpusSentence.size()];
int[][] alignedTargetIndices = new int[corpusSentence.size()][];
int[][] alignedSourceIndices = new int[targetCorpusSentence.size()][];
{
for (int i=0; i<18; i++) {