[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Case insensitive lookfor()
From: |
Rik |
Subject: |
Case insensitive lookfor() |
Date: |
Thu, 27 Oct 2011 20:07:38 -0700 |
All,
I chanced upon an issue with the lookfor () command today. I expected it
to find the exact string I was looking for, but instead it uses search_str
= lower (input_str). Presumably this new search_str was meant to be
compared against an all lower case version of the help string. However,
this is not what is in the doc-cache; only the true help text with
capitalization is in the doc-cache.
Example:
get_first_help_sentence ("ls")
ans = List directory contents.
lookfor ("List directory")
<nothing>
lookfor ("ist directory")
ls List directory contents.
The lower() call makes it impossible to find certain keywords, often Matlab
ones, which use mixed case such as "UniformOutput". Offhand, I would vote
for just removing the lower function call. However, if everyone is really
keen to have case insensitive matching then we could expand doc-cache to
store a lower-case version of all of the help text. This would double the
current doc-cache size from 1.3 MB to 2.6 MB.
Cheers,
Rik
- Case insensitive lookfor(),
Rik <=