From: Didier B. <d....@fr...> - 2012-05-30 08:57:48
|
-----Original Message----- >From: Thomas CORDONNIER [mailto:t_c...@ya...] >Sent: Wednesday, May 30, 2012 10:32 AM >To: Mailing list for Omega T developers. >Subject: [OmTdev] Contraditory indications about Search window in the help >I noticed something strange in the behaviour of the Search window. So I had a look in the help but what I read seems to me contraditory. > >Let's have a look in chapter 16 : Searches > >Section 2 - Using wildcards >·The search term'run*' for example would match words 'run', 'runs' and 'running'. >This suggests that if I want to search for " any word beginning with 'run' " I must use the wildcard at the end, because 'run' means "the word run, exactly". Right? No. The wildcard is useful when you want to search ch* noir and get chien noir and chat noir. > >But let's continue. > >Section 3 - Search methods > > "Using keyword search with open file will thus find all occurrences of the string open file, as well as file opened, [...]" > >This second phrase suggests that "open file" is in fact equivalent to "*open* *file*" : if not, I cannot understand why "opened" matches when I type "open". > >So, I tested and effectively the actual behaviour in all kinds of searches (exact, keyword or regex) have a behaviour conform to the second hypothesis. >If I use the example from section 2, "run" and "run*" give exactly the same result. > >Now the question is simple: >don't you think the first behaviour (accept letters after or before the given word only if I explicitely ask for it using wildcard) is the correct one? >maybe the answer is yes for "exact search" but not for "keyword search"? or the contrary? > >My solution is to add \b (word boundary) in the pattern the system builds for "exact" and "keyword" searches. If the user explicitely uses wildcard, the system will build \brun\S*\b, which is correctly matched by "running", so the first example will still work, the second not. For "regex" search I think the user should type the word boundary explicitely because persons using regular expressions should be aware about that. > >If you agree, simply tell me what is your choice and I will send you the correction for the java code (but keep this in mind when you modify the documentation) I disagree, and suggest we improve the documentation if needed. The current behaviour is consistent with what you get in Word (and in Notepad, etc.), for instance om finds OmegaT. I dont want to spend my time typing wildcards while the current behaviour is fine for me and consistent with what one gets in a word processor. Didier |