Re: Stemming with german2 on hyphenated compound words

Simon <[email protected]> Wed, 25 Sep 2024 14:06:02 +0200
Newsgroups gmane.comp.search.snowball
Message-ID <trinity-3b81cf09-39f6-4065-87a9-22a6048f9e3d-1727265962928@3c-app-gmx-bs11>
--===============6159854716647996394==
Content-Type: text/html; charset=UTF-8

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>&nbsp;</div>

<div>Thanks for the explanation Olly. That makes a lot of sense actually.<br/>
<br/>
Unfortunately in my specific use-case I cannot split my tokens on hyphens (at least not without significant overhead), but I just tried elastic&#39;s &quot;minimal_german&quot; stemmer, which actually seems to solve this too, as it really only does minimal stemming, like the name suggests, where for example &quot;PA-Schiene&quot; is stemmed to &quot;PA-Schien&quot;, which is absolutely sufficient for me.<br/>
<br/>
But thanks anyway for helping me understand why the german stemmer behaves the way it does.<br/>
<br/>
Best Regards<br/>
Simon
<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b>&nbsp;Mittwoch, 25. September 2024 um 00:55 Uhr<br/>
<b>Von:</b>&nbsp;&quot;Olly Betts&quot; &lt;[email protected]&gt;<br/>
<b>An:</b>&nbsp;&quot;Simon&quot; &lt;[email protected]&gt;<br/>
<b>Cc:</b>&nbsp;[email protected]<br/>
<b>Betreff:</b>&nbsp;Re: [Snowball-discuss] Stemming with german2 on hyphenated compound words</div>

<div name="quoted-content">On Tue, Sep 24, 2024 at 10:23:23AM +0200, Simon wrote:<br/>
&gt; As an example I have 2 words: &quot;Export-Schnittstelle&quot; and &quot;Schnittstelle&quot;,<br/>
&gt; for these words the stemmer creates &quot;Export-Schnittstell&quot; or<br/>
&gt; &quot;Schnittstell&quot; respectively, which is great because with the right<br/>
&gt; tokenization I can now search for &quot;Schnitstelle&quot; (which the stemmer within<br/>
&gt; my search analyzer will transform to &quot;Schnittstell&quot;) and it will match the<br/>
&gt; second part from the word &quot;Export-Schnittstelle&quot; aka<br/>
&gt; &quot;Export-Schnittstell&quot;.<br/>
&gt;<br/>
&gt; Now I would expect that this is how it works for all hyphenated compound<br/>
&gt; words. But unfortunately that&#39;s not the case. So I now have 2 other words<br/>
&gt; &quot;PA-Schiene&quot; and &quot;Schiene&quot;. Here the stemmer creates two completely<br/>
&gt; different words: &quot;PA-Schi&quot; and &quot;Schien&quot;.<br/>
&gt;<br/>
&gt; Can someone explain to my why this is and if there is a way to fix this?<br/>
<br/>
It&#39;s essentially because the algorithm won&#39;t remove an ending if the<br/>
stem that would leave is too short. In this case removing &#96;-ene&#96; would<br/>
leave &#96;schi&#96; (too short) vs &#96;pa-schi&#96; (OK). It removes &#96;-e&#96; instead<br/>
for the former case since &#96;schien&#96; is long enough.<br/>
<br/>
I think you probably want to split words as hyphens when tokenising,<br/>
which would avoid such problems.<br/>
<br/>
Cheers,<br/>
Olly</div>
</div>
</div>
</div></div></body></html>


--===============6159854716647996394==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Snowball-discuss mailing list
[email protected]
https://lists.tartarus.org/mailman/listinfo/snowball-discuss

--===============6159854716647996394==--