Recognize National Library patent evidence
This commit is contained in:
@@ -30,9 +30,12 @@ const sceneSevenManifest = JSON.parse(readFileSync(
|
||||
goals: { key:string;requiredFlags:string[] }[]
|
||||
evidenceMatchRules: { name:string;flagKey:string;minimumAnchorMatches:number;anchors:{ phrase:string;minimumSimilarity:number }[] }[]
|
||||
}
|
||||
const authoredPatentRule = sceneSevenManifest.evidenceMatchRules[0]
|
||||
const patentRule = { id:'rule-patent',...authoredPatentRule,
|
||||
anchors:authoredPatentRule.anchors.map((anchor,index) => ({ id:`anchor-${index}`,...anchor })) }
|
||||
const authoredPatentRule = sceneSevenManifest.evidenceMatchRules.find(rule => rule.name.startsWith('Google Patents'))!
|
||||
const authoredNationalLibraryRule = sceneSevenManifest.evidenceMatchRules.find(rule => rule.name.startsWith('Nasjonalbiblioteket'))!
|
||||
const materializeRule = (id:string, rule:typeof authoredPatentRule) => ({ id,...rule,
|
||||
anchors:rule.anchors.map((anchor,index) => ({ id:`${id}-anchor-${index}`,...anchor })) })
|
||||
const patentRule = materializeRule('rule-patent',authoredPatentRule)
|
||||
const nationalLibraryRule = materializeRule('rule-national-library',authoredNationalLibraryRule)
|
||||
|
||||
describe('evidence text matching', () => {
|
||||
it('normalizes historical Norwegian characters and page layout noise', () => {
|
||||
@@ -69,6 +72,12 @@ describe('evidence text matching', () => {
|
||||
expect(evaluation.matchedAnchorCount).toBeGreaterThanOrEqual(2)
|
||||
})
|
||||
|
||||
it('accepts the Norwegian National Library patent notice found during playtesting', () => {
|
||||
const evaluation = evaluateEvidenceRules(sceneSevenFixture('national-library-patent-ocr.txt'), [nationalLibraryRule])[0]
|
||||
expect(evaluation).toMatchObject({ matched:true,flagKey:'scene7.nils_inventor_proved' })
|
||||
expect(evaluation.matchedAnchorCount).toBeGreaterThanOrEqual(2)
|
||||
})
|
||||
|
||||
it('keeps the Scene 7 assignment empty and ties its goal to the source flag', () => {
|
||||
expect(sceneSevenManifest.documents).toEqual([])
|
||||
expect(sceneSevenManifest.goals).toEqual([
|
||||
@@ -78,8 +87,8 @@ describe('evidence text matching', () => {
|
||||
})
|
||||
|
||||
it('does not confuse the father-only source with proof about Nils', () => {
|
||||
expect(evaluateEvidenceRules(sceneSevenFixture('father-only-negative-ocr.txt'), [patentRule])[0])
|
||||
.toMatchObject({ matched: false })
|
||||
expect(evaluateEvidenceRules(sceneSevenFixture('father-only-negative-ocr.txt'), [patentRule,nationalLibraryRule]))
|
||||
.toEqual([expect.objectContaining({ matched:false }),expect.objectContaining({ matched:false })])
|
||||
})
|
||||
|
||||
it('tolerates a cropped, line-broken patent result without accepting unrelated patents or empty OCR', () => {
|
||||
|
||||
Reference in New Issue
Block a user