mod textdist;
pub mod config;
pub mod vocabulary;
pub use config::{
About, ConfigIssue, ConfigIssueKind, FIELD_TYPES, FieldSpec, Fixity, History, IdStorage,
OpenClosed, ROOT_CONFIG_KEY, RelationDef, RelationStyleConfig, SPEC_VERSION, WorkspaceConfig,
diagnose, field_type_as_config_str, field_type_from_config_str, is_valid_workspace_id,
metadata_format_from_str, metadata_format_str, spec_ahead,
};
pub use vocabulary::{Term, Vocabulary};
pub fn nearest_vocabulary_term(key: &str, candidates: &[String]) -> Option<String> {
textdist::nearest_owned(key, candidates)
}
pub fn vocabulary_terms_near(a: &str, b: &str) -> bool {
(1..=2).contains(&textdist::levenshtein(a, b))
}
pub fn vocabulary_distance(a: &str, b: &str) -> Option<usize> {
let distance = textdist::levenshtein(a, b);
(1..=2).contains(&distance).then_some(distance)
}