TRANS(1) NAME bf_trans, sw_trans, KR_trans, eKR_trans, sAC_trans SYNOPSIS bf_trans rulefile [file ...] sw_trans [-b] rulefile [file ...] KR_trans [-F sep] rulefile [file ...] eKR_trans [-F sep] rulefile [file ...] sAC_trans rulefile [file ...] DESCRIPTION Trans is a set of tools that extends the power of unix command tr so that strings can be handled instead of characters. Translation target is files in the argument. If no file is given, the standard input will be used instead. Bf_trans stands on brute force algorithm. Thus not recommented. This algorithm exist only to evaluate other algorithms. Sw_trans stand on sandwitch algorithm. This algorith is applied to u9fs because of memory efficiency. You probably don't know the name, because the algorithm and the naming are of mine. KR_trans stands on Karp-Rabin algorithm. Thus this is only applicable in case all keys are same length. Very fast. EKR_trans stands on also Karp-Rabin algorithm, but extended so that keys need not be same length. Very fast. In special cases, eKR_trans may lose the speed. Probably this defect will be overcome. SAC_trans stands on simplified Aho-Corasick algorithm. This algorithm uses trie and wastes much memory. Thus not recommented. Option '-b' means binary mode. Without this option, sw_trans assumes the input as utf-8 text. In option '-F sep', sep is field separator. If this option is given, all lines must have two fields. Without separator given, fields in rulefile is assumed tokenized. For the temporally, this option is only for KR_trans. The rule is given in the rule file of the first argument of trans. The format is as below. Sharp symbol "#" at the first column of lines means comment. The comment line at the beginning of file is special. In the line, "unicode" and "hex" are keywords that specifies the format of the rule file. In other non-comment lines, only first two fields are consulted. Here, `field' is defined by using space separated tokenized rule in the manner of rc(1). Thus, '' denote empty string. Empty string in the first field is prohibited. Empty string in the second field means deletion of the string in the first field. Lines containing less than two fields are discarded. fields more than third field are also discarded. EXAMPLES Two lines in rule file: alice bob bob alice will swap "alice" and "bob" in text. Three lines in rule file: alice bob bob carol carol alice will rotate "alice", "bob" and "carol" in text. The rule '#' '' is equivalent to unix command tr -d '#' The rule # hex 0d '' will remove all CR codes. Three lines in rule file: # hex 61:6c:69:63:65 62:6f:62 62:6f:62 61:6c:69:63:65 will also swap "alice" and "bob" in text. Trans was originary designed for unicode conversion NFD to NFC. Therefore trans has rule format suitable for the unicode: # unicode # Latin letters 0061:0308 00E4 ä 0065:0308 00EB ë 0069:0308 00EF ï 006F:0308 00F6 ö 0075:0308 00FC ü 0079:0308 00FF ÿ SOURCE http://plan9.aichi-u.ac.jp/netlib/cmd/trans/ AUTHER Kenji Arisawa