Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void addAction(org.maltparser.parser.history.container.ActionContainer[] actionContainers) throws org.maltparser.core.exception.MaltChainedException
        public virtual void addAction(ActionContainer[] actionContainers)
        {
            if (actionContainers == null || actionContainers.Length != history.ActionTables.Count)
            {
                throw new HistoryException("The action containers does not exist or is not of the same size as the action table. ");
            }
            int j = 0;

            for (int i = 0, n = history.DecisionTables.Count; i < n; i++)
            {
                if (history.DecisionTables[i] is CombinedTableContainer)
                {
                    CombinedTableContainer tableContainer = (CombinedTableContainer)history.DecisionTables[i];
                    int nContainers = tableContainer.NumberContainers;
                    decisions[i].addDecision(tableContainer.getCombinedCode(actionContainers, j));
                    j = j + nContainers;
                }
                else
                {
                    decisions[i].addDecision(actionContainers[j].ActionCode);
                    j++;
                }
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void getAction(java.util.ArrayList<org.maltparser.parser.history.container.ActionContainer> actionContainers) throws org.maltparser.core.exception.MaltChainedException
        public virtual void getAction(List <ActionContainer> actionContainers)
        {
            if (actionContainers == null || actionContainers.Count != history.ActionTables.Count)
            {
                throw new HistoryException("The action containers does not exist or is not of the same size as the action table. ");
            }
            int j = 0;

            for (int i = 0, n = history.DecisionTables.Count; i < n; i++)
            {
                if (history.DecisionTables[i] is CombinedTableContainer)
                {
                    CombinedTableContainer tableContainer = (CombinedTableContainer)history.DecisionTables[i];
                    int nContainers = tableContainer.NumberContainers;
                    tableContainer.setActionContainer(actionContainers.subList(j, j + nContainers), decisions[i].DecisionCode);
                    j = j + nContainers;
                }
                else
                {
                    actionContainers[j].Action = decisions[i].DecisionCode;
                    j++;
                }
            }
        }