Repository navigation
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
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
…e, Inc." finds Acme instead of creating a second one Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_stemsplits on spaces and keeps everything before the suffix word, comma included, so the stem isacme,. Every recall key then carries the comma (acme,,acme, inc,inc acme,…), and none of them meets an existingAcmeorAcme 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_comma_before_the_generic_suffix_is_not_part_of_the_stem, expectsname_stem("Acme, Inc.")to beacme,name_stem("Orion Labs, Inc")to beorion labs,recall_keys("Acme, Inc.")to includeacmeandacme inc, andname_stem(", Inc.")to be none.left: Some("acme,"),right: Some("acme").cargo test -p utopia-store --lib: 94 passed.cargo fmt --all --checkandcargo clippy -p utopia-store --lib -- -D warnings(dev and test profiles) pass.--all-targetsstops on anonminimal_boollint already ondevintests/store/ontology_regressions.rs:259, which this PR does not touch.Before review
git commit -s)cargo fmt --all --check,cargo clippyandcargo testpass for the touched crate