4

RTextTools に付属のドイツ語ステマーを使用しようとしていますが、得られる結果はかなり的外れです。

たとえば、次のベクトルがあります。

v <- c("groß", "größer", "am", "größten", "ähnlicher")

使用する

library(RTextTools)
wordStem(v, "german")

私は得る

[1] "groß"    "größer"  "am"      "größten" "ähnlich"

何が足りないの??

4

1 に答える 1

2

Snowball のアルゴリズム

/*
    Extra rule for -nisse ending added 11 Dec 2009
*/

routines (
           prelude postlude
           mark_regions
           R1 R2
           standard_suffix
)

externals ( stem )

integers ( p1 p2 x )

groupings ( v s_ending st_ending )

stringescapes {}

/* special characters (in ISO Latin I) */

stringdef a"   hex 'E4'
stringdef o"   hex 'F6'
stringdef u"   hex 'FC'
stringdef ss   hex 'DF'
......

「DF」「ß」に翻訳されているようです

e に続くウムラウトの表現 ドイツ語の文字 ä、ö、ü は、それぞれ ae、oe、ue で表されることがあります。ここでのステ​​マーは、これを考慮して、主要なドイツ語ステマーの変形です。

主なドイツ語ステマーは、規則で始まります。

First, replace ß by ss, and put u and y between vowels into upper case. 

これは、ルールに置き換えられます。

Put u and y between vowels into upper case, and then do the following mappings,

    (a) replace ß with ss, **"MAYBE WRONG ORDER"**
    (a) replace ae with ä,
    (a) replace oe with ö,
    (a) replace ue with ü unless preceded by q. 



So in quelle, ue is not mapped to ü because it follows q, and in feuer it is not mapped because the first part of the rule changes it to feUer, so the u is not found. 
于 2012-06-08T22:13:48.377 に答える