Code Monkey home page Code Monkey logo

stringsimilarity's Introduction

StringSimilarity

This class library calculates a score from 0 to 1 based on the similarity of two supplied strings.

Effective v1.0.1, StringSimilarity is now targeted to both .NET Core 2.0 and .NET Framework 4.5.2.

Help or Feedback

First things first - do you need help or have feedback? Contact me at joel dot christner at gmail dot com or file an issue here!

New in v1.0.1

  • Retarget to .NET Core 2.0 and .NET Framework 4.5.2

Score Computation

  • If one string is null/empty and the other is not, the score is 0
  • If both strings are null/empty, the score is 1
  • Otherwise, a length score is multiplied by a character match score, where length score = (min / max) and character match score is (num matching / total)

Example

Refer to the Test project for an example.

using Similarity;

Console.Write("String 1 : ");
string str1 = Console.ReadLine(); 
Console.Write("String 2 : ");
string str2 = Console.ReadLine();
Console.WriteLine("Score    : " + StringSimilarity.Calculate(str1, str2));

Version History

Notes from previous versions (starting with v1.0.0) will be moved here. v1.0.0

  • First release

stringsimilarity's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.