Add LinksNotationManager, Q&A database, and fuzzy matching utilities #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for features from other Links Notation library implementations, making
link-notation-objects-codeca drop-in replacement for:Features Added
LinksNotationManager (from lino.lib.mjs):
jsonToLino()andlinoToJson()for JSON<->Links Notation conversionescapeReference()for proper string escaping (handles spaces, quotes, parentheses, newlines)saveAsLino,loadFromLino,saveJsonAsLino,loadJsonFromLinostorageDirfor file storage locationparse,parseNumericIds,parseStringValueslinosingleton instance for convenienceQ&A Database (from qa-database.mjs):
createQADatabase(filePath)factory functionaddOrUpdateQA,getAnswer,deleteQA,getAllQAFuzzy Matching Utilities:
levenshteinDistance(a, b)- Edit distance between stringsstringSimilarity(a, b)- Normalized similarity score (0-1)normalizeQuestion(question)- Text normalization for comparisonextractKeywords(question, options)- Keyword extraction with stopwords filteringkeywordSimilarity(a, b)- Keyword overlap (Jaccard index)findBestMatch(question, database, options)- Find best matching entryfindAllMatches(question, database, options)- Find all matches above thresholdTest Coverage
Added comprehensive test suite with 182 tests covering:
All tests pass in CI.
Documentation
Updated
js/README.mdand mainREADME.mdwith:Test Plan
Fixes #7
🤖 Generated with Claude Code