parse_dictionaries icon indicating copy to clipboard operation
parse_dictionaries copied to clipboard

Help with MacOS 15.0 Public Beta

Open dgerrity opened this issue 1 year ago • 3 comments

Assert statement in reverse_data.py "_split()" is triggering on a malformed entry after 98% of the dictionary has been parsed. I've tried coding around it; however my python skills are zilch. The assert is looking for a valid entry starting with '<d:entry' and ending with '</d:entry>'. The assertion output seems to indicate that only the first tag was included as the entry and the reset of the entry got split into the remainder:

  File "/Users/dan/Documents/Dev/noad/reverse_data.py", line 311, in _split
    assert (entry_text.startswith('<d:entry') and
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: ENTRY: <d:entry xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng" id="ref_CountriesOfTheWorld" d:title="" class="entry">
 REM: b'<d:entry xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng" id="ref_CountriesOfTheWorld" d:title="" class="entry">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n<meta name="Generator" content="Pages 2.0.2" />\n<title></title>\n<link rel="stylesheet" type="text/css" media="screen" href="fbm.css" />\n</hea ... you\xe2\x80\x99ll never know if you don\xe2\x80\x99t try</div>\n</div>\n</div>\n</body>\n</html>\n</d:entry>\n'

MacOS Version 15.0 Beta (24A5298h) -rw-r--r-- 1 _nsurlsessiond wheel 25433314 May 28 21:42 /System/Library/AssetsV2/.../New Oxford American Dictionary.dictionary/Contents/Resources/Body.data

Is there any chance anyone else using this outstanding parser can help?

dgerrity avatar Aug 29 '24 17:08 dgerrity

Did you find any workaround around this this?

ryankaka92 avatar Mar 23 '25 22:03 ryankaka92

Did you find any workaround around this this?

Unfortunately, no. I wrote a bash script to look up words using Apple's dictionary app on the Mac, but there is no mobile opportunity.

dgerrity avatar Mar 24 '25 20:03 dgerrity

There's an older issue here that discusses this and contains a fix that worked for me on macOS Tahoe 26.0.1 (25A362).

forgot avatar Nov 05 '25 00:11 forgot