public string getDatabaseWord()
 {
     if (this.databaseIndex > 0)
     {
         return((string)LongTextAligner.access_300(this.this_1.this_0).get(this.getDatabaseIndex()));
     }
     return(null);
 }
예제 #2
0
        public virtual int[] align(List words, Range range)
        {
            if (range.upperEndpoint() - range.lowerEndpoint() < this.tupleSize || words.size() < this.tupleSize)
            {
                return(LongTextAligner.alignTextSimple(this.refWords.subList(range.lowerEndpoint(), range.upperEndpoint()), words, range.lowerEndpoint()));
            }
            int[] array = new int[words.size()];
            Arrays.fill(array, -1);
            int      i        = 0;
            Iterator iterator = new LongTextAligner.Alignment(this, this.getTuples(words), range).getIndices().iterator();

            while (iterator.hasNext())
            {
                LongTextAligner_Alignment_Node longTextAligner_Alignment_Node = (LongTextAligner_Alignment_Node)iterator.next();
                for (i = Math.max(i, longTextAligner_Alignment_Node.getQueryIndex()); i < longTextAligner_Alignment_Node.getQueryIndex() + this.tupleSize; i++)
                {
                    array[i] = longTextAligner_Alignment_Node.getDatabaseIndex() + i - longTextAligner_Alignment_Node.getQueryIndex();
                }
            }
            return(array);
        }
 internal LongTextAligner_Alignment_1(LongTextAligner.Alignment alignment, LongTextAligner longTextAligner, Map map)
 {
     this_1          = alignment;
     this.val_this_0 = longTextAligner;
     this.val_cost   = map;
 }
예제 #4
0
            public Alignment(LongTextAligner longTextAligner, List list, Range range)
            {
                this_0       = longTextAligner;
                this.query   = list;
                this.indices = new ArrayList();
                TreeSet treeSet = new TreeSet();

                for (int i = 0; i < list.size(); i++)
                {
                    if (LongTextAligner.access_400(longTextAligner).containsKey(list.get(i)))
                    {
                        this.indices.add(Integer.valueOf(i));
                        Iterator iterator = ((ArrayList)LongTextAligner.access_400(longTextAligner).get(list.get(i))).iterator();
                        while (iterator.hasNext())
                        {
                            Integer integer = (Integer)iterator.next();
                            if (range.contains(integer.intValue()))
                            {
                                treeSet.add(integer);
                            }
                        }
                    }
                }
                this.shifts = new ArrayList(treeSet);
                HashMap       hashMap       = new HashMap();
                PriorityQueue priorityQueue = new PriorityQueue(1, new LongTextAligner_Alignment_1(this, longTextAligner, hashMap));
                HashSet       hashSet       = new HashSet();
                HashMap       hashMap2      = new HashMap();
                LongTextAligner_Alignment_Node longTextAligner_Alignment_Node = new LongTextAligner_Alignment_Node(this, 0, 0, null);

                hashMap.put(longTextAligner_Alignment_Node, Integer.valueOf(0));
                priorityQueue.add(longTextAligner_Alignment_Node);
                while (!priorityQueue.isEmpty())
                {
                    LongTextAligner_Alignment_Node longTextAligner_Alignment_Node2 = (LongTextAligner_Alignment_Node)priorityQueue.poll();
                    if (!hashSet.contains(longTextAligner_Alignment_Node2))
                    {
                        if (longTextAligner_Alignment_Node2.isTarget())
                        {
                            ArrayList arrayList = new ArrayList();
                            while (hashMap2.containsKey(longTextAligner_Alignment_Node2))
                            {
                                if (!longTextAligner_Alignment_Node2.isBoundary() && longTextAligner_Alignment_Node2.hasMatch())
                                {
                                    arrayList.add(longTextAligner_Alignment_Node2);
                                }
                                longTextAligner_Alignment_Node2 = (LongTextAligner_Alignment_Node)hashMap2.get(longTextAligner_Alignment_Node2);
                            }
                            this.alignment = new ArrayList(arrayList);
                            Collections.reverse(this.alignment);
                            return;
                        }
                        hashSet.add(longTextAligner_Alignment_Node2);
                        Iterator iterator2 = longTextAligner_Alignment_Node2.adjacent().iterator();
                        while (iterator2.hasNext())
                        {
                            LongTextAligner_Alignment_Node longTextAligner_Alignment_Node3 = (LongTextAligner_Alignment_Node)iterator2.next();
                            if (!hashSet.contains(longTextAligner_Alignment_Node3))
                            {
                                int     num      = Math.abs(this.indices.size() - this.shifts.size() - LongTextAligner_Alignment_Node.access_600(longTextAligner_Alignment_Node2) + LongTextAligner_Alignment_Node.access_700(longTextAligner_Alignment_Node2)) - Math.abs(this.indices.size() - this.shifts.size() - LongTextAligner_Alignment_Node.access_600(longTextAligner_Alignment_Node3) + LongTextAligner_Alignment_Node.access_700(longTextAligner_Alignment_Node3));
                                Integer integer2 = (Integer)hashMap.get(longTextAligner_Alignment_Node3);
                                Integer integer3 = (Integer)hashMap.get(longTextAligner_Alignment_Node2);
                                if (integer2 == null)
                                {
                                    integer2 = Integer.valueOf(int.MaxValue);
                                }
                                if (integer3 == null)
                                {
                                    integer3 = Integer.valueOf(int.MaxValue);
                                }
                                int num2 = integer3.intValue() + longTextAligner_Alignment_Node3.getValue() - num;
                                if (num2 < integer2.intValue())
                                {
                                    hashMap.put(longTextAligner_Alignment_Node3, Integer.valueOf(num2));
                                    priorityQueue.add(longTextAligner_Alignment_Node3);
                                    hashMap2.put(longTextAligner_Alignment_Node3, longTextAligner_Alignment_Node2);
                                }
                            }
                        }
                    }
                }
                this.alignment = Collections.emptyList();
            }
예제 #5
0
 internal static HashMap access_400(LongTextAligner longTextAligner)
 {
     return(longTextAligner.tupleIndex);
 }
예제 #6
0
 internal static List access_300(LongTextAligner longTextAligner)
 {
     return(longTextAligner.reftup);
 }