Conversation
… Soundex, avec des tests unitaires pour valider les fonctionnalités.
…le-algorithm-with-tests Add Fisher-Yates shuffle algorithm
…me Soundex et mise à jour des tests pour vérifier les mappages spécifiques au français.
… compris des algorithmes de similarité textuelle, des fonctions de génération aléatoire, et des utilitaires pour l'autocomplétion intelligente.
There was a problem hiding this comment.
Pull request overview
This pull request introduces significant enhancements to the algorith package, including a new Fisher-Yates shuffle algorithm, multilingual support for the Soundex phonetic encoder, and comprehensive documentation improvements. The PR adds version 1.0.2 with new features, extensive tests, and a GitHub Actions workflow for PR title validation.
Key Changes:
- Added standalone
fisherYatesShuffle()function with deterministic shuffling support - Enhanced
soundex()with French language support, custom character mappings, and accent normalization - Added PR validation workflow to enforce conventional commit standards
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| algorithms/fisherYatesShuffle.js | New Fisher-Yates shuffle implementation with custom RNG support |
| algorithms/soundex.js | Enhanced with multilingual support (EN/FR), custom mappings, and French character normalization |
| test/fisherYatesShuffle.test.js | Comprehensive tests for shuffle algorithm including determinism validation |
| test/soundex.test.js | Expanded tests for multilingual support, custom mappings, and French normalization |
| test/compareAll.test.js | Updated to include fisherYatesShuffle in exports validation |
| index.js | Added fisherYatesShuffle to module exports |
| index.d.ts | Updated TypeScript definitions for soundex and fisherYatesShuffle, reformatted indentation |
| package.json | Version bump to 1.0.2, added autocomplete-related keywords |
| package-lock.json | Updated package versions and dependencies |
| README.md | Added features section, performance benchmarks, updated test count, expanded soundex documentation |
| CHANGELOG.md | Added comprehensive release notes for version 1.0.2 |
| docs/PR_CONVENTIONS.md | New documentation for PR title conventions and validation process |
| .github/workflows/pr-validation.yml | New GitHub Actions workflow to validate PR titles and suggest labels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Section "Fonctionnalités" complète avec toutes les capacités de la bibliothèque | ||
| - Benchmarks détaillés (ops/s) pour petites, moyennes et grandes chaînes | ||
| - Performance du RandomEngine avec toutes ses fonctions | ||
| - **Tests unitaires** - 152 tests passant (amélioration de la couverture) |
There was a problem hiding this comment.
The CHANGELOG states "152 tests passant" but the README badge and text indicate "115 passing". These test counts should be consistent across all documentation.
| - **Tests unitaires** - 152 tests passant (amélioration de la couverture) | |
| - **Tests unitaires** - amélioration de la couverture de tests |
| const customMap = { | ||
| a: '', e: '', i: '', o: '', u: '', | ||
| r: 9, // Different from standard mapping | ||
| o: '', b: 1, e: '', r: 9, t: 3 | ||
| }; |
There was a problem hiding this comment.
The customMap object has duplicate keys: 'r' is defined twice (line 125 and 126), 'o' twice, and 'e' twice. In JavaScript objects, duplicate keys result in the last value overwriting previous ones. This makes the test's intent unclear and may not properly validate the custom mapping feature.
|
|
||
| # Pattern pour les conventions de commit | ||
| # Format: type(scope): description | ||
| if [[ "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore)(\([a-z0-9-]+\))?: .{1,50}$ ]]; then |
There was a problem hiding this comment.
The PR title "Dev" does not follow the conventional commit format that the newly added PR validation workflow enforces. According to the workflow validation regex on line 24, PR titles must follow the format "type(scope): description" (e.g., "feat(soundex): add multilingual support"). This PR will fail its own validation workflow.
| c: 2, k: 2, q: 2, g: 2, j: 2, s: 2, x: 2, z: 2, ç: 2, | ||
| d: 3, t: 3, | ||
| l: 4, | ||
| m: 5, n: 5, | ||
| r: 6, | ||
| f: 7, v: 7 | ||
| } | ||
| }; | ||
|
|
||
| // Prétraitement | ||
| s = s.toLowerCase(); | ||
| let first = s[0].toUpperCase(); | ||
| if (lang === 'fr') s = normalize(s); |
There was a problem hiding this comment.
The normalization function is only applied when the language is 'fr', but the French map includes 'ç' as a key (line 22). This creates an inconsistency: if normalization converts ç to s before lookup, the ç key in the French map will never be matched. Either remove 'ç: 2' from the French map since it's already normalized to 's', or ensure the normalization logic doesn't conflict with the map definitions.
This pull request introduces several new features and improvements, focusing on enhanced phonetic matching, a new deterministic shuffle utility, and expanded documentation and tests. The most significant updates are the addition of the
fisherYatesShufflealgorithm, major enhancements to thesoundexfunction (including multilingual and custom mapping support), and comprehensive documentation updates reflecting these changes.New Algorithms and Utilities:
fisherYatesShuffle()function for deterministic array shuffling, supporting custom random number generators and included in the main exports. [1] [2]fisherYatesShuffle. [1] [2]Phonetic Matching Improvements:
soundex()to support custom character mappings and improved French language normalization (accents, special characters, and French-specific mappings). The function signature now acceptslanguageandcustomMapparameters, with updated logic and documentation. [1] [2]soundexfor handling custom maps and first-letter code inclusion.Documentation and Testing:
Changelog and Release Management:
CHANGELOG.md, summarizing all new features, enhancements, and bug fixes, including Soundex improvements and the new shuffle algorithm.CI/CD and Workflow Enhancements: