heasm66 / ZAbbrevMaker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZAbbrevMaker

Tool to make better abbreviations for ZIL and the z-machine. Input is the zap-files that results from compiling the zil-files. Typical workflow for Zilf:

zilf.exe game.zil
del game_freq.zap
ZAbbrevMaker.exe > game_freq.xzap
zapf.exe game.zap

Typical workflow for Inform6 (be sure that your gamefile includes the file abbrevs.h or paste in them directly in the gamefile):

inform6 -r $TRANSCRIPT_FORMAT=1 <game-path>\<game>.inf
ZAbbrevMaker.exe -i > abbrevs.h
inform6 -e $MAX_ABBREVS=96 <game-path>\<game>.inf

Precompiled binaries for linux-arm, linux-x64, osx-x64, win-x86, win-x64 & win-arm in the folder /ZAbbrevMaker/bin/SingleFile/.

Instructions

ZAbbrevMaker 0.10
ZAbbrevMaker [switches] [path-to-game]

 -a                 Create a tailor-made alphabet for this game and use it as basis for
					the abbreviations (z5+ only).
 -a0 <string>       Define 26 characters for alphabet A0.
 -a1 <string>       Define 26 characters for alphabet A1.
 -a2 <string>       Define 23 characters for alphabet A2.
					Experimental - works best when text encoding is in ISO-8859-1 (C0 or C1).
 -b                 Throw all abbreviations that have lower score than last pick back on heap.
					(This only occasionally improves the result, use sparingly.)
 -c0                Text character set is plain ASCII only.
 -cu                Text character set is UTF-8.
 -c1                Text character set is ISO 8859-1 (Latin1, ANSI).
 --debug            Prints debug information.
 -d                 Deep rounding. Try up yo 10,000 variants from discarded abbreviations
					and see if it gives better savings on account of z-chars rounding.
 -df                Try deep rounding and then fast rounding, in that order (default).
 -f                 Fast rounding. Try variants (add remove space) to abbreviations
					and see if it gives better savings on account of z-chars rounding.
 -fd                Try fast rounding and then deep rounding, in that order.
 -i                 The switch is deprecated (it will auto-detected)
					Generate output for Inform6. This requires that the file.
					'gametext.txt' is in the gamepath. 'gametext.txt' is generated by:
					   inform6 -r $TRANSCRIPT_FORMAT=1 <game>.inf
					in Inform6 version 6.35 or later. -i always use -r3.
 --infodump <file>  Use text extracted from a compiled file with the ZTool, Infodump.
					The file is generated by:
					   infodump -io <game> > <game>.infodump
					(Always used in conjunction with the -txd switch.)
 -n nn              # of abbreviations to generate (default = 96).
 --onlyrefactor     Skip calculation of abbrevations and only print information about duplicate long strings.
 -r3                Always round to 3 for fast and deep rounding. Normally rounding
					to 6 is used for strings stored in high memory for z4+ games.
 --txd <file>       Use text extracted from a compiled file with the ZTool, Txd.
					The file is generated by:
					   txd -ag <game> > <game>.txd
					(Always used in conjunction with the -infodump switch.)
 -v1 - v8           Z-machine version. 1-3: Round to 3 for high strings
									   4-7: Round to 6 for high strings
										 8: Round to 12 for high strings
 -v                 Verbose. Prints extra information.
 path-to-game       Use this path. If omitted the current path is used.

ZAbbrevMaker executed without any switches in folder with zap-files is
the same as 'ZAbbrevMaker -df'.

References

Algorithm

https://intfiction.org/t/highly-optimized-abbreviations-computed-efficiently/48753
https://intfiction.org/t/playable-version-of-mini-zork-ii/49326 https://gitlab.com/russotto/zilabbrs
https://github.com/hlabrand/retro-scripts

RA Wagner's Optimal Parse

https://ecommons.cornell.edu/server/api/core/bitstreams/b2f394c1-f11d-4200-b2d4-1351aa1d12ab/content https://dl.acm.org/doi/pdf/10.1145/361972.361982

Suffix Array

https://www.geeksforgeeks.org/suffix-array-set-2-a-nlognlogn-algorithm/ https://www.geeksforgeeks.org/kasais-algorithm-for-construction-of-lcp-array-from-suffix-array/?ref=ml_lbp https://stackoverflow.com/questions/57748988/kasai-algorithm-for-constructing-lcp-array-practical-example

About


Languages

Language:Visual Basic .NET 100.0%