All Projects → eldersantos → phonix

eldersantos / phonix

Licence: Apache-2.0 license
Phonetic libray for .NET

Programming Languages

C#
18002 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to phonix

double-metaphone
Fast Double Metaphone algorithm
Stars: ✭ 70 (+11.11%)
Mutual labels:  soundex, metaphone
Jellyfish
🎐 a python library for doing approximate and phonetic matching of strings.
Stars: ✭ 1,571 (+2393.65%)
Mutual labels:  soundex, metaphone
phonetic-algorithms
Phonetic-Algorithms for fuzzy searching | PHP
Stars: ✭ 14 (-77.78%)
Mutual labels:  metaphone
ceja
PySpark phonetic and string matching algorithms
Stars: ✭ 24 (-61.9%)
Mutual labels:  metaphone
stringdistance
A fuzzy matching string distance library for Scala and Java that includes Levenshtein distance, Jaro distance, Jaro-Winkler distance, Dice coefficient, N-Gram similarity, Cosine similarity, Jaccard similarity, Longest common subsequence, Hamming distance, and more..
Stars: ✭ 60 (-4.76%)
Mutual labels:  soundex

Welcome to Phonix

Build Status

A Phonetic open source libray for .NET, no dependencies, it is pure C# code ;)

Now with support for .NET Core (thanks @ysilvestrov) and VS 2017 (thanks to @spboyer)

Latest Version

The quickest way to get the latest release of Phonix is to add it to your project using NuGet (http://nuget.org/List/Packages/Phonix).

Implemented algorithms

Today Phonix implements the following algorithms:

How to use

Below there are examples on how to use the MatchRating, DoubleMetaphone and Soundex algorithms:


    using Phonix;
    
    public class MatchRatingApproachTests
    {
        private static readonly string[] Words = new[] { "Spotify", "Spotfy", "Sputfy","Sputfi" };

        readonly MatchRatingApproach _generator = new MatchRatingApproach();
       
        public void Should_Be_Similar()
        {
            Console.Writeline(_generator.IsSimilar(Words));
        }
    }
    
    public class SoundexTests
    {
        private static readonly string[] Words = new[] { "Spotify", "Spotfy", "Sputfi", "Spotifi" };
        private static readonly string[] Words2 = new[] { "United Air Lines", "United Aire Lines", "United Air Line" };

        readonly Soundex _generator = new Soundex();

        public void Should_Be_Similar()
        {
            Console.Writeline(_generator.IsSimilar(Words));
            Console.Writeline(_generator.IsSimilar(Words2));
        }
    }
    
    public class DoubleMetaphoneTests
    {
        private static readonly string[] Words = new[] {"Spotify", "Spotfy", "Sputfi", "Spotifi"};
        private static readonly string[] Words2 = new[] { "United Air Lines", "United Aire Lines", "Unitid Air Line"};

        readonly DoubleMetaphone _generator =  new DoubleMetaphone();
              
        public void Should_Return_Same_Keys()
        {
            string[][] keys =  new string[Words.Length][];
            for (int n = 0; n < Words.Length; n++)
            {
                keys[n] =  _generator.BuildKeys(Words[n]);
            }

            for (int n = 0; n < Words.Length; n++)
            {
                for (int m = 0; m < keys[n].Length; m++)
                {
                    if (n > 0)
                    {
                        Console.Writeline(keys[n][m], keys[n - 1][m]);
                    }
                }
            }

            string[][] keys2 = new string[Words2.Length][];
            for (int n = 0; n < Words2.Length; n++)
            {
                keys2[n] = _generator.BuildKeys(Words2[n]);
            }

            for (int n = 0; n < Words2.Length; n++)
            {
                for (int m = 0; m < keys2[n].Length; m++)
                {
                    Console.WriteLine(keys2[n][m]);
                    if (n > 0)
                    {
                        Console.Writeline(keys2[n][m], keys2[n - 1][m]);
                    }
                }
            }
        }
    }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].