Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void add(int actionCode, float score) throws org.maltparser.core.exception.MaltChainedException
        public virtual void add(int actionCode, float score)
        {
            if (k != -1 && addCandidateIndex >= k)
            {
                return;
            }
            if (addCandidateIndex >= kBestList.Count)
            {
                kBestList.Add(new ScoredCandidate());
            }
            if (!(kBestList[addCandidateIndex] is ScoredCandidate))
            {
                base.add(actionCode);
                return;
            }
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final ScoredCandidate scand = (ScoredCandidate)kBestList.get(addCandidateIndex);
            ScoredCandidate scand = (ScoredCandidate)kBestList[addCandidateIndex];

            scand.ActionCode = actionCode;
            scand.setScore(score);
            if (addCandidateIndex == 0)
            {
                if (decision is SingleDecision)
                {
                    ((SingleDecision)decision).addDecision(actionCode);
                }
                topCandidateIndex++;
            }
            addCandidateIndex++;
        }
Beispiel #2
0
        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final ScoredCandidate item = (ScoredCandidate)obj;
            ScoredCandidate item = (ScoredCandidate)obj;

            return(actionCode == item.actionCode && score == item.score);
        }