foundation tier

foundation-text-signals

Deterministic, zero-AI text-analysis signals shared across the document-structural-decomposition sharder family (ADR 0035): lexicon-based sentiment scoring and coarse heuristic part-of-speech-class proportions. Both are explicitly approximate, non-ML techniques -- not a substitute for a real tagger/classifier, just a cheap, local, fully deterministic signal a caller can disclose alongside structural counts without new model dependencies.

Deterministic, zero-AI text-analysis signals shared across the document-structural-decomposition sharder family (ADR 0035): lexicon-based sentiment scoring and coarse heuristic part-of-speech-class proportions. Both are explicitly approximate, non-ML techniques -- not a substitute for a real tagger/classifier, just a cheap, local, fully deterministic signal a caller can disclose alongside structural counts without new model dependencies.

Tierfoundation
Roleunclassified (baselined)
Pathcrates/foundation/text-signals
Edition2021
Targetsfoundation_text_signals
Public items13 across 0 modules
Tests10

What it is for

Deterministic, zero-AI text-analysis signals shared across the document-structural-decomposition sharder family (ADR 0035): lexicon-based sentiment scoring and coarse heuristic part-of-speech proportions. Nothing here calls an AI, loads a model, or makes a network request -- both techniques are explicitly approximate, word-list/suffix-rule based, not a substitute for a real classifier or tagger. Callers disclose the resulting counts/scores, never the underlying text.

Capabilities

crate root

Deterministic, zero-AI text-analysis signals shared across the

Item
pub const LEADING_ARTICLES: & str; 3
fn strip_leading_article <'a>(words : & 'a & 'a str) -> & 'a & 'a str

PosClass

Deterministic, zero-AI text-analysis signals shared across the

Item
pub enum PosClass
fn classify_word_pos(word : & str) -> PosClass

PosProportions

Deterministic, zero-AI text-analysis signals shared across the

Item
pub struct PosProportions
PosProportions :: fn function_word_ratio(& self) -> f64
PosProportions :: fn verb_ratio(& self) -> f64
PosProportions :: fn noun_ratio(& self) -> f64
PosProportions :: fn adjective_ratio(& self) -> f64
PosProportions :: fn adverb_ratio(& self) -> f64
fn pos_class_proportions(text : & str) -> PosProportions

SentimentSignal

Deterministic, zero-AI text-analysis signals shared across the

Item
pub struct SentimentSignal
fn sentiment_score(text : & str) -> SentimentSignal

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub const LEADING_ARTICLES: & str; 3A small closed set of English articles that legitimately start a sentence, capitalized only because they're sentence-initial, not because they're part of a proper name
fn strip_leading_article <'a>(words : & 'a & 'a str) -> & 'a & 'a strOnly strips when 3+ words remain after stripping, so a genuine 2-word proper name that happens to start with an article ("The Hague") is left intact rather than reduced to a single, non-distinguishing word.
pub struct SentimentSignalWord-count-based sentiment signal for one piece of text
fn sentiment_score(text : & str) -> SentimentSignalScore text by counting lexicon hits
pub enum PosClassA collapsed, heuristic part-of-speech class
fn classify_word_pos(word : & str) -> PosClassClassify one word by a fixed closed-class list first, then suffix heuristics for open classes
pub struct PosProportionsPer-class word counts and proportions (count / total) for text
PosProportions :: fn function_word_ratio(& self) -> f64
PosProportions :: fn verb_ratio(& self) -> f64
PosProportions :: fn noun_ratio(& self) -> f64
PosProportions :: fn adjective_ratio(& self) -> f64
PosProportions :: fn adverb_ratio(& self) -> f64
fn pos_class_proportions(text : & str) -> PosProportionsClassify every word in text and tally counts per PosClass.

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier foundation with 27 other crates: foundation-audit-log, foundation-basemodels, foundation-bounded-io, foundation-conversation-closure, foundation-crypto-sign, foundation-decisioning, foundation-encounter-vocabulary, foundation-fs-metadata, … (27 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)foundation
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/foundation/text-signals
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
serde^1derive, derivenoalways

Development. None.

Build. None.

Depended on by. 3 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_domain_prose_shard["domain-prose-shard"] -->|uses| SELF
  n_domain_transcript_shard["domain-transcript-shard"] -->|uses| SELF
  n_foundation_text_deidentify["foundation-text-deidentify"] -->|uses| SELF
  SELF["foundation-text-signals"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libfoundation_text_signals`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

3 workspace crates depend on this one: domain-prose-shard, domain-transcript-shard, foundation-text-deidentify.

Verification

KindCount
Unit tests10
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root808

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc813
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 8
    "No rustdoc detected" : 5

Metrics

MetricValue
Rust source files1
Source lines393
Code lines300
Public API items13
Public modules0
Tests10
Examples0
Cargo features0
Direct runtime dependencies1
Workspace reverse dependencies3
pie showData
    title Public API by kind
    "constant" : 1
    "enum" : 1
    "function" : 4
    "method" : 5
    "struct" : 2
pie showData
    title Rust source composition
    "Code" : 300
    "Blank or comment" : 93

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All foundation · Manual