home *** CD-ROM | disk | FTP | other *** search
/ CD Action 16 B / cdactioncoverdisc / polonica.rar / TKNZTBLD.CPL < prev    next >
Text File  |  1995-06-25  |  29KB  |  824 lines

  1. ####################################################################
  2. #
  3. #
  4. # File: tknztbld.def
  5. #
  6. # Personal Library Software, July, 1993
  7. # Tom Donaldson
  8. #
  9. # Tokenizer definitional data for table driven tokenizer:
  10. #     CplTabledRomanceTokenizer.
  11. #
  12. # The CplTabledRomanceTokenizer allows customization of tokenization by
  13. # editing rules that define the operation of the tokenizer.  Central
  14. # concept is "word continuation" rules, defining characters-kinds that
  15. # CANNOT be split from each other.
  16. #
  17. # History
  18. # -------
  19. #
  20. # 29jul1993     tomd    Performance improvements.  Got rid of unused
  21. #                       character classes.  Defined all non-token chars
  22. #                       to be "break" character class.  Ordered
  23. #                       user-defined character classes by expected
  24. #                       frequency in text.
  25. #
  26. #                       Also added performance hints throughout.
  27. #
  28. # 26aug93       tomd    No longer need to map all chars to char-classes.
  29. #                       Unmapped ones will default to break-chars.
  30. #
  31. #                       No longer need to assign numeric values to character
  32. #                       classes.  No longer need to assign names to predefined
  33. #                       character classes (and cannot).
  34. #
  35. #                       Canonizer map no longer has to contain all
  36. #                       characters.
  37. #
  38. ####################################################################
  39.  
  40.  
  41.  
  42. ####################################################################
  43. #
  44. # Installation
  45. # ============
  46. #
  47. # Database.def File
  48. # -----------------
  49. #
  50. # To use the CplTabledRomanceTokenizer, you need this line in the .def
  51. # file for the database:
  52. #
  53. # TOKENIZER = CplTabledRomanceTokenizer
  54. #
  55. #
  56. # Tokenizer File
  57. # --------------
  58. #
  59. # This file, tknztbld.def, is the rule file.  Note that the name of the
  60. # file CANNOT be changed, and the file MUST be in the "home directory"
  61. # of the database using the tokenizer, or the "system" directory for
  62. # the CPL installation.
  63. #
  64. ####################################################################
  65.  
  66.  
  67. ####################################################################
  68. #
  69. # Operational Overview
  70. # ====================
  71. #
  72. # Database Open
  73. # -------------
  74. #
  75. # When a database is opened, its .def file is read.  In the .def file,
  76. # a non-default tokenizer may be specified via a line of the form
  77. #
  78. # TOKENIZER = aTokenizerName
  79. #
  80. # If aTokenizerName is "CplTabledRomanceTokenizer", as soon as the
  81. # tokenizer is needed, it will try to read its definition file (i.e.,
  82. # this tknztbld.def file) from the same directory as the database's .def
  83. # file.
  84. #
  85. # If a problem arises during the load, tokenizer creation will fail.  In
  86. # this case, please do a "diff" between the file that failed to load and
  87. # the original copy.  Regretfully, few diagnostic error messages are
  88. # currently available to assist in determining why tokenizer definition
  89. # rules did not load.
  90. #
  91. # During Tokenization
  92. # -------------------
  93. #
  94. # As a buffer is scanned for words, each character is converted to a
  95. # "character class" via a Character Classification Map.  The character
  96. # classes are compared against tokenization rules, defined in this file.
  97. # If the rules explicitly state that the current character code may not
  98. # be separated from the preceeding one, then the current character is
  99. # treated as part of a word, and the next character is classified and
  100. # tested.  This process continues until the scanner finds a character
  101. # whose classification is not specified in the rules as always being
  102. # kept with the character class of the just-preceeding character.
  103. #
  104. #
  105. # Performance Hints
  106. # =================
  107. #
  108. # The table driven tokenizer allows a great deal of flexibility in
  109. # scanning words.  It is possible to create a tokenizer definition that
  110. # will scan complex patterns as tokens, or not, depending upon the
  111. # immediate context of the characters being scanned.  However, this
  112. # flexibility comes at a price: performance.
  113. #
  114. # In general, the simpler and fewer the character classes and rules the
  115. # faster tokenization will be.  That is, the closer the rules come to
  116. # generating tokens that would pass the simple isalnum() test, the
  117. # faster tokenization will be.  The further your needs depart from this
  118. # simplicity, the longer it will take to index files.
  119. #
  120. #
  121. ####################################################################
  122.  
  123.  
  124. ###################################################################
  125. #
  126. #
  127. # Required File Layout
  128. # ====================
  129. #
  130. # This tokenizer definition file, tknztbld.def, must contain the
  131. # following sections in this order:
  132. #
  133. #     Section 1: Character Class Definitions
  134. #
  135. #     Section 2: Character Classification Map
  136. #
  137. #     Section 3: Word Continuation Rules
  138. #
  139. #     Section 4: Canonization Map
  140. #
  141. # Section 1, the "Character Class Definitions", gives meaningful names
  142. # to "kinds" of characters.  These class names are used in definining
  143. # what kinds of characters make up words.
  144. #
  145. # Section 2, the "Character Classification Map", assigns a character
  146. # class to each character in the character set used by documents.
  147. #
  148. # Section 3, the "Word Continuation Rules", uses the character class
  149. # names defined in the Character Class Definitions to specify what
  150. # groupings of characters may not be separated from each other during
  151. # toknization.
  152. #
  153. # Section 4, the "Canonization Map", specifies translations of
  154. # characters from their raw input form to their final "canonical"
  155. # indexed form.
  156. #
  157. # The detailed structure of each section of the tokenizer definition is
  158. # covered in comments accompanying the sections, below.
  159. #
  160. # The lines in this file that are preceeded by the pound character, '#',
  161. # are comment lines (obviously).  Comments may only appear on a line by
  162. # themselves, but comment lines may appear anywhere in the file.
  163. # Likewise, blank lines may appear anywhere in the file.
  164. #
  165. ####################################################################
  166.  
  167.  
  168. ####################################################################
  169. #
  170. # Section 1: Character Class Definitions
  171. #
  172. ####################################################################
  173. #
  174. # The Character Class Definitions give names to the types of
  175. # characters that can take part in words, and that delimit words.  These
  176. # names will be used in Section 2, the Character Classification Map, to
  177. # assign character classes to individual characters.
  178. #
  179. # You may define up to 250 character classes, although fewer than 10
  180. # will most likely be enough.  Every character than can possibly ever
  181. # appear in the data to be tokenized MUST be assigned one of the defined
  182. # classes.  The mapping is done via a character-class map, which appears
  183. # that the end of this file.
  184. #
  185. #
  186. # Predefined Special Values
  187. # =========================
  188. #
  189. # There are four predefined values that are special to the tokenizer:
  190. #
  191. #     Invalid - NO character should EVER be of this class.
  192. #
  193. #     EndRule - This is a character class that is used in this
  194. #               definition file to mark the end of your character
  195. #               classification names.  It must be the last character
  196. #               class name listed in the table below, and can only be
  197. #               the last one listed.
  198. #
  199. #     Break --- Characters of the "Break" class can NEVER be part of a
  200. #               token.  It is always valid for the tokenizer to
  201. #               word-break the datastream either before or after a Break
  202. #               character.
  203. #
  204. #     EndBuff - Characters of the EndBuff class will be treated as a
  205. #               "null" terminating character when scanning data for
  206. #               tokens.  The ASCII NUL character is an EndBuff character
  207. #               by default, and you will not normally map other
  208. #               characters to this class.
  209. #
  210. #
  211. # Only predefined Character Class names, or Character Class names that
  212. # are defined in this Character Class Definition section may be used
  213. # anywere else in the definition.  Definitions are case sensitive.
  214. #
  215. #
  216. # Performance Hints
  217. # =================
  218. #
  219. # 1) Use The "Break" Class As Much As Possible.  The Break class is a
  220. # special character class.  Minimal testing is done on characters
  221. # classified as Break.  This is because it is ALWAYS valid to separate a
  222. # Break character from any other character.  Any characters that will
  223. # NEVER be part of a token should be classified as Break.
  224. #
  225. # 2) Define Class Names By Frequency.  When creating user-defined character
  226. # classes, list the classes that will be assigned to the largest numbers
  227. # of characters in the data first.  For example, you would expect most
  228. # data in a text file to classified as "letter" characters; you should
  229. # define your "letter" class name first.
  230. #
  231. # 3) Define As Few Classes As Possible.  Fewer classes means less
  232. # testing.  Less testing means faster tokenization.
  233.  
  234.  
  235. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  236. #
  237. #  Default Character Class Definitions: Values and Names
  238. #
  239. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  240. #
  241. #
  242. # Name
  243. # ----
  244.   Letter
  245.   Number
  246.   Dot
  247.   Dollar
  248.   Bang
  249.   Underscore
  250.   Paragraf
  251.   Space
  252. #
  253. # The EndRule character class must always be the last class name listed,
  254. # and must only appear at the end of your character class definitions.
  255. # If it is not at the end of char class defs, an error occurs as soon as
  256. # the loader hits a non-blank, non-comment line that is not a character
  257. # class definition.
  258. #
  259.   EndRule
  260.  
  261. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  262.  
  263.  
  264. ####################################################################
  265. #
  266. # Section 2: Character Classification Map
  267. #
  268. ####################################################################
  269. #
  270. # Maps characters to word-continuation character classes.
  271. #
  272. # The Character Classification Map associates a character code with a
  273. # character class.  The character classes must have been defined in the
  274. # Character Class Definition in Section 1.  Only character class names
  275. # that have been defined in the Character Class Definition (Section 1,
  276. # above) may appear in this Character Classification Map (Section 2) or
  277. # in the Word Continuation Rules (Section 3, below).
  278. #
  279. # Default Mapping
  280. # ===============
  281. #
  282. # You only need to provide character classification for the characters
  283. # that you want to appear in tokens.
  284. #
  285. # Any characters that you do NOT map will be classified in this way:
  286. #     - ASCII NUL is mapped as the end-of-buffer marker.
  287. #     - All other characters are mapped as break characters.
  288. #
  289. #
  290. # End Of Map Marker
  291. # =================
  292. #
  293. # As for the previous table, there is a special value for this Character
  294. # Classification Map that marks its end.  The special value is -1.  The
  295. # decimal character code -1 will cause the Character Classification Map
  296. # loader to stop reading.
  297. #
  298. #
  299. # Performance Hints
  300. # =================
  301. #
  302. # Leave as many characters classified as "break" characters as possible.
  303. # Classify as may characters to the same class as possible.
  304. #
  305. # The following sample table uses Dollar and Bang classes for tokenizing
  306. # specialized technical documentation.  If you don't need the Dollar and
  307. # Bang characters in indexable terms, change their mapping to Break, and
  308. # remove all references to Dollar and Break in the Character Class
  309. # Definitions and the Word Continuation Rules.  Your database will index
  310. # faster.
  311.  
  312.  
  313. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  314. #
  315. #  Character Classification Map
  316. #
  317. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  318. #
  319. # -------       -----           -----------------------
  320. # Decimal       Class
  321. #  Value        Name            Comment
  322. # -------       -----           -----------------------
  323. # Special characters:
  324.    33           Bang            # Char '!', used as a prefix for
  325.                                 # per-record identifier.
  326.  
  327.    36           Dollar          # Char '$', can be part of device
  328.                                 # names and other special symbols.
  329.    46           Dot             # kropeczka '.'
  330.    167          Paragraf        # Paragraf
  331.    32           Space           # Spacja
  332. # Digits:
  333.    48           Number          # Char '0'
  334.    49           Number          # Char '1'
  335.    50           Number          # Char '2'
  336.    51           Number          # Char '3'
  337.    52           Number          # Char '4'
  338.    53           Number          # Char '5'
  339.    54           Number          # Char '6'
  340.    55           Number          # Char '7'
  341.    56           Number          # Char '8'
  342.    57           Number          # Char '9'
  343.    91           Number          # Char '['
  344.    93           Number          # Char ']'
  345.  
  346. # Upper case letters:
  347.    65           Letter          # Char 'A'
  348.    165          Letter          # Char 'A' pol
  349.    66           Letter          # Char 'B'
  350.    67           Letter          # Char 'C'
  351.    198          Letter          # Char 'C' pol
  352.    68           Letter          # Char 'D'
  353.    69           Letter          # Char 'E'
  354.    202          Letter          # Char 'E' pol
  355.    70           Letter          # Char 'F'
  356.    71           Letter          # Char 'G'
  357.    72           Letter          # Char 'H'
  358.    73           Letter          # Char 'I'
  359.    74           Letter          # Char 'J'
  360.    75           Letter          # Char 'K'
  361.    76           Letter          # Char 'L'
  362.    163          Letter          # Char 'L' pol
  363.    77           Letter          # Char 'M'
  364.    78           Letter          # Char 'N'
  365.    209          Letter          # Char 'N' pol
  366.    79           Letter          # Char 'O'
  367.    211          Letter          # Char 'O' pol
  368.    80           Letter          # Char 'P'
  369.    81           Letter          # Char 'Q'
  370.    82           Letter          # Char 'R'
  371.    83           Letter          # Char 'S'
  372.    140          Letter          # Char 'S' pol
  373.    84           Letter          # Char 'T'
  374.    85           Letter          # Char 'U'
  375.    86           Letter          # Char 'V'
  376.    87           Letter          # Char 'W'
  377.    88           Letter          # Char 'X'
  378.    89           Letter          # Char 'Y'
  379.    90           Letter          # Char 'Z'
  380.    143          Letter          # Char 'Zi' pol
  381.    175          Letter          # Char 'Zy' pol
  382. # Underscore
  383.    95           Underscore      # Char '_'
  384. # Lower case letters:
  385.    97           Letter          # Char 'a'
  386.    185          Letter          # Char 'a' pol
  387.    98           Letter          # Char 'b'
  388.    99           Letter          # Char 'c'
  389.    230          Letter          # Char 'c' pol
  390.    100          Letter          # Char 'd'
  391.    101          Letter          # Char 'e'
  392.    234          Letter          # Char 'e' pol
  393.    102          Letter          # Char 'f'
  394.    103          Letter          # Char 'g'
  395.    104          Letter          # Char 'h'
  396.    105          Letter          # Char 'i'
  397.    106          Letter          # Char 'j'
  398.    107          Letter          # Char 'k'
  399.    108          Letter          # Char 'l'
  400.    179          Letter          # Char 'l' pol
  401.    109          Letter          # Char 'm'
  402.    110          Letter          # Char 'n'
  403.    241          Letter          # Char 'n' pol
  404.    111          Letter          # Char 'o'
  405.    243          Letter          # Char 'o' pol
  406.    112          Letter          # Char 'p'
  407.    113          Letter          # Char 'q'
  408.    114          Letter          # Char 'r'
  409.    115          Letter          # Char 's'
  410.    156          Letter          # Char 's' pol
  411.    116          Letter          # Char 't'
  412.    117          Letter          # Char 'u'
  413.    118          Letter          # Char 'v'
  414.    119          Letter          # Char 'w'
  415.    120          Letter          # Char 'x'
  416.    121          Letter          # Char 'y'
  417.    122          Letter          # Char 'z'
  418.    159          Letter          # Char 'zi' pol
  419.    191          Letter          # Char 'zy' pol
  420. # ---           -----           -----------------------
  421.    -1           EndOfDefs       # Not loaded.  Just marks end of map definition.
  422. # ---           -----           -----------------------
  423.  
  424.  
  425. ####################################################################
  426. #
  427. # Section 3: Word Continuation Rules
  428. #
  429. ####################################################################
  430. #
  431. # The word continuation rules specify which sequences of characters
  432. # CANNOT be separated from each other in breaking a stream of data into
  433. # words.
  434. #
  435. # Each rule consists of character class names seperated by spaces or
  436. # tabs.  A rule says that characters of the specified classes may not be
  437. # split.  For example, the rule:
  438. #
  439. #   Letter Letter
  440. #
  441. # says that when two data characters are of class Letter, and occur side
  442. # by side, the data characters may not be separated.
  443. #
  444. # Similarly, the rule:
  445. #
  446. #   Letter Number
  447. #
  448. # says that a character that classifies as a Letter may not be separated
  449. # from a following character that classifies as a Number.
  450. #
  451. # Example 1:
  452. #
  453. # How does the tokenizer decide whether a character is a Letter or a
  454. # Number?  That association is formed by the Character Classification
  455. # Map, in Section 2.  Using the Character Classification Map in this
  456. # file, and the two "Letter Letter" and "Letter Number" rules just
  457. # presented, the following input text:
  458. #
  459. #   "A-1   B 2   C3   4D   5 E   6-F   GH   IJ7LMNOP"
  460. #
  461. # Will tokenize as:
  462. #
  463. #   "A" "B" "C3" "D" "E" "F" "GH" "IJ7" "LMNOP"
  464. #
  465. # Because: A Letter may not be seperated from a following Letter, and a
  466. # Letter may not be separated from a following Number.  However, a
  467. # Number may be separated from a following Letter, and all other
  468. # characters are considered as delimiters.  Obviously, we need more
  469. # rules.  A more complete sample set follows.
  470.  
  471.  
  472. # Character Class Names, and '*'
  473. # ------------------------------
  474. #
  475. # All character class names in each rule MUST have been defined in the
  476. # Character Class Definitions in Section 1, above, with the exception of
  477. # one special "name": the '*' character.  The '*' character means that
  478. # characters of the preceeding class may occur one or more times in a
  479. # sequence.
  480. #
  481. # Note that in previous rule we said that no two letters could be
  482. # separated.  We did this with the rule:
  483. #
  484. #     Letter Letter
  485. #
  486. # But what if a single letter, such as the "A" in "Section A", occurs by
  487. # itself?  The "Letter Letter" rule does NOT say that "A" is a valid
  488. # token.  The following two rules together DO say that a single letter,
  489. # or any number of letters in a row, must be treated as a token:
  490. #
  491. #     Letter
  492. #     Letter Letter
  493. #
  494. # However, we can reduce this to a single rule using the special
  495. # character class name "*":
  496. #
  497. #     Letter *
  498. #
  499. #
  500. #
  501. # Example 2: "Unusual" Characters In Tokens
  502. #
  503. # This rule:
  504. #
  505. #   Dollar * Letter
  506. #
  507. # Says that a stream of Dollar characters may not be broken if they are
  508. # followed by a Letter.  This rule will cause these strings to be
  509. # treated as words:
  510. #
  511. #   "$$SysDevice"
  512. #   "$Fr$ed"
  513. #   "$x8"
  514. #
  515. # But the same "Dollar * Letter" rule will not accept these strings:
  516. #
  517. #   "SysDevice$$$"  -- Token will be "SysDevice", "$$$" is junk.
  518. #   "Fr$ed"         -- Tokens will be "Fr" and "$ed".
  519. #   "x$8"           -- Token will be "x", the "$" and "8" will be
  520. #                      discarded.
  521. #
  522. #
  523. #
  524. # Example 3:  More Complex Rules
  525. #
  526. # Using the example rules to this point, the string:
  527. #
  528. #   "tomd@pls.com"
  529. #
  530. # Will be tokenized as:
  531. #
  532. #   "tomd" "pls" "com"
  533. #
  534. # To cause tomd@pls.com to be accepted as a token, we can define this
  535. # rule:
  536. #
  537. #   Letter * AtSign Letter * Dot Letter *
  538. #
  539. # Or define these equivalent rules:
  540. #
  541. #   Letter *
  542. #   Letter AtSign
  543. #   AtSign Letter
  544. #   Letter Dot Letter
  545. #
  546. #
  547. #
  548. # Implicit Linking of Rules
  549. # -------------------------
  550. #
  551. # It is important to note that rules functionally link to each other.
  552. # For example, we used these two rules in the previous example:
  553. #
  554. #   Letter AtSign
  555. #   AtSign Letter
  556. #
  557. # That is, a Letter may not be separated from a following AtSign, and an
  558. # AtSign may not be separated from a following Letter, which
  559. # functionally has the same effect as:
  560. #
  561. #   Letter AtSign Letter
  562. #
  563. # Thus, the last character class on a rule can match-up with the same
  564. # character class at the head of another rule (or the same rule) to
  565. # match longer strings.  In fact, the tokenizer does this, internally,
  566. # to create the longest tokens it can from an input stream.
  567. #
  568. #
  569. # EndRule: End of Definitions Marker
  570. # ----------------------------------
  571. #
  572. # The last "rule" in the list of rules MUST consist of solely the
  573. # EndRule character class (i.e., the rule with Value 1).  It tells the
  574. # Word Continuation Rule loader that it is finished.  If the EndRule is
  575. # missing, the Word Continuation Rule loader will try to eat any
  576. # following data as continuation rules, and will fail.
  577. #
  578. # Default Word Continuation Rules
  579. # -------------------------------
  580. #
  581. # The following, short, ruleset will create tokens consisting of
  582. # Numbers, Letters, and Dollars freely intermixed.  It will NOT create
  583. # tokens containing ONLY Dollars; the rules state that for a Dollar to
  584. # be part of a token, the Dollar must be followed by a Letter.  The
  585. # rules also allow a single bang character, "!", at the beginning of a
  586. # token.  Note that these rules are intended for a particular type of
  587. # technical documentation, and will probably not exactly fit your needs.
  588. #
  589. #
  590. # Examples Using Default Word Continuation Rules
  591. # ----------------------------------------------
  592. #
  593. # Example 1':
  594. #
  595. # The string from Example 1:
  596. #
  597. #   "A-1   B 2   C3   4D   5 E   6-F   GH   IJ7LMNOP"
  598. #
  599. # Previously tokenized as:
  600. #
  601. #   "A" "B" "C3" "D" "E" "F" "GH" "IJ7" "LMNOP"
  602. #
  603. # With the default rules, below, tokenizes as:
  604. #
  605. #   "A" "1" "B" "2" "C3" "4D" "5" "E" "6" "F" "GH" "IJ7MNOP"
  606. #
  607. #
  608. # Example 2':
  609. #
  610. # The strings from Example 2:
  611. #
  612. #   "$$SysDevice"
  613. #   "$Fr$ed"
  614. #   "$x8"
  615. #
  616. # Previously tokenized as:
  617. #
  618. #   "SysDevice" "Fr" "$ed" "x"
  619. #
  620. # With the default rules, below, tokenize as:
  621. #
  622. #   "$$SysDevice" "$Fr$ed" "$x8"
  623. #
  624. #
  625. #
  626. # Example 3':
  627. #
  628. # The string from Example 3:
  629. #
  630. #   "tomd@pls.com"
  631. #
  632. # Will still be tokenized as (lacking the AtSign and Dot rules):
  633. #
  634. #   "tomd" "pls" "com"
  635. #
  636. #
  637. #
  638. #
  639. # Performance Hints
  640. # =================
  641. #
  642. #
  643. # 1) Keep Rules As Simple As Possible.  The simpler the rule, the faster
  644. # the word-continuation tests.  If a rule uses few character classes,
  645. # and contains few items, it is "simple."  If a rule uses more than two
  646. # character classes, or uses two or more classes in different
  647. # permutations, the rule is "complex."
  648. #
  649. # 2) Define As Few Rules As Possible.  The fewer rules there are to
  650. # check, the faster will be tokenization.
  651. #
  652. #
  653. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  654. #
  655. # Word Continuation Rules
  656. #
  657. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -
  658. #
  659. # I apologize if this explanation has been overly long, especially given
  660. # the brevity of the following rules.  This documentation is partially
  661. # for me (Tom Donaldson), and partially for anyone using the tokenizer.
  662. # If I jot it down now, there is a better chance I will "remember" it
  663. # all later!
  664. #
  665. #
  666. Letter *
  667. #
  668. Number *
  669. #
  670. Letter * Dot Space Number * Dot
  671. #
  672. Letter * Dot Space Number * Letter Dot
  673. #
  674. Paragraf Space Number * Dot
  675. #
  676. Paragraf Space Number * Letter Dot
  677. #
  678. Letter * Dot Space Letter * Dot
  679. #
  680. Letter * Dot Space Letter * Number * Dot
  681. #
  682. Dollar  Number *
  683. #
  684. Dollar Number * Letter
  685. #
  686. Dollar Letter *
  687. #
  688. Letter * Dot Letter * Dot Number * Dot Number * Dot Number * Dot Number * 
  689. #
  690. Letter * Dot Letter * Dot Number * Dot Number * Dot Number * Dot Letter *
  691. #
  692. Letter * Dot Letter * Dot Number * Dot Number * Dot Number * Dot Letter Number * Dot Number * 
  693. #
  694. Letter Dot Number * Dot Number *
  695. #
  696. Number * Underscore Number *
  697. #
  698. #
  699. # Rule End MUST be the last rule in the continuation rules.
  700. # It must NOT occur as part of any other rule.
  701. #
  702. EndRule
  703. #
  704. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  705.  
  706.  
  707. ####################################################################
  708. #
  709. # Section 4: Canonization Map
  710. #
  711. ####################################################################
  712. #
  713. # After the tokenizer returns a "word", based on the rules defined in
  714. # the first three sections of this file, it must be put into a
  715. # regularized, "canonical", form to make searches easier and faster.  In
  716. # fact, canonizing tokens can also drastically reduce the size of the
  717. # database's dictionary.
  718. #
  719. # A common form of canonization is to convert all lower case letters to
  720. # upper case, and use the upper cased terms in the index and during
  721. # searches.  This allows, for example, the word "NeXT" to match the
  722. # words "next", "NEXT", "nExt", etc.  Note that this also means that
  723. # only one version of "next" is stored in the index, rather than all
  724. # permutations on the case of the letters that might exist in the
  725. # database.
  726. #
  727. # The canonization map allows you to determine what character by
  728. # character transforms are performed during canonization.  The default
  729. # canonization supplied in the following table maps all lower case
  730. # characters to upper case.  All other values are mapped to themselves;
  731. # that is, all other values are unchanged after canonization.
  732. #
  733. # For example, in some databases you might want to convert the "A WITH
  734. # TILDE" to a plain "A".  You can do this by specifying that the "A
  735. # WITH TILDE" character, with character code 195, should be canonized
  736. # to the character "A", with character code 65:
  737. #
  738. #   195 65      # Canonize A-tilde as A
  739. #
  740. #
  741. # Default Values
  742. # ==============
  743. #
  744. # You do not have to define a mapping for all characters.  The default
  745. # for all characters is to map to itself.  Thus, your canonization
  746. # mapping table need only contain characters which you want to have
  747. # translated after tokenization.
  748. #
  749. # CRITICAL
  750. # ========
  751. #
  752. # As for the previous table, there is a special value for this
  753. # Canonization Map that marks its end.  The special value is -1.  The
  754. # decimal character code -1 will cause the Canonization Map loader to
  755. # stop reading.
  756. #
  757. #
  758. # Performance Hints
  759. # =================
  760. #
  761. # None.
  762. #
  763. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  764. #
  765. # Default Canonization Map
  766. #
  767. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  768. #
  769. # -------       -------         -----------
  770. #  Input        Output
  771. # Decimal       Decimal
  772. #  Char          Char
  773. #  Value         Value          Comment
  774. # -------       -------         -----------
  775. #
  776. # Map the characters a-z to the "canonical" characters A-Z.  That is,
  777. # all letters will be upper cased.
  778.    97           65              # Char 'a' canonizes to 'A'
  779.    98           66              # Char 'b' canonizes to 'B'
  780.    99           67              # Char 'c' canonizes to 'C'
  781.   100           68              # Char 'd' canonizes to 'D'
  782.   101           69              # Char 'e' canonizes to 'E'
  783.   102           70              # Char 'f' canonizes to 'F'
  784.   103           71              # Char 'g' canonizes to 'G'
  785.   104           72              # Char 'h' canonizes to 'H'
  786.   105           73              # Char 'i' canonizes to 'I'
  787.   106           74              # Char 'j' canonizes to 'J'
  788.   107           75              # Char 'k' canonizes to 'K'
  789.   108           76              # Char 'l' canonizes to 'L'
  790.   109           77              # Char 'm' canonizes to 'M'
  791.   110           78              # Char 'n' canonizes to 'N'
  792.   111           79              # Char 'o' canonizes to 'O'
  793.   112           80              # Char 'p' canonizes to 'P'
  794.   113           81              # Char 'q' canonizes to 'Q'
  795.   114           82              # Char 'r' canonizes to 'R'
  796.   115           83              # Char 's' canonizes to 'S'
  797.   116           84              # Char 't' canonizes to 'T'
  798.   117           85              # Char 'u' canonizes to 'U'
  799.   118           86              # Char 'v' canonizes to 'V'
  800.   119           87              # Char 'w' canonizes to 'W'
  801.   120           88              # Char 'x' canonizes to 'X'
  802.   121           89              # Char 'y' canonizes to 'Y'
  803.   122           90              # Char 'z' canonizes to 'Z'
  804.   185        165             #
  805.   230        198             #
  806.   234        202             #
  807.   179        163             #
  808.   241        209             #
  809.   243        211             #
  810.   156        140             #
  811.   159        143             #
  812.   191        175             #
  813. # ---           -----           -----------------------
  814.    -1           -1              # Not loaded.  Just marks end of map definition.
  815. # ---           -----           -----------------------
  816.  
  817. ####################################################################
  818. #
  819. #
  820. # End Of File: tknztbld.def
  821. #
  822. #
  823. ####################################################################
  824.