oed_prettifier icon indicating copy to clipboard operation
oed_prettifier copied to clipboard

Duplicated entries

Open Commodore64user opened this issue 8 months ago • 4 comments

Multiple entries are found under different headwords, exact same html, different headword that’s all.

hunkey	<b>hunkey, hunkie, hunky</b>\n<blockquote><abr>varr.</abr> <kref>hunk</kref> <abr>n.</abr><sup>3</sup></blockquote>
hunkie	<b>hunkey, hunkie, hunky</b>\n<blockquote><abr>varr.</abr> <kref>hunk</kref> <abr>n.</abr><sup>3</sup></blockquote>

Could do a sha256 to compare them and eliminate duplicates but will need to look more into which versions to keep, or if they simply happen to coincidentally share the same html.

Commodore64user avatar Mar 20 '26 18:03 Commodore64user

so, there are some entries that coincidentally share the same html, for example

disdenominationalize	<blockquote>see <kref>dis-</kref> 6.</blockquote>
disdub	<blockquote>see <kref>dis-</kref> 6.</blockquote>

performing a sha256 before any of our changes are applied is probably the incorrect approach, furthermore entry derring-do, won't match before conversion due to missing specifically this addition here

https://github.com/Commodore64user/oed_prettifier/blob/f6fbae4b92c81519dec8276502b5e8416a2cfbea/entry_processor.py#L382-L384

so correct approach here seems to be to run the whole conversion on all lines and then deduplicate with sha256 comparisons

after conversion, we should get different hashes (good).

--> HTML Dump for 'disdenominationalize':
<span class="headword"><b>disdenominationalize</b></span>
<blockquote>see <span class="kref">dis-</span> 6.</blockquote>

--> HTML Dump for 'disdub':
<span class="headword"><b>disdub</b></span>
<blockquote>see <span class="kref">dis-</span> 6.</blockquote>

Commodore64user avatar Mar 21 '26 14:03 Commodore64user

- Total duplicate entries dropped:  21,950
- Total mismatched entries dropped: 3,334

Commodore64user avatar Mar 27 '26 18:03 Commodore64user

deduplication in #36 seems to be working correctly, there are some entries avoiding our checks:

--> Duplicated entry found: 'cos'
    hw_forms: ["cos, 'cos, adv. and conj."]
    candidates: ['cos', "'cos"]
        * 'cos': pos=0, expanded_only=0, paren_only=0, len=3
        * ''cos': pos=5, expanded_only=0, paren_only=0, len=4
    'cos' is a duplicate of: ''cos'
    From headword: >> cos, 'cos, adv. and conj. <<
    Merging ''cos' into 'cos'

--> Sanity checks and deduplication in progress...

    Quarantine trial: ''cos' confirmed duplicate — sending to Gaol
     Headword span: >> cos, n. <<

    Quarantine trial: ''cos' not a duplicate — reinstating
     Headword span: >> cos <<
--> HTML Dump for ''cos':
<b><sup>III</sup></b> <span class="headword"><b>cos</b></span> <blockquote>
<span class="abbreviation">var.</span> of <span class="kref">coss</span>; 
<span class="abbreviation">obs.</span> <span class="abbreviation">f.</span> 
<span class="kref">kiss</span>.</blockquote>

--> HTML Dump for 'cos':
<b><sup>III</sup></b> <span class="headword"><b>cos</b></span>   <blockquote>
<span class="abbreviation">var.</span> of <span class="kref">coss</span>; 
<span class="abbreviation">obs.</span> <span class="abbreviation">f.</span> 
<span class="kref">kiss</span>.</blockquote>

but that is not a problem with this class, rather a problem with EntryProcessor that should be fixed there.

Commodore64user avatar Mar 29 '26 21:03 Commodore64user

as of 36eca82c60ac06ebd8c90b5f5216555d042f8739 we are officially dropping every single mismatched entry through a hash-duplication check, yay!

----------------------------------------------------
Process complete. New dictionary 'OED_2nd.ifo' created.
----------------------------------------------------
Metrics:
- Entries read from source TSV:     279,011
- Entries with homographs split:    26,007
- Unique headwords processed:       279,010
- Unique definition hashes:         299,551
- Malformed lines skipped:          0
- Synonyms added from b-tags:       507,710
- Words found ending in full stops: 1,678
- Full stops corrected:             1,524
- Hashes with duplicates:           15,572
- Mismatched entries dropped:       3,334
- Total entries dropped:            22,129
- Total final entries written:      299,551
- Total execution time:             09:15
----------------------------------------------------

Commodore64user avatar Apr 08 '26 23:04 Commodore64user