Skip to content

pizza-rs/analysis-synonym

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”€ pizza-analysis-synonym

Synonym expansion filters for INFINI Pizza

Crate License


Overview

Provides synonym expansion and contraction filters with support for both single-word and multi-word (graph-aware) synonym handling. Supports Solr/Elasticsearch synonym file format with explicit mappings and equivalent groups.

Components

Type Name Description
TokenFilter synonym Single-word synonym expansion/contraction
TokenFilter synonym_graph Graph-aware multi-word synonym filter

Synonym Formats

Explicit mapping (one-directional):

ipod, i-pod, i pod => ipod
sea biscuit, seabiscuit => seabiscuit

Equivalent groups (bidirectional):

couch, sofa, divan
notebook, laptop, netbook

synonym vs synonym_graph

Feature synonym synonym_graph
Multi-word input Flattened Proper graph with posLength
Index-time safe βœ… ❌ (use at query-time only)
Position accuracy Approximate Exact graph arcs

Use synonym for index-time expansion and synonym_graph for query-time with multi-word synonyms.

Example

use pizza_analysis_synonym::{SynonymFilter, SynonymMap, SynonymRule};

let rules = vec![
    SynonymRule::equivalent(vec!["quick", "fast", "speedy"]),
    SynonymRule::explicit(vec!["ny", "new york"], "new york"),
];
let map = SynonymMap::from_rules(&rules);
let filter = SynonymFilter::new(map);

Installation

[dependencies]
pizza-analysis-synonym = "0.1"

Or via pizza-analysis-all:

[dependencies]
pizza-analysis-all = { version = "0.1", features = ["synonym"] }

License

MIT


Part of the INFINI Pizza ecosystem

About

πŸ”€ Synonym analysis plugin for INFINI Pizza

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages