[sword-devel] Idea: aliased names in LD

Troy A. Griffitts sword-devel@crosswire.org
Sun, 02 Jun 2002 10:28:03 -0700


Victor,
	This mechanism already exists, in principle, in the sword engine, though, 
not sure if any lexicons actually use it yet.  Many commentaries do, 
however.  You may try it with code like this:

RawLD::CreateModule("/path/to/module/mylexicon");
RawLD myLex("/path/to/module/mylexicon");

// set text for Behemoth
myLex.SetKey("Behemoth");
myLex << "A Behemoth and a hipppopotamus are though to be the same 
creature";

// link same text for hippo
myLex.SetKey("hippopotamus");
myLex << StrKey("Behemoth");

<< is overloaded in that if you pass a string, it will change the text 
of the entry.  If you pass an SWKey, it will link to the entry pointed 
to by that key.  Hope this makes sense and helps.

Again, know that it SHOULD work with lexicons/dictionaries.  It may not, 
as we have not yet created any of these types of modules that use this 
mechanism.  Feel feel to point out the bugs! (and preferably a patch!)

	-Troy.



Victor Porton wrote:
> One more idea (there exist a real example of useful application, but not 
> simple to explain in short):
> 
> LDs with aliased keys (two or more different keys designating the same entry, 
> and even when the entry designated by one of the keys changes, the other 
> changes accordingly also). It is just like hard links in Unix/Linux.
> 
> "Behemoth" and "hippopotamus" for example :-)