Skip to content

A company name with a comma before "Inc." recalls its entity, so "Acme, Inc." finds Acme instead of creating a second one - #1433

Open
rudycelekli wants to merge 1 commit into
deeplethe:devfrom
rudycelekli:name-stem-comma
Open

rudycelekli wants to merge 1 commit into
deeplethe:devfrom
rudycelekli:name-stem-comma

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Why

Name recall strips one generic word (Inc, Corp, Project, Team) to find the stem, so "Acme Inc." recalls "Acme" and "Acme Inc". The usual English spelling of a company name puts a comma before the suffix: "Acme, Inc.", "Orion Labs, Inc". name_stem splits on spaces and keeps everything before the suffix word, comma included, so the stem is acme,. Every recall key then carries the comma (acme,, acme, inc, inc acme,…), and none of them meets an existing Acme or Acme Inc. entity. The mention is resolved against no candidates, and a filing that writes "Acme, Inc." creates a second Acme next to the one the rest of the corpus already built.

What changes

A comma left at the end of the English stem is dropped before the stem is returned. If nothing is left, there is no stem, so ", Inc." alone still gives none. CJK suffixes and the leading-word form ("Project Phoenix") are unchanged.

How it was checked

  • A new test, a_comma_before_the_generic_suffix_is_not_part_of_the_stem, expects name_stem("Acme, Inc.") to be acme, name_stem("Orion Labs, Inc") to be orion labs, recall_keys("Acme, Inc.") to include acme and acme inc, and name_stem(", Inc.") to be none.
  • With the fix reverted the test fails: left: Some("acme,"), right: Some("acme").
  • cargo test -p utopia-store --lib: 94 passed.
  • cargo fmt --all --check and cargo clippy -p utopia-store --lib -- -D warnings (dev and test profiles) pass. --all-targets stops on a nonminimal_bool lint already on dev in tests/store/ontology_regressions.rs:259, which this PR does not touch.

Before review

  • Every commit is signed off (git commit -s)
  • cargo fmt --all --check, cargo clippy and cargo test pass for the touched crate

…e, Inc." finds Acme instead of creating a second one

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant