fix(documentation): Update documentation and migration guide with standardized method names and deprecation notices.
This commit is contained in:
parent
a24a02fc97
commit
76926a2170
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# 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)
|
## 2025-05-12 - 1.1.9 - fix(core)
|
||||||
Update build scripts, refine testing assertions, and enhance documentation
|
Update build scripts, refine testing assertions, and enhance documentation
|
||||||
|
|
||||||
|
14
readme.md
14
readme.md
@ -34,12 +34,20 @@ const mySmartFuzzy = new Smartfuzzy(myDictionary);
|
|||||||
mySmartFuzzy.addToDictionary('Microsoft');
|
mySmartFuzzy.addToDictionary('Microsoft');
|
||||||
mySmartFuzzy.addToDictionary(['Google', 'Facebook']);
|
mySmartFuzzy.addToDictionary(['Google', 'Facebook']);
|
||||||
|
|
||||||
// Getting the closest match
|
// Finding the closest match
|
||||||
const searchResult = mySmartFuzzy.getClosestMatchForString('Appl');
|
const searchResult = mySmartFuzzy.findClosestMatch('Appl');
|
||||||
console.log(searchResult); // Output: "Apple Inc."
|
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
|
### Advanced Object Sorting
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
- Tests improved with proper assertions and error handling
|
- Tests improved with proper assertions and error handling
|
||||||
- Input validation added to all public methods
|
- Input validation added to all public methods
|
||||||
- Code documented with comprehensive TypeScript JSDoc comments
|
- 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
|
## Improvement Plan - Fuse.js Optimization Focus
|
||||||
|
|
||||||
@ -74,13 +76,13 @@
|
|||||||
### 3. API Improvements
|
### 3. API Improvements
|
||||||
|
|
||||||
#### 3.1 Standardize Method Naming
|
#### 3.1 Standardize Method Naming
|
||||||
- [ ] Standardize all method names for consistency
|
- [x] Standardize all method names for consistency
|
||||||
- **Implementation approach**:
|
- **Implementation completed**:
|
||||||
- Rename `getClosestMatchForString` to `findClosestMatch`
|
- Renamed `getClosestMatchForString` to `findClosestMatch`
|
||||||
- Rename `getChangeScoreForString` to `calculateScores`
|
- Renamed `getChangeScoreForString` to `calculateScores`
|
||||||
- Create backward compatibility aliases with @deprecated tags
|
- Created backward compatibility aliases with @deprecated tags
|
||||||
- Update all tests and documentation with new method names
|
- Updated all tests with new method names
|
||||||
- Add migration guide for users
|
- ✓ Tests pass and build succeeds
|
||||||
|
|
||||||
#### 3.2 Add Chainable API
|
#### 3.2 Add Chainable API
|
||||||
- [ ] Create a more fluent API for complex searches
|
- [ ] Create a more fluent API for complex searches
|
||||||
@ -144,7 +146,7 @@
|
|||||||
## Implementation Priority
|
## Implementation Priority
|
||||||
|
|
||||||
### Phase 1: Core Improvements (1-2 weeks)
|
### 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)
|
- [ ] Configurability Enhancements (1.1 Enhance Configurability)
|
||||||
- [ ] Documentation Updates (4.1 Create Comprehensive Documentation)
|
- [ ] Documentation Updates (4.1 Create Comprehensive Documentation)
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartfuzzy',
|
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.'
|
description: 'A library for fuzzy matching strings against word dictionaries or arrays, with support for object and article searching.'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user