Ejemplo n.º 1
0
        public static double CalculateSimilarity(string source, string target)
        {
            if ((source == null) || (target == null))
            {
                return(0.0);
            }
            if ((source.Length == 0) || (target.Length == 0))
            {
                return(0.0);
            }
            if (source == target)
            {
                return(1.0);
            }

            int stepsToSame = QAFunction.ComputeLevenshteinDistance(source, target);

            return(1.0 - ((double)stepsToSame / (double)Math.Max(source.Length, target.Length)));
        }
Ejemplo n.º 2
0
 public static string GetBacSiNoiTruKhamBenh(IClientServices services)
 {
     return(services.GetInformation("UserID") == null?QAFunction.DefaultDatabase() : services.GetInformation("UserID").ToString());
 }