Subversion Repositories wimsdev

Rev

Rev 2000 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. !set p2=!item 2 of $special_parm
  3. !if $p2!=$empty
  4.  !if $p2=list
  5.   !read help/symtext/list.phtml
  6.   !if $stylecnt > 0
  7.    !exit
  8.   !endif
  9.  !endif
  10.  !set test=!defof style_exists in symtext/$module_language/$p2/def
  11.  !if $test=yes
  12.   !changeto symtext/$module_language/$p2/help.phtml
  13.  !endif
  14. !endif
  15.  
  16. <center><h2>Symtext documentation</h2></center>
  17.  
  18. !href cmd=help&special_parm=symtext,list List of symtext styles
  19. . <p>
  20.  
  21. Symtext is a natural language parsing syntax. It is designed to make it
  22. easier to identify different ways to say the same thing in natural language,
  23. and its main purpose is for the recognition of freely typed or composed
  24. short text answers to exercises.
  25. <p>
  26.  
  27. Recognition of free text answers is difficult due to the following facts.
  28. <ul>
  29.  
  30. <li>Different context requires different tolerance and precision. A language
  31. exercise cannot tolerate spelling or grammar error, which may not be the
  32. case for a mathematical exercise.
  33.  
  34. <li>Natural language often allows many different ways to say the same thing,
  35. between "A or B" and "B or A", "Paul is older than Bill" and "Bill is
  36. younger than Paul", "x and y are similar" and "x is similar to y", or even
  37. "this costs too much" and "it is too expensive".
  38.  
  39. <li>Typing errors are common in freely typed text. In many cases, typing
  40. errors should be tolerated. But before an unknown word, it is difficult for
  41. the software to tell whether it is a typing error or a bad answer.
  42.  
  43. </ul>
  44.  
  45. In view of the above, the design of symtext has incorporated the following
  46. features.
  47.  
  48. <ul>
  49. <li>A nestable syntax allowing the identification of various language
  50. alternatives (different ways to say the same thing).
  51.  
  52. <li>Macro dictionaries can be defined to help improve the human readability
  53. of the matching rules.
  54.  
  55. <li>User-definable multiple dictionaries that can be used for various text
  56. analysis purposes.
  57.  
  58. <li>Designated portions of the text can be output for further processing.
  59.  
  60. <li>It is based on user-definable styles, with different styles defining
  61. different dictionaries and macros. So they can be used to deal with
  62. different context.
  63.  
  64. <li>Language scope can be delimited by declaring the list of allowed words.
  65. Text containing words not in the list can be considered to be out-scope and
  66. be sent back for rephrasing, instead of being rejected as bad answer. A
  67. correct use of this feature can solve most of the problems related to typing
  68. errors and unexpected answers.
  69.  
  70. </ul>
  71.  
  72. <p><hr><h3>How it works</h3>
  73.  
  74. Symtext deals with the problem of comparing two sentences. The first is the
  75. <em>sample</em> which is typically the answer given to an exercise. It is
  76. compared to the second sentence, the <em>tester</em>, which is typically the
  77. good answer as declared by the author of the exercise.
  78. <p>
  79.  
  80. The sample must be plain text in natural language, while the tester may
  81. contain <em>symtext rules</em> allowing it to <em>match</em> various samples
  82. that are considered to have the same meaning. Such various ways to say the
  83. same thing are alternatives in the natural language. The scope of the
  84. acceptable alternatives depends on the context of the exercise, therefore
  85. must be precisely defined by the author. Symtext is designed to allow
  86. authors to make such definitions.
  87. <p>
  88.  
  89. Symtext rules are word based, that is, it only compares words. A word is a
  90. chain of alphabetic characters or digits delimited by spaces or special
  91. symbols (parentheses, quotes, punctuations etc.). Any special symbol is
  92. considered as a word by itself. And symtext doesn't count the number of
  93. space characters between two words: any chain of consecutive space
  94. characters will be reduced to one space.
  95. <p>
  96.  
  97. A set of basic <em>builtin rules</em> are defined in the symtext syntax. For
  98. example, the rule <tt>[Iperm:x,and,y]</tt> matches both samples "x and y"
  99. and "y and x". Rules can be nested:
  100. <pre>neither [Aperm:[Alt:I,me,we,us],nor,our teacher]</pre>
  101. mathes the following 8 cases.
  102. <p>
  103.  
  104. "neither I nor our teacher", "neither our teacher nor I", "neither me nor
  105. our teacher", "neither our teacher nor me", "neither we nor our teacher",
  106. "neither our teacher nor we", "neither us nor our teacher", "neither our
  107. teacher nor us".
  108. <p>
  109.  
  110. In general applications, a context <em>style</em> can be declared before
  111. making the comparison. A style is a set of dictionaries and options. These
  112. include pre-transformation dictionaries that can be used for example to
  113. identify singular and plural words before comparison, a macro dictionary
  114. that can simplify the writing of tester rules and make it more readable, and
  115. user-definable dictionaries for various other purposes.
  116. !href cmd=help&special_parm=symtext,list List of styles
  117. .
  118. <p>
  119.  
  120. For example, a <em>positional macro</em> <tt>_divides</tt> can be defined in
  121. the macro dictionary, so that the tester <tt>x _divides [y + z]</tt> will
  122. match the following samples.
  123. <p>
  124.  
  125. "x divides y + z", "x is a factor of y + z", "y + z is divisible by x", "y +
  126. z is a multiple of x".
  127. <p>
  128.  
  129. Note here that such a macro is positional, so that the string "y + z" must
  130. be enclosed in a pair of brackets to make them look as one word for the
  131. macro. Otherwise it will rather match things like "y is a multiple of x +
  132. z", which clearly is wrong.
  133. <p>
  134.  
  135. This example shows that the final power of the syntax depends primarily on the
  136. construction of the macro dictionary (which will vary from style to style).
  137. <p>
  138.  
  139. The tester is a text string containing ordinary words, matching rules and
  140. positional macros. An ordinary word is simply compared with the word at the
  141. corresponding position in the sample, while matching rules and macros can
  142. match multiple possibilities in the sample.
  143. <p>
  144.  
  145. Before comparison takes place, words in both the sample and the tester may
  146. first be transformed in order to identify small differences that one wants
  147. to ignore, such as upper and lower cases, singular and plural nouns etc.
  148. <p>
  149.  
  150. Unlike regular expression, symtext match occurs only if the tester matches
  151. the whole sample. Match does not occur if the tester only matches a part of
  152. the sample. However, wildcard rules can be included in the tester if part of
  153. the sample needs to be ignored.
  154. <p>
  155.  
  156. <p><hr><h3>Details of the syntax</h3>
  157.  
  158. <b>Definitions</b>. <ul>
  159. <li>A <em>tstring</em> is a succession of <em>atoms</em>.
  160. <li>An <em>atom</em> is either a <em>word</em>, a <em>brakcet block</em> or
  161. a positional macro name.
  162. <li>A <em>word</em> is either a list of consecutive alphanumerical
  163. characters or a single special character. In the first case, the word is
  164. delimited by either spaces or non-alphanumerical characters.
  165. <li>A <em>bracket block</em> is a substring enclosed by a pair of brackets.
  166. It can be either a tstring, or a <em>matching rule</em>.
  167. <li>A <em>positional macro</em> is a word (macro name) preceded by the
  168. underline character. The macro name must be defined in the macro dictionary,
  169. otherwise the whole atom will be treated as an ordinary word.
  170. </ul>
  171.  
  172. A <em>matching rule</em> may be either builtin or defined in the style macro
  173. dictionary. It must be enclosed by a pair of brackets, and the first
  174. character must be alphabetic. If the first character is upper-case, it is
  175. builtin. otherwise it is a macro.
  176. <p>
  177.  
  178. Syntax of the matching rule: <tt>[rule_name:parameters]</tt>.
  179. <em>rule_name</em> must start with the first character of the block, it must
  180. be a valid rule name, and the colon must immediately follow the name (no
  181. spaces inserted). Otherwise the block will be treated as a normal tstring
  182. rather than a rule. <p>
  183.  
  184. <em>Parameters</em> is a comma-separated list of strings. Each parameter can
  185. be a tstring itself (hence can contain nested subrules), except in some
  186. special cases of builtin rules where some of the parameter has a special
  187. meaning, e.g. the first parameter of the rule <em>Pick</em> must be a
  188. positive integer.
  189. <p>
  190.  
  191. There are also two special bracket blocks that are in fact simplifications
  192. of builtin matching rules:
  193. <ul>
  194.  
  195. <p><li><tt>[A|B|C]</tt> is equivalent to <tt>[Alt:A,B,C]</tt>. For this
  196. reason, the character <tt>|</tt> is reserved. To have it matched, write
  197. <tt>[|]</tt> (or <tt>[Alt:|]</tt>).
  198.  
  199. <p><li><tt>[**]</tt> is equivalent to <tt>[Wild:**]</tt>, <tt>[* *]</tt> is
  200. equivalent to <tt>[Wild:* *]</tt>, etc. A block falls into this category if
  201. the first character is a '<tt>*</tt>'.
  202.  
  203. </ul>
  204.  
  205. <p><hr><h3>Builtin rules</h3>
  206.  
  207. A builtin rule is a matching rule where the first character of the name is
  208. upper-case. <p>
  209.  
  210. Any parameter may include the comma character, as long as it is enclosed by
  211. a pair of parentheses or brackets. <p>
  212.  
  213.  
  214.  
  215. !read tabletheme
  216. !set wims_backslash_insmath=yes
  217. $table_header
  218. $table_hdtr
  219. <th>name</th>
  220. <th><small>Number of<br>parameters</small></th>
  221. <th>Effect</th>
  222. <th>Detail</th>
  223.  
  224. $table_tr
  225. <td>Alt
  226. <td align=middle>\(>= 1)
  227. <td>Matches any one of the parameters.
  228. <td><tt>[Alt:a,b,c d]</tt> matches "a", "b" or "c d".
  229.  
  230. $table_tr
  231. <td>Aperm
  232. <td align=middle>\(>= 3)
  233. <td>"And" styled permutation.
  234. <td><tt>[Aperm:[,],and,A,B,C]</tt> matches "A, B and C", "B, A and C", etc.
  235. The order of parameter 3 and up is arbitrary, and the first two parameters
  236. are used to insert between them: parameter 1 is inserted except for the
  237. last insertion where parameter 2 is inserted.
  238.  
  239. $table_tr
  240. <td>Apick
  241. <td align=middle>\(>= 4)
  242. <td>"And" styled arbitrary selection.
  243. <td><tt>[Apick:3,[,],and,A,B,C,D,E]</tt> matches "B, E and A", "C, A and E",
  244. etc. Parameter 1 must be an integer and gives the number of items to pick.
  245.  
  246. $table_tr
  247. <td>Dic
  248. <td align=middle>\(1)
  249. <td>Dictionary check
  250. <td><tt>[Dic:wordtype transitive verb]</tt> matches any word or group of
  251. words that is defined in the dictionary "wordtype", with a definition that
  252. contains an item "transitive verb". <p>
  253.  
  254. Note. No word transformation is performed on the parameter of this rule.
  255.  
  256. $table_tr
  257. <td>Dperm
  258. <td align=middle>\(4)
  259. <td>Dependent permutation: parameters to match depend on the sample.
  260. <td><tt>[Dperm:a,b,c,d]</tt> matches either "a b c" or "c d a", but nothing
  261. else. For example, <br>
  262. <tt>[Dperm:x,beats,y,is beaten by]</tt> matches either "x beats y" or "y is
  263. beaten by x". Or in French,
  264. <br>
  265. <tt>il [Dperm:,y,est allé,à Paris]</tt> matches either "il y est allé" or
  266. "il est allé à Paris".
  267.  
  268.  
  269. $table_tr
  270. <td>Ins
  271. <td align=middle>\(>= 3)
  272. <td>Arbitrary insertion of parameter 1.
  273. <td><tt>[Ins:A,B,C,D,E]</tt> matches "B A C D E", "B C A D E", "B C D A E".
  274. Parameter 2 and up must be matched in the given order, while parameter 1 may
  275. find its place anywhere between them. <p>
  276.  
  277. To match "A B C D", "B A C D", "B C A D" and "B C D A", put two empty
  278. parameters: <tt>[Ins:A,,B,C,D,]</tt>.
  279.  
  280. $table_tr
  281. <td>Iperm
  282. <td align=middle>\(3)
  283. <td>Inter-permutation.
  284. <td><tt>[Iperm:Bill,and,Alice]</tt> matches "Bill and Alice" and "Alice and
  285. Bill". But not the three words in any other order.
  286.  
  287. $table_tr
  288. <td>M
  289. <td align=middle>\(1)
  290. <td>Shared macro.
  291. <td>The content (any tstring) of the macro can be shared with other calls (with
  292. the same content). This is mainly designed for the macros file, with the aim of
  293. reducing the size of compiled ruleset. Moreover, Shared macros can be self-nested
  294. (while non-shared ones cannot).
  295.  
  296. $table_tr
  297. <td>Neg
  298. <td align=middle>\(1)
  299. <td>Logical match negation.
  300. <td>This rule returns match if the sample does not match its parameter, and
  301. vice versa. <p>
  302. In the first case, the rule matches the empty string in the sample.
  303.  
  304. $table_tr
  305. <td>Nomatch
  306. <td align=middle>\(0)
  307. <td>This is a synonym of <tt>None</tt>.
  308. <td>
  309.  
  310. $table_tr
  311. <td>None
  312. <td align=middle>\(0)
  313. <td>Matches nothing.
  314. <td><tt>[None:]</tt> always returns no match.
  315.  
  316. $table_tr
  317. <td>Not
  318. <td align=middle>\(1)
  319. <td>This is a synonym of <tt>Neg</tt>.
  320. <td>
  321.  
  322. $table_tr
  323. <td>Opick
  324. <td align=middle>\(>= 2)
  325. <td>Matches an ordered subset of given number of parameters.
  326. <td>This rule is as <tt>Pick</tt>, except that it only matches subsets that
  327. are in the same order as that given in the parameters.
  328.  
  329. $table_tr
  330. <td>Out
  331. <td align=middle>\(2)
  332. <td>Match plus output
  333. <td>The first parameter is a variable name, and the second parameter can be
  334. any combination of words, subrules and macros. If match occurs for the
  335. second parameter, the matching text will be put as a value of the variable
  336. and output. <p>
  337.  
  338. Example. <tt>[Out:myvar,[*]]</tt> matches any single word, and if the
  339. matched word is "myword" (in the sample), the match output contains a string
  340. "myvar=myword" that can be parsed to know what word the user has entered in
  341. this location.
  342.  
  343. $table_tr
  344. <td>Perm
  345. <td align=middle>\(>= 2)
  346. <td>Matches all the parameters in arbitrary order.
  347. <td><tt>[Perm:x,y,z]</tt> matches "x y z", "y x z", "z x y" etc.
  348.  
  349. $table_tr
  350. <td>Pick
  351. <td align=middle>\(>= 2)
  352. <td>Matches a subset of given number of parameters in any order.
  353. <td>The first parameter must be a positive integer n. The rule matches any
  354. subset of n parameters within the rest, in any order. <br>
  355. Example: <tt>[Pick:2,a,b,c,d]</tt> matches "a b", "d b", "c a" etc. <br>
  356. <tt>[Pick:3,x,y,z]</tt> is equivalent to <tt>[Perm:x,y,z]</tt>. <br>
  357. <tt>[Pick:1,a,b,c,d]</tt> is equivalent to <tt>[Alt:a,b,c,d]</tt>.
  358.  
  359. <p>
  360. Extensions: <tt>[Pick:+2,...]</tt> matches any subset of at least 2
  361. parameters. <br>
  362. <tt>[Pick:-3,...]</tt> matches any subset of at most 3 parameters (including
  363. the empty subset).
  364.  
  365. <p>
  366. Known bug: repetition of the same parameter is not recognized.
  367. <tt>[Pick:2,a,b,c,d]</tt> does not match "a c c".
  368.  
  369. $table_tr
  370. <td>Rep
  371. <td align=middle>\(>= 1)
  372. <td>Matches an arbitrary number (at least one) of parameters in any order and
  373. with any repetition.
  374. <td><tt>[Rep:0,1]</tt> matches "0 1", "1", "0 1 0 0 1 1 0", etc.
  375.  
  376. $table_tr
  377. <td>W
  378. <td align=middle>\(0 or 1)
  379. <td>Matches words in a list.
  380. <td>This rule matches the next word if it appears somewhere in the tester or
  381. if it is a word given in the parameter. <p>
  382.  
  383. If this rule is put in the last tester line, words in all the tester lines
  384. will count.
  385.  
  386. $table_tr
  387. <td>Wild
  388. <td align=middle>\(1)
  389. <td>Wildcard word match.
  390. <td>The unique parameter must be composed of words "*", "**", and/or "**n"
  391. where n is a positive number. The first matches any single word, the second
  392. matches 0 or any number of words, and the third matches from 0 to n
  393. arbitrary words. For example, <br>
  394. <tt>[Wild:* * **3]</tt> matches between 2 to 5 words (inclusive).
  395.  
  396. $table_end
  397.  
  398. <p><hr><h3>Construction of styles</h3>
  399.  
  400. A style corresponds to a directory and its contents. Under WIMS, the style
  401. can either be shared among all modules in the public_html/scripts/symtext
  402. directory, or be special to one module, in the module's directory.
  403. <p>
  404.  
  405. The style must contain an index file, named <tt>def</tt>. It defines the
  406. basic configuration choices of the style. Every line of the file is a
  407. definition under the format <tt>name=value</tt>. <p>
  408.  
  409. The <tt>def</tt> file must contain a definition <tt>style_exists=yes</tt>,
  410. otherwise the existence of the style will not be recognized. All the rest is
  411. optional.<p>
  412.  
  413. It may contain a definition of <em>option</em>, that lists option words that
  414. will always be activated for the style. <p>
  415.  
  416. It can also define general dictionaries using the name
  417. <em>dictionaries</em>. The value must be a list of words, each corresponding
  418. to a dictionary file in the style. The number of general dictionaries is
  419. limited.
  420. <p>
  421.  
  422. For each general dictionary, a variable NAME_unknown can be defined (where
  423. NAME should be replaced by the dictionary name), which tells how a word
  424. should be treated if it is not found in the dictionary (unknown). The value
  425. may be <tt>delete</tt> (default) which means the unknown word should be
  426. replaced by an empty string; <tt>leave</tt> which will return the unknown
  427. word unchanged; or anything else. In the last case, the value will be used
  428. to replace the unknown word.
  429. <p>
  430.  
  431. There may also be three dictionary files with reserved names:
  432. <tt>suffix</tt>, <tt>trans</tt> and <tt>macros</tt>. All dictionaries are
  433. line dictionaries, with each line in the format <tt>name:definition</tt>. Names
  434. must be sorted (using the special program <tt>dicsort</tt> in the WIMS
  435. package). All of the dictionaries are optional.
  436. <p>
  437.  
  438. Both name and definition may contain space characters. However, except macro
  439. definitions there is no transformation after the dictionary is read, so only
  440. single space characters should be used. The name field should start and end
  441. with non-space characters. Multiple definitions with a same name will give
  442. unpredictable result.
  443. <p>
  444.  
  445. The <em>suffix</em> dictionary is a very special one, that is used to
  446. transform word suffixes before any other transformation. It is easy to
  447. understand except that in the name field, the suffixes are defined in
  448. reverse order.
  449. <p>
  450.  
  451. The <em>trans</em> dictionary is used for word replacements after suffix
  452. transformation. Both dictionaries will be consulted before any string
  453. comparison takes place. For example, if we want to identify nouns under
  454. singular and plural forms, we can first use the <em>suffix</em> dictionary
  455. to transform plural nouns into singular suffix if they obey a general suffix
  456. rule; then for nouns with special plural forms, the <em>trans</em>
  457. dictionary can be used to transform them.
  458. <p>
  459.  
  460. Both the <em>suffix</em> and <em>trans</em> dictionaries must be constructed
  461. to be <em>order 1 stable</em>, that is, if an already transformed string is
  462. resubmitted to the dictionary, no further transformation will take place.
  463. <p>
  464.  
  465. The <em>macros</em> dictionary contains both definitions for positional
  466. macros and macro rules. The former have names starting with the underline
  467. character, while the latter starts with lower case letters.
  468. <p>
  469.  
  470. The definition of a macro is a tstring that will be used to replace the
  471. macro. Macros can be nested, that is, the definition of a macro may contain
  472. calls to other macros, in any order. However, infinite nesting loops will
  473. result in an error.
  474. <p>
  475.  
  476. In order to preserve consistency for positional macros, the definition of
  477. any macro must be composed of exactly one atom.
  478. <p>
  479.  
  480. Macro definitions may contain parameters. For this purpose, the character
  481. <tt>@</tt> has a special meaning in a macro definition. When invoked, it
  482. must be followe by an integer. And the character together with the following
  483. integer will be replaced by a macro parameter during macro expansion.
  484. <p>
  485.  
  486. For a rule macro, <tt>@1</tt> means the first parameter, <tt>@2</tt> means
  487. the second parameter, etc. It is an error if the macro is invoked in a
  488. tstring without giving enough parameters.
  489. <p>
  490.  
  491. For a positional macro, <tt>@1</tt> designates the first atom following the
  492. macro, while <tt>@-1</tt> designates the first atom preceding the macro, etc.
  493. It is also an error if a positional macro is inserted in a tstring without
  494. enough atoms before or after it as required by its definition.
  495. <p>
  496.  
  497. Care must be taken to the point that a macro parameter may result in several
  498. atoms after expansion. This is not a problem unless the macro definition
  499. contains a positional macro. In case where it is necessary to ensure the
  500. position of parameters, one can enclose the parameter by a pair of brackets,
  501. such as <tt>[@1]</tt>.
  502. <p>
  503.  
  504. A general dictionary has the same syntax as the reserved ones. In this case,
  505. the definition field can be a comma-separated list of items. These
  506. dictionaries are used via the <tt>Dic</tt> builtin rule, which gives a match
  507. if one of the items in the definition is equal to the value given in the
  508. parameter of the rule.
  509. <p>
  510.  
  511.  
  512. <p><hr><h3>The command line program</h3>
  513.  
  514. The command line program <em>symtext</em> is spcially built for WIMS, so that
  515. all the input data are sent through environment variables. It can also be
  516. used as a standalone program, but in this case it is better that a wrapper
  517. script be used to put the input-output into a more *nix flavor. <p>
  518.  
  519. $table_header
  520. <caption>List of environment parameters</caption>
  521. $table_hdtr<th>Name</th>
  522. <th>Value</th>
  523. <th>Comments</th>
  524. </tr>
  525. $table_tr
  526. <td>wims_exec_parm</td>
  527. <td>The main data input</td>
  528. <td>A multi-line string. <ul>
  529. <li>Line 1: command followed by options. Valid commands: <ul>
  530.   <li><tt>match</tt> check matching.
  531.   <li><tt>debug</tt> check matching with debug information.
  532.   </ul>
  533. <li>Line 2: The sample.
  534. <li>Line 3 and up: Each line is a tester.
  535. </ul>
  536. Lines can also be delimited by the semi-colon. For this reason, semi-colons
  537. must be protected by parentheses in both the sample and the tester.
  538. <p>
  539. Options have the same syntax as in the style option definition. With one
  540. more possible definition here: <tt>style=[the_name_of_style]</tt>.
  541. </td></tr>
  542.  
  543. $table_tr
  544. <td>module_dir</td>
  545. <td>Directory to current module</td>
  546. <td>Automatically defined if called by WIMS. If this variable is undefined,
  547. then w_symtext must give the complete path of the style.
  548. </td></tr>
  549.  
  550. $table_tr
  551. <td>w_module_language</td>
  552. <td>Language</td>
  553. <td>Only used when called by WIMS. Can be overrun by the "language=" option.
  554. </td></tr>
  555.  
  556. $table_end
  557. <p>
  558.  
  559. Options have two origins: either from the environment variable
  560. <em>w_symtext_option</em> or from the <em>def</em> file of the style. The two
  561. have the same syntax.
  562. <p>
  563.  
  564. !set option_data=!trim \
  565. alnumly,word,Transform everything non-alphabetic and non-digit into space.\
  566. alphaonly,word,Transform everything non-alphabetic into space.\
  567. deaccent,word,Remove accents from letters before comparison.\
  568. debug,word,Output debug information to stderr.\
  569. language,value,A two-letter language code.\
  570. matchall,word,Match every line of the tester&#44; instead of stopping after the first match.\
  571. nocase,word,Fold both texts to lower case before comparison.\
  572. nocs,word,Replace computer-oriented characters by spaces (<tt>_&$#\\@~</tt>)\
  573. nomath,word,Replace mathematical operators by spaces (<tt>+-*/=|%<>()_</tt>)\
  574. noparentheses,word,Replace parentheses by spaces (<tt>()[]{}</tt>)\
  575. nopunct,word,Replace puncuation characters by spaces (<tt>.,;:?!"</tt>) except the dot as a decimal point.\
  576. noquote,word,Replace quoting characters by spaces (<tt>`'"</tt>)\
  577. reaccent,word,Allow composition of accented letters using special characters.\
  578. style,value,The style&#44, only valid in the environment parameter.\
  579.  
  580.  
  581. $table_header
  582. <caption>List of options</caption>
  583. $table_hdtr
  584. <th>Name</th>
  585. <th>Nature</th>
  586. <th>Meaning</th>
  587. </tr>
  588.  
  589. !set n=!linecnt $option_data
  590. !for i=1 to $n
  591.  !set l=!line $i of $option_data
  592.  !distribute item $l into name,nature,meaning
  593.  $table_tr
  594.  <td>$name</td>
  595.  <td align=center>$nature</td>
  596.  <td>$meaning
  597. !next i
  598.  
  599. $table_end
  600. <p>
  601.  
  602. <b>Program output</b>. The output is empty if no match is found.
  603. <p>
  604.  
  605. !set error_data=!nonempty lines \
  606. bad_command,Invalid command in the input.\
  607. bad_dictionary,Non-existing dictionary specified.\
  608. bad_macro,Bad macro name.\
  609. bad_macro_position,Positional macro placed in the tester where pre- or post-parameters cannot be found.\
  610. bad_pickcnt,Invalid first parameter for Pick.\
  611. block_overflow,Too many rules and parameters defined in the tester (before or after macro expansion).\
  612. duplication_in_dictionary,A name is defined twice in the indicated dictionary (in the style).\
  613. file_too_long,File size exceeded limit.\
  614. level_overflow,Too much nesting; probably an internal bug.\
  615. list_overflow,A rule contains too many parameters.\
  616. macro_level_overflow,Too many recursive macro definitions. Usually it is an infinite loop in the macro dictionary.\
  617. name_too_long,Macro or variable name exceeded length limit.\
  618. string_too_long,String length limit exceeded.\
  619. style_not_found,Inexisting style specified.\
  620. syntax_error,Syntax error in a macro or rule.\
  621. tag_overflow,Tester expansion is too complicated.\
  622. too_many_dictionaries,The number of dictionaries declared in the style has exceeded limit.\
  623. unknown_cmd,Unknown matching rule name.\
  624. unmatched_parentheses,Unmatched parentheses or brackets.\
  625. unsorted_dictionary,The indicated dictionary (in the style) is in bad order.\
  626. wrong_parmcnt,A matching rule has a number of parameters that does not meet its definition.\
  627.  
  628.  
  629. $table_header
  630. <caption>Error messages</caption>
  631. $table_hdtr
  632. <th>Message</th>
  633. <th>Meaning</th>
  634. </tr>
  635.  
  636. !set n=!linecnt $error_data
  637. !for i=1 to $n
  638.  !set l=!line $i of $error_data
  639.  !distribute items $l into msg,mean
  640.  $table_tr
  641.  <td><tt>$msg</tt></td>
  642.  <td>$mean</td>
  643.  </tr>
  644. !next i
  645. $table_end
  646.  
  647.