1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! English vocabulary types and runtime lexicon loading.
//!
//! This crate provides the core lexicon infrastructure for the logicaffeine
//! English-to-First-Order-Logic transpiler. It defines the type system for
//! representing linguistic knowledge and optionally provides runtime lexicon
//! loading for faster development iteration.
//!
//! # Core Types
//!
//! The [`types`] module defines the fundamental linguistic categories:
//!
//! - **Verb classification**: [`VerbClass`] (Vendler's Aktionsart), [`Time`], [`Aspect`]
//! - **Noun properties**: [`Number`], [`Gender`], [`Case`], [`Definiteness`]
//! - **Semantic typing**: [`Sort`] (type hierarchy for entities)
//! - **Lexical features**: [`Feature`] (27 grammatical and semantic properties)
//! - **Metadata structs**: [`VerbMetadata`], [`NounMetadata`], [`AdjectiveMetadata`]
//!
//! # Architecture
//!
//! The lexicon supports two modes of operation:
//!
//! 1. **Compile-time** (default): The main `logicaffeine_language` crate generates
//! Rust code from `lexicon.json` at build time, providing type-safe lookups
//! with zero runtime parsing overhead.
//!
//! 2. **Runtime** (feature `dynamic-lexicon`): The [`runtime`] module loads and
//! parses `lexicon.json` at runtime, trading compile-time safety for faster
//! edit-compile cycles during development.
//!
//! # Feature Flags
//!
//! | Feature | Description |
//! |---------|-------------|
//! | `dynamic-lexicon` | Enable runtime JSON lexicon loading via the [`runtime`] module |
//!
//! # Example
//!
//! ```
//! use logicaffeine_lexicon::{VerbClass, Feature, Sort};
//!
//! // Check verb aspectual properties
//! let class = VerbClass::Activity;
//! assert!(!class.is_stative());
//! assert!(class.is_durative());
//!
//! // Parse features from strings
//! let feature = Feature::from_str("Transitive");
//! assert_eq!(feature, Some(Feature::Transitive));
//!
//! // Check sort compatibility
//! assert!(Sort::Human.is_compatible_with(Sort::Animate));
//! ```
/// Lexicon type definitions for grammatical and semantic categories.
pub use *;
/// Runtime JSON-based lexicon loading (requires `dynamic-lexicon` feature).
///
/// This module provides dynamic lexicon loading as an alternative to compile-time
/// code generation. It defines its own entry types (`runtime::VerbEntry`, etc.)
/// for JSON deserialization, distinct from the compile-time types in [`types`].