public void testUnalignable() {
ATable at = new ATable(true, 1, 10);
int[] e1 = {-1,0,2,4};
int[]ef = {1,2,1,2};
TTable_monolithic tt = new TTable_monolithic(e1, ef, 4);
tt.set(1, 1, 0.2f);
tt.set(1, 2, 0.8f);
tt.set(2, 1, 0.9f);
tt.set(2, 2, 0.1f);
at.add(4, 'a', 999, 0.05f);
at.add(3, 'a', 999, 0.05f);
at.add(2, 'a', 999, 0.05f);
at.add(1, 'a', 999, 0.3f);
at.add(0, 'a', 999, 0.5f);
at.add(-1, 'a', 999, 0.4f);
at.add(-2, 'a', 999, 0.5f);
at.add(-3, 'a', 999, 0.05f);
at.add(-4, 'a', 999, 0.05f);
at.add(-5, 'a', 999, 0.05f);
at.normalize();
// System.out.println(at);
int[] fw = {2, 1, 2, 3, 2, 2, 2};
//int[] fw = {2, 1, 2};
int[] ew = {2, 1, 1, 1, 2};
Phrase f = new Phrase(fw, 1);
Phrase e = new Phrase(ew, 1);
PhrasePair pp = new PhrasePair(f, e);
tt.normalize();
hmm = new HMM(tt, at);
hmm.buildHMMTables(pp);
PerplexityReporter cr = new PerplexityReporter();
Alignment a = hmm.viterbiAlign(pp, cr);
assertEquals(a.getELength(), e.size());