Using the dictionary entry with a condition





To increase probability of correct choice of the translation of original text parts that have several variants of translation in future, you can specify conditions for dictionary entries that are used for different translation of same original text parts.

It is possible to limit usage of the dictionary entry by the string type, usage context, context section, and strings before and after the current.

For example, when you translate BY in the query language, in Text before for BY dictionary entry the following regular expression can be used: (GROUP|TOTALS)\s. This means, that in GROUP BY and TOTALS BY the BY substring shoud be translated as ПО, while in other cases the other dictionary entry, for example ИСПОЛЬЗУЯ where no conditions set, will be used.

The following syntax is available:

   Modifiers, should be placed in the beginning of the pattern, for example (?i):
   i - case insensitive.
   Wildcards:
    .  - one any character. 
    \. - the dot character.
    \s - the space character.
    \d - the digit character.
    \n - the new line symbol.
    \r - the carriage return symbol.
    \S - the non space character.
    *  - any number of characters (should be placed after the character that 
      should be repeated, for example .*), is greedy by default.
    +  - one or more characters (should be placed after the character that 
      should be repeated, for example .+), is greedy by default.
    ?  - one or none characters (should be placed after the character that 
      should be repeated, for example .?), is greedy by default.
    ? after * or + - switches greediness to lazy.
    \A, ^ - begin of the string.
    \z, $ - end of the string.
    (, ) - begin and end of a group, for example (on|at).
    | - the group alternatives separator.
    [, ] - begin and end of a list of characters, for example [abxv\s], [^R].
   ^ - in the beginning of a character list means not match any of characters 
    in the list.
    \], \[, \), \(, \}, \{ - opening and closing brackets: ], [, ), (, }, {.
    \\, \/ - slashes: \, /.
    \? - the question sign.
    \+ - the plus sign.
    \- - the minus sign.
    \* - the star sign.
    \^ - the circumflex sign.
    \$ - the dollar sign.
    \@ - the commercial at sign.
    \| - the vertical bar sign.

Examples:

(?i)[^\s]+\s\S*\n+(to|check|\s)+\d+.[\(#%\*]+(\s|matching|the)*

[^\s]+\s\S*


Comments
0
Add comment