dict 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. .TH DICT 7
  2. .SH NAME
  3. dict \- dictionary browser
  4. .SH SYNOPSIS
  5. .B dict
  6. [
  7. .B -k
  8. ]
  9. [
  10. .B -d
  11. .I dictname
  12. ]
  13. [
  14. .B -c
  15. .I command
  16. ]
  17. [
  18. .I pattern
  19. ]
  20. .SH DESCRIPTION
  21. .I Dict
  22. is a dictionary browser.
  23. If a
  24. .I pattern
  25. is given on the command line,
  26. .I dict
  27. prints all matching entries;
  28. otherwise it repeatedly accepts and executes commands.
  29. The options are
  30. .TF -d\ \fIdictname\fP
  31. .TP
  32. .BI -d " dictname"
  33. Use the given dictionary.
  34. The default is
  35. .BR oed ,
  36. the second edition of the Oxford English Dictionary.
  37. A list of available dictionaries is printed by option
  38. .BR -d? .
  39. .TP
  40. .BI -c " command"
  41. Execute one command and quit.
  42. The command syntax is described below.
  43. .TP
  44. .B -k
  45. Print a pronunciation key.
  46. .PD
  47. .PP
  48. Patterns are regular expressions (see
  49. .IR regexp (6)),
  50. with an implicit leading
  51. .L ^
  52. and trailing
  53. .LR $ .
  54. Patterns are matched against an index of headwords and variants,
  55. to form a `match set'.
  56. By default, both patterns and the index are folded:
  57. upper case characters are mapped into their lower case equivalents,
  58. and accented characters are mapped into their base
  59. equivalents.
  60. In interactive mode, there is always a `current match set'
  61. and a `current entry' within the match set.
  62. Commands can change either or both, as well as print the entries
  63. or information about them.
  64. .PP
  65. Commands have an address followed by a command letter.
  66. Addresses have the form:
  67. .TF /\fIre\fP/.\fIn\fP
  68. .TP
  69. .BI / re /
  70. Set the match set to all entries matching the regular expression
  71. .IR re ,
  72. sorted in dictionary order.
  73. Set the current entry to the first of the match set.
  74. .TP
  75. .BI ! re !
  76. Like
  77. .BI / re /
  78. but use exact matching, i.e., without case and accent folding.
  79. .TP
  80. .I n
  81. An integer
  82. .I n
  83. means change the current entry to the
  84. .IR n th
  85. of the current match set.
  86. .TP
  87. .BI # n
  88. The integer
  89. .I n
  90. is an absolute byte offset into the raw dictionary.
  91. (See the
  92. .B A
  93. command, below.)
  94. .TP
  95. .IB addr +
  96. After setting the match set and current entry according to
  97. .IR addr ,
  98. change the match set and current entry to be the next entry
  99. in the dictionary (not necessarily in the match set) after
  100. the current entry.
  101. .TP
  102. .IB addr -
  103. Like
  104. .IB addr +
  105. but go to previous dictionary entry.
  106. .PD
  107. .PP
  108. The command letters come in pairs: a lower case and the
  109. corresponding upper case letter.
  110. The lower case version prints something about the current
  111. entry only, and advances the current entry to the next
  112. in the match set (wrapping around to the beginning after
  113. the last).
  114. The upper case version prints something about all of the
  115. match set and resets the current entry to the beginning of
  116. the set.
  117. .TF \fLa,A\fP
  118. .TP
  119. .BR p , P
  120. Print the whole entry.
  121. .TP
  122. .BR h , H
  123. Print only the headword(s) of the entry.
  124. .TP
  125. .BR a , A
  126. Print the dictionary byte offset of the entry.
  127. .TP
  128. .BR r , R
  129. Print the whole entry in raw format (without translating
  130. special characters, etc.).
  131. .PD
  132. .PP
  133. If no command letter is given for the first command,
  134. .B H
  135. is assumed.
  136. After an
  137. .BR H ,
  138. the default command is
  139. .BR p .
  140. Otherwise, the default command is the previous command.
  141. .SH FILES
  142. .B /lib/dict/oed2
  143. .br
  144. .B /lib/dict/oed2index
  145. .br
  146. Other files in
  147. .BR /lib .
  148. .SH "SEE ALSO"
  149. .IR regexp (6)
  150. .SH SOURCE
  151. .B /sys/src/cmd/dict
  152. .SH BUGS
  153. A font with wide coverage of the Unicode Standard
  154. should be used for best results.
  155. (Try
  156. .BR /lib/font/bit/pelm/unicode.9.font .)
  157. .br
  158. If the
  159. .I pattern
  160. doesn't begin with
  161. a few literal characters, matching takes a long time.
  162. .br
  163. The dictionaries are not distributed outside Bell Labs.