Repository navigation
docs/audio: document hashdict.py --lookup, the reverse name lookup (EGEN-HASHDICT-LOOKUP-DOC) - #6912
Conversation
The dictionary the two commands here build could only be consumed by awc_names.py; hashdict.py itself takes --lookup <dict> <hash>... and prints the name it holds for each 32-bit joaat hash, or '?'. No page named the mode or its arguments.
shayderrr
left a comment
There was a problem hiding this comment.
Summary
docs/audio.md adds a paragraph next to the dictionary build/consume commands documenting tools/hashdict.py --lookup <dict.json> <hash>...: it takes a dictionary path followed by one or more hexadecimal 32-bit joaat hashes, prints each name or ?, and needs no carve folder. Source lines are cited for the reader who wants to verify the format.
Why merge
The reverse lookup mode is the way to answer "which wave is this id" when another tool prints only a hash, yet no page named the flag, its argument order, or its no-carve-folder property. Documenting it where the dictionary is introduced makes the tool's other half discoverable. Docs-only.
Verdict: Approve
Summary
Why mergeThe reverse lookup mode is the way to answer "which wave is this id" when another tool prints only a hash, yet no page named the flag, its argument order, or its no-carve-folder property. Documenting it where the dictionary is introduced makes the tool's other half discoverable. Docs-only. Verdict: Approve |
docs/audio.md names the dictionary
tools/hashdict.pybuilds and the two commands that use it, but not the tool's other half:--lookuptakes a dictionary path followed by one or more 32-bit joaat hashes and prints the name the dictionary holds for each, or?. No page named the mode, its argument order, or that it needs no carve folder (tools/hashdict.py:70,72-93). That is the way to answer "which wave is this id" when another tool prints a hash and nothing else.Adds four lines next to the two commands that build and consume the dictionary, with the source lines for a reader who wants to check the format.
Verification (docs-only, no new test; a hand-written dictionary, no game files)
Before the paragraph there was no documented way to run the mode. The command now documented, run from the branch:
(
0is the dictionary's entry for the empty string;12345678is absent, so it prints?.) No carve folder was passed, as the paragraph says.The doc lint CI runs also pass on the branch:
tests/test_docs_*.py, 11 files, 0 failures, andtests/test_hashdict.py35 tests OK.No GPU is needed.
Notes
docs/audio.mdbecause that is where the dictionary is introduced and used;docs/rpf.mdanddocs/design.mdonly mention the file name. A new page for one flag would have added an index row for nothing.--lookupreads the dictionary with plainutf-8(tools/hashdict.py:82), so a dictionary re-saved with a UTF-8 BOM is refused withUnexpected UTF-8 BOM. That is the same class as the open hashdict: read a carve index.json saved with a UTF-8 BOM (EGEN-HASHDICT-INDEX-BOM) #6871 for the carveindex.jsonin this file; I left it out so this PR stays docs-only. Documenting the mode against a dictionary the tool itself writes (no BOM) is correct as it stands.--lookup(nargs="+"), which is why the example puts it there.AI-assisted.