Beispiel #1
0
        public float GetScore(string string1, string string2)
        {
            Tokeniser tok = new Tokeniser();

            tok.UseStemming = false;

            _source = tok.Partition(string1);
            _target = tok.Partition(string2);

            if (_source.Length == 0 || _target.Length == 0)
            {
                return(0F);
            }

            float[][]        simMatrix = GetSimilarityMatrix(_source, _target);
            HeuristicMatcher match     = new HeuristicMatcher();
            //float score = HeuristicMatcher.ComputeSetSimilarity(simMatrix, 2, 0.3F);
            float score = HeuristicMatcher.ComputeSetSimilarity(simMatrix, 1);

            return(score);
        }
        public float GetScore(string string1, string string2)		
		{			
			Tokeniser tok=new Tokeniser() ;
            tok.UseStemming = false;

			_source=tok.Partition(string1) ;
			_target=tok.Partition(string2) ;

			if (_source.Length == 0 || _target.Length == 0 )
				return 0F;

            float[][] simMatrix = GetSimilarityMatrix(_source, _target);		
			HeuristicMatcher match=new HeuristicMatcher() ;
            //float score = HeuristicMatcher.ComputeSetSimilarity(simMatrix, 2, 0.3F);
            float score = HeuristicMatcher.ComputeSetSimilarity(simMatrix, 1);
			return score;	
		}