From 76926a21704c34505483804ff7a1a7845f76346c Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 15 May 2025 08:56:05 +0000 Subject: [PATCH] fix(documentation): Update documentation and migration guide with standardized method names and deprecation notices. --- changelog.md | 7 +++++++ readme.md | 14 +++++++++++--- readme.plan.md | 18 ++++++++++-------- ts/00_commitinfo_data.ts | 2 +- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/changelog.md b/changelog.md index 676ef52..1210089 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-05-13 - 1.1.10 - fix(documentation) +Update documentation and migration guide with standardized method names and deprecation notices. + +- Replaced deprecated getClosestMatchForString with findClosestMatch in code examples. +- Replaced deprecated getChangeScoreForString with calculateScores in documentation. +- Updated readme plan to mark method naming standardization as completed. + ## 2025-05-12 - 1.1.9 - fix(core) Update build scripts, refine testing assertions, and enhance documentation diff --git a/readme.md b/readme.md index 7622def..baf9a04 100644 --- a/readme.md +++ b/readme.md @@ -34,12 +34,20 @@ const mySmartFuzzy = new Smartfuzzy(myDictionary); mySmartFuzzy.addToDictionary('Microsoft'); mySmartFuzzy.addToDictionary(['Google', 'Facebook']); -// Getting the closest match -const searchResult = mySmartFuzzy.getClosestMatchForString('Appl'); +// Finding the closest match +const searchResult = mySmartFuzzy.findClosestMatch('Appl'); console.log(searchResult); // Output: "Apple Inc." + +// Calculate similarity scores for all dictionary entries +const scores = mySmartFuzzy.calculateScores('Appl'); +console.log(scores); +// Output: { 'Sony': 4, 'Deutsche Bahn': 11, 'Apple Inc.': 5, ... } +// Lower scores indicate better matches ``` -This example demonstrates how to instantiate the `Smartfuzzy` class with a list of strings (dictionary) and add more entries to it. You can then use it to get the closest match for a given search string. +This example demonstrates how to instantiate the `Smartfuzzy` class with a list of strings (dictionary) and add more entries to it. You can then use it to find the closest match or calculate similarity scores for a given search string. + +> **Note:** The older method names `getClosestMatchForString` and `getChangeScoreForString` are still available for backward compatibility but are deprecated. It's recommended to use the new method names `findClosestMatch` and `calculateScores` instead. ### Advanced Object Sorting diff --git a/readme.plan.md b/readme.plan.md index ce272d5..ae6744d 100644 --- a/readme.plan.md +++ b/readme.plan.md @@ -8,6 +8,8 @@ - Tests improved with proper assertions and error handling - Input validation added to all public methods - Code documented with comprehensive TypeScript JSDoc comments +- Method names standardized for better API consistency +- Backward compatibility maintained through deprecated method aliases ## Improvement Plan - Fuse.js Optimization Focus @@ -74,13 +76,13 @@ ### 3. API Improvements #### 3.1 Standardize Method Naming -- [ ] Standardize all method names for consistency - - **Implementation approach**: - - Rename `getClosestMatchForString` to `findClosestMatch` - - Rename `getChangeScoreForString` to `calculateScores` - - Create backward compatibility aliases with @deprecated tags - - Update all tests and documentation with new method names - - Add migration guide for users +- [x] Standardize all method names for consistency + - **Implementation completed**: + - Renamed `getClosestMatchForString` to `findClosestMatch` + - Renamed `getChangeScoreForString` to `calculateScores` + - Created backward compatibility aliases with @deprecated tags + - Updated all tests with new method names + - ✓ Tests pass and build succeeds #### 3.2 Add Chainable API - [ ] Create a more fluent API for complex searches @@ -144,7 +146,7 @@ ## Implementation Priority ### Phase 1: Core Improvements (1-2 weeks) -- [ ] API Improvements (3.1 Standardize Method Naming) +- [x] API Improvements (3.1 Standardize Method Naming) ✓ COMPLETED - [ ] Configurability Enhancements (1.1 Enhance Configurability) - [ ] Documentation Updates (4.1 Create Comprehensive Documentation) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 41c50c7..a642b16 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartfuzzy', - version: '1.1.9', + version: '1.1.10', description: 'A library for fuzzy matching strings against word dictionaries or arrays, with support for object and article searching.' }