Skip to content

catalog: add --write-dict to accumulate recovered names into a sorted dict - #14

Closed
tarnobrzeg123-collab wants to merge 1 commit into
nineforge0:mainfrom
tarnobrzeg123-collab:feat/catalog-dict-export
Closed

tarnobrzeg123-collab wants to merge 1 commit into
nineforge0:mainfrom
tarnobrzeg123-collab:feat/catalog-dict-export

Conversation

@tarnobrzeg123-collab

Copy link
Copy Markdown
Contributor

Closes #12

Summary

  • Adds merge_dict and write_dict to src/rpf9/hashes.rs to merge hexhash name entries into an existing (or new) dictionary file, deduplicating by hash, preserving existing confirmed entries on conflict, and writing sorted 0x{:08x} name lines (one per line).
  • Adds --write-dict <PATH> to forge9 catalog so confirmed candidates — unambiguous single-candidate joaat matches and embedded resource labels whose name (or stem before .#) hashes to the entry's name hash — accumulate across runs and archives. Ambiguous multi-candidate hashes are skipped and reported on stderr so --json stdout stays clean.
  • Documents the workflow in README.md.
  • Adds synthetic-data unit tests (rpf9::hashes::tests::merge_dict_dedups_sorts_and_preserves_existing and tests::catalog_write_dict_accumulates_sorted_deduped_entries) covering multi-run accumulation, reload via --dict, deduplication, sorting, and skipping ambiguous hashes.

Testing

  • cargo build --release — succeeded with 0 warnings.
  • cargo test --release — all 66 tests pass (59 library + 7 binary), synthetic data only, no game files used.
  • ./target/release/forge9 catalog --help — verified --write-dict <PATH> option.

@nineforge0 nineforge0 closed this Nov 25, 2026
@nineforge0

Copy link
Copy Markdown
Owner

Merged manually (resolved a conflict with the recent record-layout fix). The commits are on main. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build a recovered-names dictionary from catalog candidates

2 participants