<br>Hey Olly,sorry for sending too many mails.I was just a bit to excited as I had written my first piece of code for Xapian.It wont happen again.Thanks for all the help you've given me.Ill figure out a way of integrating the stemmer with the library.Will contact you once that is over and Ive sent a pull request on github.Sorry again.<br>
<br>-Yours Sincerely<br>Aarsh<br><br><div class="gmail_quote">On Mon, Jan 21, 2013 at 2:40 AM, Olly Betts <span dir="ltr"><<a href="mailto:olly@survex.com" target="_blank">olly@survex.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Jan 21, 2013 at 12:21:51AM +0530, aarsh shah wrote:<br>
> Hey there Olly,hope you are fine . :) I have the code for Paice Husk ready<br>
> .But I am not being able to modify the Xapian source code I have downloaded.<br>
><br>
> I modified the stem.cc file so that get_description() returns a default<br>
> welcome string insead of calling the internal get_description() method<br>
> (just for fun ) .I than used make and make install again and then wrote a<br>
> simple indexer which called the stem.get_description() method .However,I<br>
> got the original string instead of the one I had modified.Why didn't the<br>
> change I had made get reflected ? I know this is a naive question but I am<br>
> new to open source and have never modified open source code before.Sorry<br>
> for taking up your time.I tried everything I could ,( even built the entire<br>
> code again) but nothing happened.<br>
<br>
</div>It's not a naive question, though I suspect it is a common pitfall<br>
you've run into.<br>
<br>
If you're on a platform where Xapian is installed by default, such as<br>
Debian or Ubuntu, then you'll already have a copy of the xapian runtime<br>
shared library installed in /usr/lib (or some equivalent multiarch<br>
directory, such as /usr/lib/x86_64-linux-gnu). The exact filename<br>
will depend on the OS and the version of Xapian, but for xapian-core 1.2<br>
on Linux, it's libxapian.so.22 (the 22 tells you this is ABI compatible<br>
with other builds which produce libxapian.so.22).<br>
<br>
If you build a version of xapian-core which produces libxapian.so.22<br>
(which roughly speaking means any version 1.2.x), and install this, it<br>
will go in /usr/local/lib by default, but the dynamic linker will look<br>
under /usr/lib first and find the system version.<br>
<br>
On Linux, you can see which libxapian you're getting by running "ldd" on<br>
a binary:<br>
<br>
$ ldd /usr/bin/xapian-compact<br>
linux-vdso.so.1 => (0x00007fff3855e000)<br>
libxapian.so.22 => /usr/lib/libxapian.so.22 (0x00007f544c029000)<br>
[snip]<br>
<br>
On Linux, you can set LD_LIBRARY_PATH to tell the dynamic linker where<br>
to look first (other platforms usually have a similar environmental<br>
variable, but it may have a different name):<br>
<br>
$ LD_LIBRARY_PATH=/usr/local/lib ldd /usr/bin/xapian-compact<br>
linux-vdso.so.1 => (0x00007fffb03ff000)<br>
libxapian.so.22 => /usr/local/lib/libxapian.so.22 (0x00007f0c22fda000)<br>
<br>
None of this is specific to Xapian (except the filenames in the<br>
examples) - you'll hit the same issues dealing with parallel installs of<br>
any shared library.<br>
<div class="im"><br>
> The code for the paice husk stemmer is ready and Ive understood how to use<br>
</div>> it for indexing.Ir am supposed to inherit Xapian::StemImplementation<br>
<div class="im">> ,implement the pure virtual functions(have already done that) and than<br>
> pass a reference to the inherited object to<br>
> Xapian::Stem::Stem(StemImplementaion *pointer) ,right ? :)<br>
<br>
</div>To be clear, you pass a pointer, not a reference (the two terms have<br>
particular meanings in C++). Note that the Stem object you construct<br>
takes ownership of the pointer, so you want to create your subclass<br>
object with new, e.g.:<br>
<br>
Xapian::Stem s(new StemImplementationPaiceHusk());<br>
<br>
Cheers,<br>
Olly<br>
</blockquote></div><br>