Пример #1
0
        private object[] concatenate(object[] array, object[] array2)
        {
            int num  = array.Length;
            int num2 = array2.Length;

            object[] array3 = (object[])java.lang.reflect.Array.newInstance(Object.instancehelper_getClass(array).getComponentType(), num + num2);
            ByteCodeHelper.arraycopy(array, 0, array3, 0, num);
            ByteCodeHelper.arraycopy(array2, 0, array3, num, num2);
            return(array3);
        }
Пример #2
0
        public WordSequence getOldest()
        {
            WordSequence wordSequence = WordSequence.__EMPTY;

            if (this.size() >= 1)
            {
                wordSequence = new WordSequence(this.words.Length - 1);
                ByteCodeHelper.arraycopy(this.words, 0, wordSequence.words, 0, wordSequence.words.Length);
            }
            return(wordSequence);
        }
Пример #3
0
        public virtual List getRightContexts(int size, bool startWithCurrent, int maxContexts)
        {
            ArrayList arrayList         = new ArrayList();
            List      nextGrammarPoints = this.getNextGrammarPoints(startWithCurrent);

            if (nextGrammarPoints.isEmpty())
            {
                Unit[] emptyContext = Unit.getEmptyContext(size);
                this.addContext(arrayList, emptyContext);
            }
            else
            {
                Iterator iterator = nextGrammarPoints.iterator();
                while (iterator.hasNext())
                {
                    GrammarPoint grammarPoint = (GrammarPoint)iterator.next();
                    if (size == 1)
                    {
                        Unit[] array = new Unit[size];
                        array[0] = grammarPoint.getUnitOrFill();
                        this.addContext(arrayList, array);
                    }
                    else
                    {
                        List     rightContexts = grammarPoint.getRightContexts(size - 1, false, maxContexts - arrayList.size());
                        Iterator iterator2     = rightContexts.iterator();
                        while (iterator2.hasNext())
                        {
                            Unit[] array2        = (Unit[])iterator2.next();
                            Unit[] emptyContext2 = Unit.getEmptyContext(array2.Length + 1);
                            emptyContext2[0] = grammarPoint.getUnitOrFill();
                            ByteCodeHelper.arraycopy(array2, 0, emptyContext2, 1, array2.Length);
                            this.addContext(arrayList, emptyContext2);
                        }
                    }
                    if (arrayList.size() >= maxContexts)
                    {
                        break;
                    }
                }
            }
            return(arrayList);
        }