Chapter 17. Searches

1. Search window
1.1. Searching
1.2. Search location
2. Using wild cards
3. Search methods
4. Search results display

1. Search window

Figure 17.1. Text search Window

Text search WindowSearch windowExample

Note

The above search finds all target segments where two or more white spaces - \s\s+ - occur.

1.1. Searching

OmegaT provides a powerful range of search functions. Open the Search window with Ctrl+F and enter the word or phrase you wish to search for in the Search for box. Alternatively, in the Editor window, select a word or phrase in the editing field (target text of the current segment) and hit Ctrl+F. The word or phrase is entered in the Search for box automatically. You can have several Search windows open at the same time, but close them when they are no longer needed so that they do not clutter your desktop.

1.2. Search location

Searches are performed by default in both the source and target sections of the project, but you can limit your search to just the source or the target text. You may search in

  • the project only (default setting)

  • both the project and the reference translation memories in /tm/ (check Search TMs)

  • a single file or a folder containing a set of files (check Search files)

When searching through files (as opposed to translation memories), OmegaT restricts the search to files in source file formats. Consequently, although OmegaT is quite able to handle tmx files, it does not include them in the Search files search. If you turn on Advanced Options, you can combine the search with the name of the author of the translation and time of the last change made.

2. Using wild cards

In both exact and keyword searches, the wild card search characters '*' and '?' can be used. To use wild cards, the regular expressions option should not be selected, as '*' and '?' have special meaning in regular expressions.

  • '*' matches zero or more characters, from the current position in a given word to its end. The search term'run*' for example would match words 'run', 'runs' and 'running'.

  • '?' matches any single character. For instance, 'run?' would match the word 'runs' and 'runn' in the word 'running'.

The matches will be displayed in bold blue.

3. Search methods

Select the method using the radio buttons. You can choose between two methods to search:

exact search

Search for segments containing the exact string you specified. An exact search looks for a phrase, i.e. if several words are entered, they are found only if they occur in exactly that sequence. Searching for open file will thus find all occurrences of the string open file, but not file opened or open input file.

keyword search

Search for segments containing all keywords you specified, in any order. Select keyword search to search for any number of individual full words, in any order. OmegaT displays a list of all segments containing all of the words specified. Keyword searches are similar to a search "with all of the words" in an Internet search engine such as Google (AND logic). Using keyword search with open file will thus find all occurrences of the string open file, as well as file opened, open input file, file may not be safe to open, etc.

For either of these two methods you can select the following three options:

  • case sensitive: the search will be performed for the exact string specified; i.e. capitalization is observed.

  • regular expressions: The search string will be treated as a regular expression. A regular expression search is a powerful way to look for instances of a string. It is similar to a wild card search, but allows far more flexibility. The regular expressions used in searches are those supported by Java. See more in the chapter on regular Expressions.

  • search TMs: translation memories in the tm folder are included in the search.

4. Search results display

Pressing the search button after entering a string in the search field displays all the segments in the project that include the entered string. As OmegaT handles identical segments as one single entity, only the first unique segment is shown.

The segments are displayed in order of appearance in the project. Translated segments are displayed with the original text at the top and the translated text at the bottom, untranslated segments are displayed as the source only.

Clicking on a segment opens it in the Editor for modifications. You can then switch back to the Search window for the next segment found, for instance to check and, if necessary, correct the terminology.