SubSpanGuard
Rejects a match where one prompt is the other plus a clause that narrows the question.
How do I deploy a Rails app and How do I deploy a Rails app on Heroku share every word the shorter one has, so overlap is perfect and LexicalDivergenceGuard sees nothing. They embed close for the same reason. And they need different answers, because the second is asking about Heroku.
This is the gap between the lexical guards and the dev.kmemo.Verifier. The other guards look for a word that changed; nothing here changed, something was added, and what was added is the part that decides the answer.
The three conditions, and why a looser rule does not work
The naive version — "some clause in one prompt has no counterpart in the other" — refuses genuine paraphrases in bulk, because people frame questions differently: I am working on a REST client and need to parse an ISO 8601 timestamp in Java is the same question as How do I parse an ISO 8601 timestamp in Java, and its first clause matches nothing. So all three of these must hold:
One prompt's content words contain the other's, compared with Text.isSameWord so a typo or a spelling variant is not a difference. Two prompts that were merely reworded fail here, which is what keeps
My connection to the server keeps dropping after a few minutes of sitting idlefrom being read as a narrowed form ofHow do I stop my SSH session from timing out.The added words all sit in one span. Framing spreads across a sentence; a qualifier is local. The REST client example adds words to two different spans and is left alone.
That span opens with a qualifier, one of Vocabulary.QUALIFIER_OPENERS —
on,for,with,without,after, and the rest.on Herokuqualifies the question.I am working on a REST clientopens with a pronoun and does not.
Each condition is a way of demanding that the addition be the answer-bearing kind rather than merely present, which is the same asymmetry every guard here is built on: a wrong rejection costs one API call, a wrong acceptance costs a wrong answer.
Parameters
function words removed before the prompts are compared.
words that begin a clause narrowing a question rather than framing it.
Properties
Short stable identifier, surfaced in dev.kmemo.CacheLookup.Miss.detail.