{"id":15575315,"url":"https://github.com/vickumar1981/stringdistance","last_synced_at":"2025-09-03T13:32:36.133Z","repository":{"id":27797460,"uuid":"83631865","full_name":"vickumar1981/stringdistance","owner":"vickumar1981","description":"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..","archived":false,"fork":false,"pushed_at":"2022-04-25T20:24:06.000Z","size":1329,"stargazers_count":81,"open_issues_count":16,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-31T23:58:41.586Z","etag":null,"topics":["cosine-similarity","cosine-similarity-scores","dice-coefficient","fuzzy-matching","hacktoberfest","hamming-distance","jaccard","jaccard-similarity","jaro","jaro-distance","jaro-winkler","jaro-winkler-distance","levenshtein","levenshtein-distance","longest-common-subsequence","ngram","sorensen-dice-distance","soundex","soundex-algorithm","string-similarity"],"latest_commit_sha":null,"homepage":"https://vickumar1981.github.io/stringdistance/api/com/github/vickumar1981/stringdistance/index.html","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vickumar1981.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-02T03:51:46.000Z","updated_at":"2025-08-21T09:23:38.000Z","dependencies_parsed_at":"2022-08-07T13:01:11.459Z","dependency_job_id":null,"html_url":"https://github.com/vickumar1981/stringdistance","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vickumar1981/stringdistance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickumar1981%2Fstringdistance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickumar1981%2Fstringdistance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickumar1981%2Fstringdistance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickumar1981%2Fstringdistance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vickumar1981","download_url":"https://codeload.github.com/vickumar1981/stringdistance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vickumar1981%2Fstringdistance/sbom","scorecard":{"id":920229,"data":{"date":"2025-08-11","repo":{"name":"github.com/vickumar1981/stringdistance","commit":"754819a9bfce6479f8603aba17413e7321a35250"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: sbt-launch.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-25T01:22:28.952Z","repository_id":27797460,"created_at":"2025-08-25T01:22:28.952Z","updated_at":"2025-08-25T01:22:28.952Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273452757,"owners_count":25108468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cosine-similarity","cosine-similarity-scores","dice-coefficient","fuzzy-matching","hacktoberfest","hamming-distance","jaccard","jaccard-similarity","jaro","jaro-distance","jaro-winkler","jaro-winkler-distance","levenshtein","levenshtein-distance","longest-common-subsequence","ngram","sorensen-dice-distance","soundex","soundex-algorithm","string-similarity"],"created_at":"2024-10-02T18:28:52.321Z","updated_at":"2025-09-03T13:32:35.219Z","avatar_url":"https://github.com/vickumar1981.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](logo.png)\n\n# StringDistance  \n\n[![Build Status](https://api.travis-ci.com/vickumar1981/stringdistance.svg?branch=master)](https://app.travis-ci.com/github/vickumar1981/stringdistance/builds) [![Coverage Status](https://coveralls.io/repos/github/vickumar1981/stringdistance/badge.svg?branch=master)](https://coveralls.io/github/vickumar1981/stringdistance?branch=master) [![Read the Docs](https://img.shields.io/readthedocs/pip.svg)](https://vickumar1981.github.io/stringdistance/api/com/github/vickumar1981/stringdistance/index.html) [![Maven metadata URI](https://img.shields.io/maven-central/v/com.github.vickumar1981/stringdistance_2.13)](https://mvnrepository.com/artifact/com.github.vickumar1981/stringdistance) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE.md)\n\nA 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.\n\nWorks with generalized arrays.\n\nFor more detailed information, please refer to the [API Documentation](https://vickumar1981.github.io/stringdistance/api/com/github/vickumar1981/stringdistance/index.html \"API Documentation\").\n\nRequires: Java 8+ or Scala 2.11+\n\n---\n### Contents\n\n1.  [Add it to your project](https://github.com/vickumar1981/stringdistance#1-add-it-to-your-project-)\n2.  [Using in Scala](https://github.com/vickumar1981/stringdistance#2-scala-usage)\n3.  [Using in Scala with implicits](https://github.com/vickumar1981/stringdistance#3-scala-use-with-implicits)\n4.  [Using in Java](https://github.com/vickumar1981/stringdistance#4-java-usage)\n5.  [Using with Arrays](https://github.com/vickumar1981/stringdistance#5-using-with-arrays)\n6.  [Adding your own algorithm](https://github.com/vickumar1981/stringdistance#6-adding-your-own-distance-or-scoring-algorithm)\n7.  [Reporting an Issue](https://github.com/vickumar1981/stringdistance#7-reporting-an-issue)\n8.  [Contributing](https://github.com/vickumar1981/stringdistance#8-contributing)\n9.  [License](https://github.com/vickumar1981/stringdistance#9-license)\n\n---\n### 1. Add it to your project ...\n\n__Using sbt:__\n\nIn `build.sbt`:\n```scala\nlibraryDependencies += \"com.github.vickumar1981\" %% \"stringdistance\" % \"1.2.7\"\n```\n\n__Using gradle:__\n\nIn `build.gradle`:\n```groovy\ndependencies {\n    compile 'com.github.vickumar1981:stringdistance_2.13:1.2.7'\n}\n```\n\n__Using Maven:__\n\nIn `pom.xml`:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.vickumar1981\u003c/groupId\u003e\n    \u003cartifactId\u003estringdistance_2.13\u003c/artifactId\u003e\n    \u003cversion\u003e1.2.7\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**Notes:**\n - For Scala 2.12, please use the `stringdistance_2.12` artifact as a dependency instead.\n - For Scala 2.11, please use the `stringdistance_2.11` artifact as a dependency instead. \n\n---\n### 2. Scala Usage\n\n__Example.scala__:\n```scala\n// Scala example\nimport com.github.vickumar1981.stringdistance.StringDistance._\nimport com.github.vickumar1981.stringdistance.StringSound._\nimport com.github.vickumar1981.stringdistance.impl.{ConstantGap, LinearGap}\n\n// Cosine Similarity\nval cosSimilarity: Double = Cosine.score(\"hello\", \"chello\")  // 0.935\n\n// Damerau-Levenshtein Distance\nval damerauDist: Int = Damerau.distance(\"martha\", \"marhta\")  // 1\nval damerau: Double = Damerau.score(\"martha\", \"marhta\")  // 0.833\n\n// Dice Coefficient\nval diceCoefficient: Double = DiceCoefficient.score(\"martha\", \"marhta\")  // 0.4\n\n// Hamming Distance\nval hammingDist: Int = Hamming.distance(\"martha\", \"marhta\")  // 2\nval hamming: Double = Hamming.score(\"martha\", \"marhta\")  // 0.667\n\n// Jaccard Similarity\nval jaccard: Double = Jaccard.score(\"karolin\", \"kathrin\", 1)\n\n// Jaro and Jaro Winkler\nval jaro: Double = Jaro.score(\"martha\", \"marhta\")  // 0.944\nval jaroWinkler: Double = JaroWinkler.score(\"martha\", \"marhta\", 0.1)  // 0.961\n\n// Levenshtein Distance\nval levenshteinDist: Int = Levenshtein.distance(\"martha\", \"marhta\")  // 2\nval levenshtein: Double = Levenshtein.score(\"martha\", \"marhta\")  // 0.667\n\n// Longest Common Subsequence\nval longestCommonSubSeq: Int = LongestCommonSeq.distance(\"martha\", \"marhta\")  // 5\n\n// Needleman Wunsch\nval needlemanWunsch: Double = NeedlemanWunsch.score(\"martha\", \"marhta\", ConstantGap())  // 0.667\n\n// N-Gram Similarity and Distance\nval ngramDist: Int = NGram.distance(\"karolin\", \"kathrin\", 1)  // 5\nval bigramDist: Int = NGram.distance(\"karolin\", \"kathrin\", 2)  // 2\nval ngramSimilarity: Double = NGram.score(\"karolin\", \"kathrin\", 1)  // 0.714\nval bigramSimilarity: Double = NGram.score(\"karolin\", \"kathrin\", 2)  // 0.333\n\n// N-Gram tokens, returns a List[String]\nval tokens: List[String] = NGram.tokens(\"martha\", 2)  // List(\"ma\", \"ar\", \"rt\", \"th\", \"ha\")\n\n// Overlap Similarity\nval overlap: Double = Overlap.score(\"karolin\", \"kathrin\", 1)  // 0.286\nval overlapBiGram: Double = Overlap.score(\"karolin\", \"kathrin\", 2)  // 0.667\n\n// Smith Waterman Similarities\nval smithWaterman: Double = SmithWaterman.score(\"martha\", \"marhta\", (LinearGap(gapValue = -1), Integer.MAX_VALUE))\nval smithWatermanGotoh: Double = SmithWatermanGotoh.score(\"martha\", \"marhta\", ConstantGap())\n\n// Tversky Similarity\nval tversky: Double = Tversky.score(\"karolin\", \"kathrin\", 0.5)  // 0.333\n\n// Phonetic Similarity\nval metaphone: Boolean = Metaphone.score(\"merci\", \"mercy\")  // true\nval soundex: Boolean = Soundex.score(\"merci\", \"mercy\")  // true\n```\n---\n### 3. Scala: Use with Implicits\n  -  To use implicits and extend the String class:  `import com.github.vickumar1981.stringdistance.StringConverter._`\n\n__Example.scala__\n```scala\n// Scala example using implicits\nimport com.github.vickumar1981.stringdistance.StringConverter._\n\n// Scores between two strings\nval cosSimilarity: Double = \"hello\".cosine(\"chello\")\nval damerau: Double = \"martha\".damerau(\"marhta\")\nval diceCoefficient: Double = \"martha\".diceCoefficient(\"marhta\")\nval hamming: Double = \"martha\".hamming(\"marhta\")\nval jaccard: Double = \"karolin\".jaccard(\"kathrin\")\nval jaro: Double = \"martha\".jaro(\"marhta\")\nval jaroWinkler: Double = \"martha\".jaroWinkler(\"marhta\")\nval levenshtein: Double = \"martha\".levenshtein(\"marhta\")\nval needlemanWunsch: Double = \"martha\".needlemanWunsch(\"marhta\")\nval ngramSimilarity: Double = \"karolin\".nGram(\"kathrin\")\nval bigramSimilarity: Double = \"karolin\".nGram(\"kathrin\", 2)\nval overlap: Double = \"karolin\".overlap(\"kathrin\")\nval overlapBiGram: Double = \"karolin\".overlap(\"kathrin\", 2)\nval smithWaterman: Double = \"martha\".smithWaterman(\"marhta\")\nval smithWatermanGotoh: Double = \"martha\".smithWatermanGotoh(\"marhta\")\nval tversky: Double = \"karolin\".tversky(\"kathrin\", 0.5)\n\n// Distances between two strings\nval damerauDist: Int = \"martha\".damerauDist(\"marhta\")  // 1\nval hammingDist: Int = \"martha\".hammingDist(\"marhta\")\nval levenshteinDist: Int = \"martha\".levenshteinDist(\"marhta\")\nval longestCommonSeq: Int = \"martha\".longestCommonSeq(\"marhta\")\nval ngramDist: Int = \"karolin\".nGramDist(\"kathrin\")\nval bigramDist: Int = \"karolin\".nGramDist(\"kathrin\", 2)\n\n// N-Gram tokens, returns a List[String]\nval tokens: List[String] = \"martha\".tokens(2)  // List(\"ma\", \"ar\", \"rt\", \"th\", \"ha\")\n\n// Phonetic similarity of two strings\nval metaphone: Boolean = \"merci\".metaphone(\"mercy\")\nval soundex: Boolean = \"merci\".soundex(\"mercy\")\n```\n---\n### 4. Java Usage\n  -  To use in Java:  `import com.github.vickumar1981.stringdistance.util.StringDistance`\n\n__Example.java__\n```java\n// Java example\nimport com.github.vickumar1981.stringdistance.util.StringDistance;\nimport com.github.vickumar1981.stringdistance.util.StringSound;\n\n// Scores between two strings\nDouble cosSimilarity = StringDistance.cosine(\"hello\", \"chello\");\nDouble damerau = StringDistance.damerau(\"martha\", \"marhta\");\nDouble diceCoefficient = StringDistance.diceCoefficient(\"martha\", \"marhta\");\nDouble hamming = StringDistance.hamming(\"martha\", \"marhta\");\nDouble jaccard = StringDistance.jaccard(\"karolin\", \"kathrin\");\nDouble jaro = StringDistance.jaro(\"martha\", \"marhta\");\nDouble jaroWinkler = StringDistance.jaroWinkler(\"martha\", \"marhta\");\nDouble levenshtein = StringDistance.levenshtein(\"martha\", \"marhta\");\nDouble needlemanWunsch = StringDistance.needlemanWunsch(\"martha\", \"marhta\");\nDouble ngramSimilarity = StringDistance.nGram(\"karolin\", \"kathrin\");\nDouble bigramSimilarity = StringDistance.nGram(\"karolin\", \"kathrin\", 2);\nDouble overlap = StringDistance.overlap(\"karolin\", \"kathrin\");\nDouble overlapBiGram = StringDistance.overlap(\"karolin\", \"kathrin\", 2);\nDouble smithWaterman = StringDistance.smithWaterman(\"martha\", \"marhta\");\nDouble smithWatermanGotoh = StringDistance.smithWatermanGotoh(\"martha\", \"marhta\");\nDouble tversky = StringDistance.tversky(\"karolin\", \"kathrin\", 0.5);\n\n// Distances between two strings\nInteger damerauDist = StringDistance.damerauDist(\"martha\", \"marhta\");\nInteger hammingDist = StringDistance.hammingDist(\"martha\", \"marhta\");\nInteger levenshteinDist = StringDistance.levenshteinDist(\"martha\", \"marhta\");\nInteger longestCommonSeq = StringDistance.longestCommonSeq(\"martha\", \"marhta\");\nInteger ngramDist = StringDistance.nGramDist(\"karolin\", \"kathrin\");\nInteger bigramDist = StringDistance.nGramDist(\"karolin\", \"kathrin\", 2);\n\n// N-Gram tokens, returns a List\u003cString\u003e\nList\u003cString\u003e tokens = StringDistance.nGramTokens(2)  // List(\"ma\", \"ar\", \"rt\", \"th\", \"ha\")\n\n// Phonetic similarity of two strings\nBoolean metaphone = StringSound.metaphone(\"merci\", \"mercy\");\nBoolean soundex = StringSound.soundex(\"merci\", \"mercy\");\n```\n---\n\n### 5. Using with Arrays\n\n- You can use the [ArrayDistance](https://vickumar1981.github.io/stringdistance/api/com/github/vickumar1981/stringdistance/ArrayDistance$.html) \nclass just like the [StringDistance](https://vickumar1981.github.io/stringdistance/api/com/github/vickumar1981/stringdistance/StringDistance$.html) class,\nexcept using a generic array - `Array[T]` for Scala and `T[]` for Java.\n\n- Make sure your classes are comparable using `==` for Scala or `.equals` for Java\n\n__Scala Sample Code:__\n\n```scala\nimport com.github.vickumar1981.stringdistance.ArrayDistance._\n\n// Example Levenshtein Distance and Score\nval levenshteinDist = Levenshtein.distance(Array(\"m\", \"a\", \"r\", \"t\", \"h\", \"a\"), Array(\"m\", \"a\", \"r\", \"h\", \"t\", \"a\")) // 2\nval levenshtein = Levenshtein.score(Array(\"m\", \"a\", \"r\", \"t\", \"h\", \"a\"), Array(\"m\", \"a\", \"r\", \"h\", \"t\", \"a\")) // 0.667\n```\n\n\n__Java Example Code:__\n  - [Implement .equals for your class](https://github.com/vickumar1981/stringdistance/blob/master/src/main/java/sd_example/Ch.java#L15)\n  - [Use ArrayDistance with your class](https://github.com/vickumar1981/stringdistance/blob/master/src/main/java/sd_example/SdJavaExample.java#L7)\n\n\n---\n\n### 6. Adding your own Distance or Scoring Algorithm \n\n1.  Create a marker trait that extends `StringMetricAlgorithm`:\n\n```scala\ntrait CustomAlgorithm extends StringMetricAlgorithm\n```\n\n2.  Create an implementation for that algorithm using an implicit object.  Override either the `score` or the `distance` method, depending upon whether the object extends `DistanceAlgorithm` or `ScoringAlgorithm`.\n\n```scala\nimplicit object CustomDistance extends DistanceAlgorithm[CustomAlgorithm] {\n    override def distance(s1: String, s2: String): Int = {\n        // Implement distance between s1 and s2\n    }\n}\n\nimplicit object CustomScore extends ScoringAlgorithm[CustomAlgorithm] {\n    override def score(s1: String, s2: String): Double = {\n        // Implement fuzzy score between s1 and s2\n    }\n}\n```\n\n3.  Create an object that extends `StringMetric` using your algorithm as the type parameter, and use the `score` and `distance` methods defined in the implicit object.\n\n```scala\nobject CustomMetric extends StringMetric[CustomAlgorithm]\n\nval customScore: Double = CustomMetric.score(\"hello\", \"hello2\")\nval customDist: Int = CustomMetric.distance(\"hello\", \"hello2\")\n```\n---\n### 7. Reporting an Issue\n\nPlease report any issues or bugs to the [Github issues page](https://github.com/vickumar1981/stringdistance/issues).\n\n---\n### 8. Contributing\n\nPlease view the [contributing guidelines](CONTRIBUTING.md) \n\n---\n### 9. License\n\nThis project is licensed under the [Apache 2 License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvickumar1981%2Fstringdistance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvickumar1981%2Fstringdistance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvickumar1981%2Fstringdistance/lists"}