[sword-devel] How to handle text context

Manfred Bergmann bergmannmd at web.de
Wed Apr 22 04:37:47 MST 2009


Yeah, thanks, Troy.

I figured something similar but I'm operating on a VerseKey and  
setting that to the module like:

vk.setVerse(vk.getVerse() - context);
for(int i = 0;i <= context*2+1;i++) {
	module.setKey(vk.getText());
	if(!module->Error()) {
		// render
	}
	vk.increment();
}

Is this more expensive regarding API calls?


Regards,
Manfred


Am 22.04.2009 um 12:08 schrieb Troy A. Griffitts:

> Dear Manfred.  My apologies for missing this.  I actually noticed it  
> and forgot to respond.
>
> I believe you just want something simple like:
>
> module->setKey("jn.3.16");
> for (
>       module-=(contextSize/2);
>       !module->Error() && contextSize;
>       module++,contextSize--) {
>
>  cout << module->RenderText();
>
> }
>
>
> Manfred Bergmann wrote:
>> Hi.
>> One missing feature I'd like to have in MacSword before versioning  
>> 2.0b is that it should be possible to show the context for index  
>> search results.
>> The search result is a list of verse keys. Now the user should be  
>> able to choose a context size: 1, 3, 5, 7 or 10 verses before and  
>> after the actual search result.
>> I'm not quite sure how to do this in the Sword API.
>> Should I create a list key and operate on that or use the operator  
>> overloading of the SWModule itself?
>> Any hints?
>> God bless,
>> Manfred
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list