lexicor 0.2.0
lexicor: ^0.2.0 copied to clipboard
An optimized, strictly typed, offline interface for the Open English WordNet database. Supports lightweight (no definitions) and full (with definitions) modes.
0.2.0 #
Breaking changes #
Lexicor.morphology()renamed toLexicor.lemmatize(). The old name was misleading — the method returns the base lemma of an inflected form.
New features #
withDefinitionsmode —Lexicor.init(withDefinitions: true)loadsdictionary_full.sqliteand populatesConcept.definitionon every lookup result. Defaults tofalsefor backward-compatible lightweight operation.Concept.definition— new nullable getter on theConceptinterface. Returns the WordNet synset gloss whenwithDefinitions: true, otherwisenull.Lexicor.synonyms(concept)— returns all words that share the same synset (strict synonyms within the exact same sense).Lexicor.traverse(concept, type, {maxDepth})— recursively walks a relation hierarchy (e.g. hypernym chain) using a single SQLite recursive CTE. ReturnsList<RelatedWord>where each entry carries adepthfield. ThrowsArgumentErrorfor non-recursive relation types.Lexicor.examples(concept)— returns usage example sentences from thesampletable in the full database. Returns an empty list in light mode.Lexicor.lookupBatch(words)— looks up a list of words, returning aMap<String, LookupResult>. Repeated words are served from the lookup cache.RelatedWord.depth— new field (default1). Always1forrelated(); reflects traversal depth fortraverse().
Performance improvements #
Lexicor.related(concept, type: ...)now filters in SQL via a dedicated prepared statement, avoiding unnecessary row fetches.lookup()results are LRU-cached (default 512 entries).- Both caches share the same LRU eviction helper.
Fixes #
Lexicor.init()now opens assets inOpenMode.readOnly.pathmoved fromdependenciestodev_dependencies.- README corrected (
semantic/lexical,byType, version badge).
Build tooling #
tool/sql/migration_full.sql— full schema withdefinition+sampletable.tool/sql/oewn.sql— source schema reference.build_database.dart— supports--full, no flag,--all.- Three melos scripts:
build,build:full,build:all.
Tests #
- Integration tests use
markTestSkippedwhen assets are absent. - New unit tests:
lookupBatch,synonyms,traverse,examples,definitions, lookup caching, invalid-concept guard. test_db.dartextended with synonym, traverse, and sample data.
0.1.4 #
- Performance: All SQL queries are
PreparedStatementinstances. - Example:
lexicor_demo.dartexpanded.
0.1.3 #
- Documentation: Fixed typo in README.
0.1.2 #
- Refactor: Consolidated
ConceptImplintoconcept.dart. - Feature: Added
example/check_db_size.dart.
0.1.1 #
- Examples: Added
lexicor_demo.dartandbenchmark.dart.
0.1.0 #
- 🚀 Initial release.