// Could this be an anaphora for the given phrase?  Check the attributes
        public static ProbableStrength AnaphoraOf(InformedPhrase anaphora, PhraseSense prime)
        {
            if (anaphora.IsContained(prime) || prime.IsContained(anaphora))
                return ProbableStrength.Zero;   // can't refer to included structure

            ProbableStrength total = new ProbableStrength(0, 0);
            double strengthFactor = total.ImproveStrengthStart();

            foreach (KeyValuePair<PhraseSense, double> sense in anaphora.Senses)
            {
                ProbableStrength match = AnaphoraOf(sense.Key, prime);
                total.ImproveStrength(match.DownWeight(sense.Value), ref strengthFactor);
            }

            total.ImproveStrengthFinish(strengthFactor);

            return total;
        }
Exemple #2
0
        // Could this be an anaphora for the given phrase?  Check the attributes
        public static ProbableStrength AnaphoraOf(InformedPhrase anaphora, PhraseSense prime)
        {
            if (anaphora.IsContained(prime) || prime.IsContained(anaphora))
            {
                return(ProbableStrength.Zero);   // can't refer to included structure
            }
            ProbableStrength total          = new ProbableStrength(0, 0);
            double           strengthFactor = total.ImproveStrengthStart();

            foreach (KeyValuePair <PhraseSense, double> sense in anaphora.Senses)
            {
                ProbableStrength match = AnaphoraOf(sense.Key, prime);
                total.ImproveStrength(match.DownWeight(sense.Value), ref strengthFactor);
            }

            total.ImproveStrengthFinish(strengthFactor);

            return(total);
        }