DRAFT of specification if Indexing By words for strings.

Sims, John AYU8 at CDC.GOV
Wed Sep 22 11:09:30 CDT 2004


Hi Ruslan,

> 
> Hi John,
> 
> >>>>     Vstring.UseIndexPrefs( prefsName )
> >>>> 
> > 
> > If I am understanding your concept correctly, I think we 
> should also 
> > have
> > 
> > Vstring.UseIndexPrefs( inPrefsName() AS String )
> > 
> > So that we can pass multiple IndexStrPrefs.
> > 
> > For example, if I create 3 IndexStrPrefs:
> > 
> > IndexStrPrefs.Name = "One" :: Words to ignore = "a;an;the" 
> > IndexStrPrefs.Name = "Two" :: Words to ignore = "von;van;van der" 
> > IndexStrPrefs.Name = "Three" :: Words to ignore = "and;or;but"
> > 
> > It would be nice to be able to say:
> > 
> > myVstring1.UseIndexPrefs("One") => Ignores "a;an;the"
> > myVstring2.UseIndexPrefs("Two") => Ignores "von;van;van der"
> > 
> > dim strPrefs(2) as string
> > strPrefs(0) = "One"
> > strPrefs(1) = "Two"
> > strPrefs(2) = "Three"
> > 
> > myVstring3.UseIndexPrefs( strPrefs ) => Ignores 
> "a;an;the;von;van;van 
> > der;and;or;but"
> > 
> > I hope I made sense.
> 
> Very good point.
> 
> Hmm, follow this, we can think about inheritance of lists.
> But better no.
> 
> Better combination as you point...
> 
> Although what to do if combined Prefs have different IngoreLength ?
> 
> 
> 
> > As always, thank you for letting us contribute our ideas 
> and keep up 
> > the great work!
> 
> Ok, so we have more hard work now :-)


I also saw the possibility of different ignore lengths as a problem but
wanted to tell you my idea while this concept is still in the early
stages.

Perhaps you should place this responsibility on the developer to use
combinations of IndexStrPrefs in ways that make sense and set the rules
as something like the following:

If combining 2 or more IndexStrPrefs and any of them have IgnoreLength >
0, then you use the largest ignore length.  If any of them have words to
ignore, then those words are ignored in addition to words that fall
under the IgnoreLength.  This could be quite powerful.

For example:

Prefs1.Name = "SingleLetters" :: IgnoreLength = 1
Prefs2.Name = "LittleWords" :: IgnoreLength = 2
Prefs3.Name = "Colors" :: Words to ignore =
"red;blue;green;yellow;orange;purple;white;black"

Dim myPrefs(2) as string
myPrefs(0) = "SingleLetters"
myPrefs(1) = "LittleWords"
myPrefs(2) = "Colors"

myVstring.UseIndexPrefs ( myPrefs ) :: would ignore any words with
length <= 2 and the words
"red;blue;green;yellow;orange;purple;white;black" ---- Notice that the
"SingleLetters" IndexStrPref does not really have any affect because it
is "overridden" by the "LittleWords" IndexStrPref due to its larger
IgnoreLength.  So, I as a developer should be smart enough to realize
the I do not need to include "SingleLetters" in my IndexStrPrefs array.
The correct call would be:

Dim myPrefs(1) as string
myPrefs(0) = "LittleWords"
myPrefs(1) = "Colors"

myVstring.UseIndexPrefs ( myPrefs )

Again, I hope I'm making good sense.

-John

PS. Sorry for helping you create more work for yourself :-)


More information about the Valentina-beta mailing list