magicpo.dict
NAME
magicpo.dict - Dictionary for use with MagicPODESCRIPTION
This is the file magicpo reads to find out which words to replace with what. The syntax is as follows:CASE SENSITIVITY
Search expressions (the text before =) are case insensitive. For instance "no = yes" will match both No and no. The replacement string is not. If the replacement string begins with a lowercase character, then it will be replaced with uppercase/lowercase as required. If it begins with an uppercase character all isntances of the string will be replaced with the uppercased version. See SYNTAX EXAMPLES for more information.PRECEDENCE
To avoid small, unprecise expressions replacing words where a larger more precise expression would have done a better job magicpo uses a system of points:- Each letter of a word gives one point.
- Expressions without any "*" or "+" gets ten extra points
- Expressions with "+" gets one point for each "+"
- Expressions using "*" doesn't get any extra points
Example: deactivate should match before activate, it is longer and thus gets two extra points and magicpo matches deactivate before it matches activate.
SPECIAL CHARACTERS
- *
- "*" at the beginning of a word indicates that the word can also be part of another word. For instance "*no = yes" will replace "no" with "yes", but also "domino" with "domiyes". When placed at the end the phrase may be at the beginning of a word, and when placed both at the end and beginning it indicates that the word can either be alone, in the beginning, in the end, or in the middle of a word.
- +
- "+" at the beginning (or end) of a word indicates that at least one alphanumerical character must follow (or preceed) the word. For instance "no+ = yes" will not match "no", but will match "none" (IE. none becomes yesne).
- []
- Letters inside "[]" indicates that both letters inside "[]" can be at that place in the word. For instance "[tw]here = dark" will replace both where and there with dark (a useless replace, but it's an example).
- ?
- A questionmark indicates that the preceeding letter can be included, but that it doesn't need to. For instance "w?here = there" will replace both where and here with there.
- #
- A "#" in the beginning of a line indicates that the line is a comment, magicpo will skip the line completely.
CHARACTERS REQUIRING ESCAPING
The following characters MUST be escaped within the FROM part of dictionary strings (not the TO part). Escaping is done by prefixing the character by \. This includes if you want literal interpretation of the special characters listed above. The following characters:! @ $ % & ( ) [ ] { } ? + ^ *
NOTE: this will change in future versions of MagicPO (which will have automated escaping), so in order to ensure full compatibility with future versions of MagicPO you should avoid using escaping. However, the following characters will require escaping in future versions too: [ ] ? + *
SYNTAX EXAMPLES
- open = free
- Will replace the word "open" with the word "free".
- open source = free software
- Will replace the phrase "open source" with the phrase "free software".
- *open = free
- Will replace the word "open" with the word "free", the "*" in the beginning indicates that "open" can also be the end of a word, so it will for instance also replace "not-open" with "not-free".
- open* = free
- Will replace the word "open" with the word "free", the * at the end indicates that "open" can also be the beginning of a word, so it will for instance also replace "open-source" with "free-source".
- *open* = free
- Will replace the word "open" with the word "free", the "*" at the beginning and end indicates that it can also be in the middle, beginning, or end of a word, so it will for instance repleace "not-open-source" with "not-free-source".
- open+ = free
- Will replace the phrase "open-source" with the phrase "free-source", but will not replace the word "open" with "free". The reverse is true if the "+" is at the beginning.
- [tw]here = that
- Will replace both the "where" and "there" with "that".
- w?here = there
- Will replace both "where" and "here" with "there".
- # Free software = Open Source
- The "#" in the beginning of a line indicates that it is a comment, magicpo will skip all lines beginning with "#".
- internet = Internet
- This will replace all instances of internet with Internet (with uppercase I)
- internet = internet
- This won't do anything. Internet is replaced with Internet, internet with internet.
AUTHORS
magicpo was originally written by Harald Thingelstad, but it is currently maintained (version 0.2 and newer) by Eskild Hustvedt.FILES
- magicpo.dict
- The first dictionary magicpo tries to use.
- magicpo-nn2nb.dict
- The Norwegian Nynorsk to Norwegian Bokmaal dictionary.
- magicpo-da2nb.dict
- The Danish to Norwegian Bokmaal dictionary.
LICENSE AND COPYRIGHT
Copyright (C) Eskild Hustvedt 2005, 2006, 2007 Forked from TransPO, Copyright (C) 2003, 2004 Harald ThingelstadThis is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.