apertium / apertium-rus

Apertium linguistic data for Russian
GNU General Public License v3.0
0 stars 0 forks source link

compiler generates ungrammatical entries #3

Open undrits opened 3 years ago

undrits commented 3 years ago

the problem seems to pertain only to compound nouns or clitics.

the commands used to generate:

$ ./autogen.sh && make -j $ lt-expand apertium-rus.rus.dix

image image image

mr-martian commented 3 years ago

What would the correct forms be? Or should these entries just be removed entirely?

mr-martian commented 3 years ago

Also 7 of the lines you posted have :>: indicating that they are analyzed but not generated - perhaps the person adding them thought they were non-standard, archaic, dialectal, or something like.

undrits commented 3 years ago

in the 1st example: there are actually over 3,500 wordforms generated for the lemma "опавший лист." most, if not all, are incorrect, because the adjective either does not have a gender feature (should be masculine), or it does not agree with the noun in gender or case, or both. i wouldn't use any of these.

2nd example: it looks like the inflection morpheme is attached not to the stem but to the lemma (which ends in a nominative case morpheme). so the inflected forms should be: служба, службе, службою, службы, службам, etc.

3rd example: the generated wordforms are illicit should be removed. also, the lemma is incorrect because it has, for some reason, what I assume to be a case morpheme ("ей") attached to the clitic "то". the correct lemma is "чей-то."

undrits commented 3 years ago

oh interesting. didn't know that's what :>: stands for. what does :<: means then?

undrits commented 3 years ago

here are the other entries for "опавший лист"

bad_examples.txt

ftyers commented 3 years ago

oh interesting. didn't know that's what :>: stands for. what does :<: means then?

:>: is analyse only, :<: is generate only. These are often used if you have some phenomenon, such as English a/an where the appropriate form is only known with extra-word context. So we generate the form like ~a with a special symbol, and then a separate stage converts it to an or a depending on the following word. The ~ symbol is to let this second stage know that it needs to do some processing, e.g. to distinguish from simply the letter 'a'.

mr-martian commented 3 years ago

:<: is generate but don't analyze

First example

Fixing this is probably beyond my competence (I don't know any Russian)

Second example

I think this is the line in question (91915 in apertium-rus.rus.dix)

    <e lm="служба"><p><l>служб</l><r>служба</r></p><par n="аббревиатура__n_f_nn"/></e>

The stem is indeed given here as служба - should it be служб?

ftyers commented 3 years ago

In terms of the multiword tokens, dealing with these inside the analyser itself is deprecated and they should probably be removed. The right place for them is apertium-separable.

ftyers commented 3 years ago

Second example

I think this is the line in question (91915 in apertium-rus.rus.dix)

    <e lm="служба"><p><l>служб</l><r>служба</r></p><par n="аббревиатура__n_f_nn"/></e>

The stem is indeed given here as служба - should it be служб?

The stem is служб, the lemma is служба, note the dictionary has <p> there not <i>.

mr-martian commented 3 years ago

Second example

I think this is the line in question (91915 in apertium-rus.rus.dix)

    <e lm="служба"><p><l>служб</l><r>служба</r></p><par n="аббревиатура__n_f_nn"/></e>

The stem is indeed given here as служба - should it be служб?

The stem is служб, the lemma is служба, note the dictionary has <p> there not <i>.

Ah, I was thinking of lex[cd] and thought left was analysis

undrits commented 3 years ago

another issue:

incorrect feminine and plural wordforms are generated for certain proper names. these proper names do not conjugate in feminine or plural (should be just Маркс)

Маркса:Маркс<np><cog><f><sg><nom>

Марксы:Маркс<np><cog><mf><pl><nom>

Рузвельты:Рузвельт<np><cog><mf><pl><nom>

Уилсоны:Уилсон<np><cog><mf><pl><nom>

etc.

ftyers commented 3 years ago

Here are some entries which should probably be removed to apertium-separable:

fran@ipek:~/source/apertium/languages/apertium-rus$ cat apertium-rus.rus.dix  | grep 'lm="' | grep -v 'lm="[а-яА-Я¹²³⁻A-Z\.-]\+"' | grep '_n[^p]'
    <e lm="несколько десятков"><i>нескольк</i><par n="нескольк/о__num_mfn"/><p><l><b/>десятков</l><r><g><b/>десятков</g></r></p></e>
    <!-- <e lm="несколько десятков"><p><l>нескольк</l><r>несколько</r></p><par n="нескольк/о__num_mfn"/><p><l><b/>десятков</l><r><g><b/>десятков</g></r></p></e> -->
    <e lm="гальваническое покрытие"><i>гальваническое<b/>покрыти</i><par n="аблактирование__n_nt_nn"/></e>
<e lm="сторона Мекки"><p><l>сторон<b/>Мекки</l><r>сторона<b/>Мекки</r></p><par n="абажур__n_m_nn"/></e>
    <e lm="блокпостn"><p><l>блокпост</l><r>блокпостn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="грунтn"><p><l>грунт</l><r>грунтn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="дубn"><p><l>дуб</l><r>дубn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="дымn"><p><l>дым</l><r>дымn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="жирn"><p><l>жир</l><r>жирn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="зобn"><p><l>зоб</l><r>зобn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="зоосадn"><p><l>зоосад</l><r>зоосадn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="клейn"><p><l>клей</l><r>клейn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="коленвалn"><p><l>коленвал</l><r>коленвалn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="крюкn"><p><l>крюк</l><r>крюкn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="лужокn"><p><l>лужок</l><r>лужокn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="медn"><p><l>мед</l><r>медn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="мелn"><p><l>мел</l><r>мелn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="метромостn"><p><l>метромост</l><r>метромостn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="мех¹n"><p><l>мех</l><r>мех¹n</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="мозгn"><p><l>мозг</l><r>мозгn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="мысn"><p><l>мыс</l><r>мысn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="пухn"><p><l>пух</l><r>пухn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="распредвалn"><p><l>распредвал</l><r>распредвалn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="ройn"><p><l>рой</l><r>ройn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="сокn"><p><l>сок</l><r>сокn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="спиртn"><p><l>спирт</l><r>спиртn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="стогn"><p><l>стог</l><r>стогn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="супn"><p><l>суп</l><r>супn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="таз²n"><p><l>таз</l><r>таз²n</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="уголокn"><p><l>уголок</l><r>уголокn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="фортn"><p><l>форт</l><r>фортn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="хлевn"><p><l>хлев</l><r>хлевn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="цехn"><p><l>цех</l><r>цехn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="чай¹n"><p><l>чай</l><r>чай¹n</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="чанn"><p><l>чан</l><r>чанn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="шелкn"><p><l>шелк</l><r>шелкn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="шляхn"><p><l>шлях</l><r>шляхn</r></p><par n="блокпостn__n_m_nn"/></e>
    <e lm="ленn"><p><l>л</l><r>ленn</r></p><par n="ленn__n_m_nn"/></e>
<e lm="Средиземное море"><i>Средиземное<b/>море</i><par n="Иваново__np_top_nt"/></e>
<e lm="Балтийское море"><i>Балтийское<b/>море</i><par n="Иваново__np_top_nt"/></e>
        <e lm="Сергиев Посад"><i>Сергиев Посад</i><par n="Иваново__np_top_nt"/></e>
                <e lm="Taipei"><i>Taipei</i><par n="Иваново__np_top_nt"/></e>
                <e lm="Бра́йтон"><i>Бра́йтон</i><par n="Иваново__np_top_nt"/></e>
    <!-- <e lm="вышитая сорочка"><p><l>вышитая </l><r>вышитая сорочка</r></p><par n="звездочка__n_f_nn"/></e> -->
    <e lm="тeмнота"><p><l>тeмнот</l><r>тeмнота</r></p><par n="доброта__n_f_nn"/></e>
    <!-- <e lm="молодой человек"><p><l></l><r>молодой человек</r></p><par n="обезьяночеловек__n_m_aa"/></e> -->
    <!-- <e lm="аккуратный человек"><p><l></l><r>аккуратный человек</r></p><par n="обезьяночеловек__n_m_aa"/></e> -->
<e lm="борзая сука"><p><l>борзая су</l><r>борзая сука</r></p><par n="австралийка__n_f_aa"/></e>
<e lm="агресcия"><p><l>агресcи</l><r>агресcия</r></p><par n="хрия__n_f_nn"/></e>
<e lm="аккуратный человек"><p><l>аккуратный человек</l><r>аккуратный человек</r></p><par n="абрек__n_m_aa"/></e>
<e lm="ветряная мельница"><p><l>ветряная мельница</l><r>ветряная мельница</r></p><par n="абажур__n_m_nn"/></e>
<e lm="правая рука"><p><l>правая ру</l><r>правая рука</r></p><par n="аблактировка__n_f_nn"/></e>
<e lm="вышитая сорочка"><p><l>вышитая сороч</l><r>вышитая сорочка</r></p><par n="аблактировка__n_f_nn"/></e>
<e lm="грудной ребёнок"><p><l>грудной ребён</l><r>грудной ребёнок</r></p><par n="ангелок__n_m_aa"/></e>
<e lm="молодой человек"><p><l>молодой человек</l><r>молодой человек</r></p><par n="абрек__n_m_aa"/></e> <!--doit-->
<e lm="крепостное право"><p><l>крепостное прав</l><r>крепостное право</r></p><par n="аббатство__n_nt_nn"/></e> <!--doit-->
<e lm="будний день"><p><l>будний ден</l><r>будний день</r></p><par n="аваль__n_m_nn"/></e> <!--doit-->
<e lm="будничный день"><p><l>будничный день</l><r>будничный день</r></p><par n="аваль__n_m_nn"/></e> <!--doit-->
<e lm="лицевая сторона"><p><l>лицевая сторон</l><r>лицевая сторона</r></p><par n="доброта__n_f_nn"/></e>
<e lm="дикий кабан"><p><l>дикий кабан</l><r>дикий кабан</r></p><par n="абрек__n_m_aa"/></e>
    <e lm="десяток с лишним"><p><l>десят</l><r>десяток</r></p><par n="автокружок__n_m_nn"/><p><l><b/>с<b/>лишним</l><r><g><b/>с<b/>лишним</g></r></p></e>
    <e lm="сын гончара"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>гончара</l><r><g><b/>гончара</g></r></p></e>
    <e lm="сын дьяка"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>дьяка</l><r><g><b/>дьяка</g></r></p></e>
    <e lm="сын портного"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>портного</l><r><g><b/>портного</g></r></p></e>
    <e lm="сын мельника"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>мельника</l><r><g><b/>мельника</g></r></p></e>
    <e lm="сын сапожника"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>сапожника</l><r><g><b/>сапожника</g></r></p></e>
    <e lm="сын кузнеца"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>кузнеца</l><r><g><b/>кузнеца</g></r></p></e>
    <e lm="сын винокура"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>винокура</l><r><g><b/>винокура</g></r></p></e>
    <e lm="сын казака"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>казака</l><r><g><b/>казака</g></r></p></e>
    <e lm="сын ткача"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>ткача</l><r><g><b/>ткача</g></r></p></e>
    <e lm="сын кабатчика"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>кабатчика</l><r><g><b/>кабатчика</g></r></p></e>
    <e lm="сын бондаря"><p><l>сын</l><r>сын</r></p><par n="сын__n_m_aa"/><p><l><b/>бондаря</l><r><g><b/>бондаря</g></r></p></e>
    <e lm="помощник мельника"><p><l>помощник</l><r>помощник</r></p><par n="абрек__n_m_aa"/><p><l><b/>мельника</l><r><g><b/>мельника</g></r></p></e>
    <e lm="подмастерье кузнеца"><p><l>подмастерье</l><r>подмастерье</r></p><par n="подмастерье__n_m_aa"/><p><l><b/>кузнеца</l><r><g><b/>кузнеца</g></r></p></e>
    <e lm="потомок казака"><p><l>потомок</l><r>потомок</r></p><par n="ангелок__n_m_aa"/><p><l><b/>казака</l><r><g><b/>казака</g></r></p></e>
    <e lm="ученик портного"><p><l>ученик</l><r>ученик</r></p><par n="абрек__n_m_aa"/><p><l><b/>портного</l><r><g><b/>портного</g></r></p></e>
    <e lm="опавшие листья"><p><l>опавш</l><r>опавший</r></p><par n="заразнейший__adj"/><p><l><b/>лист</l><r><g><b/>лист</g></r></p><par n="зуб__n_m_nn"/></e>
    <e lm="подмастерье ткача"><p><l>подмастерье</l><r>подмастерье</r></p><par n="подмастерье__n_m_aa"/><p><l><b/>ткача</l><r><g><b/>ткача</g></r></p></e>
    <e lm="служба скорой помощи"><p><l>служба</l><r>служба</r></p><par n="аббревиатура__n_f_nn"/><p><l><b/>скорой</l><r><g><b/>скорой</g></r></p><p><l><b/>помощи</l><r><g><b/>помощи</g></r></p></e>
    <e lm="машина скорой помощи"><p><l>машина</l><r>машина</r></p><par n="аббревиатура__n_f_nn"/><p><l><b/>скорой</l><r><g><b/>скорой</g></r></p><p><l><b/>помощи</l><r><g><b/>помощи</g></r></p></e>
    <e lm="знак отличия"><p><l>знак</l><r>знак</r></p><par n="абак__n_m_nn"/><p><l><b/>отличия</l><r><g><b/>отличия</g></r></p></e>
    <e lm="чаша весов"><p><l>чаш</l><r>чаша</r></p><par n="аванложа__n_f_nn"/><p><l><b/>весов</l><r><g><b/>весов</g></r></p></e>
ftyers commented 3 years ago

another issue:

incorrect feminine and plural wordforms are generated for certain proper names. these proper names do not conjugate in feminine or plural (should be just Маркс)

Маркса:Маркс<np><cog><f><sg><nom>

This one almost certainly doesn't exist, that is correct.

Марксы:Маркс<np><cog><mf><pl><nom>

This one seems to exist: После начала Февральской революции 1848 году Марксы были высланы из Бельгии.

Рузвельты:Рузвельт<np><cog><mf><pl><nom>

This one seems to exist: Рузвельты (англ. Roosevelt, нидерл. van Rosenvelt) — американская политическая династия из Нью-Йорка, членами которой были два президента Соединенных Штатов, предприниматели, политики, изобретатели, священнослужители и деятели искусства.

Уилсоны:Уилсон<np><cog><mf><pl><nom>

It seems like the plurals are used, but the feminine form is not. This could be solved by assigning

    <e lm="Маркс"><i>Маркс</i><par n="Волошин__np_cog"/></e>

to a different paradigm. Probably like Коваленко__np_cog but with a plural form.

mr-martian commented 3 years ago

Is there a typical form to these multiwords? adj n? I could take a shot with my extraction scripts.

ftyers commented 3 years ago

See 9666b2d.

undrits commented 3 years ago

ungrammatical comparatives:

image

ftyers commented 3 years ago

This paradigm is wrong:

      <pardef n="кулацкий__adj">
        <e><p><l/><r><s n="adj"/></r></p><par n="S__абазинский"/></e>
        <e r="LR"><p><l>а</l><r><s n="adj"/><s n="short"/><s n="f"/><s n="sg"/></r></p></e>
        <e r="LR"><p><l/><r><s n="adj"/><s n="short"/><s n="m"/><s n="sg"/></r></p></e>
        <e r="LR"><p><l>и</l><r><s n="adj"/><s n="short"/><s n="mfn"/><s n="pl"/></r></p></e>
        <e r="LR"><p><l>о</l><r><s n="adj"/><s n="short"/><s n="nt"/><s n="sg"/></r></p></e>
        <e><p><l>о</l><r><s n="adj"/><s n="cmp"/></r></p></e>
        <e><p><l>более<b/></l><r><s n="adj"/><s n="comp"/></r></p><par n="S__абазинский"/></e>
      </pardef>

Probably the way to fix it is to just remove the last line.

$ cat apertium-rus.rus.dix | grep кулацкий__adj | wc -l
5055
ftyers commented 3 years ago

@yulia-sp depending on what you are planning to use this data for, a grep -v ' ' would give you only the entries with no spaces in. Many of the entries with spaces in will be specifically for machine translation as opposed to linguistic analysis. Some of them may be valid multiwords, some of them may be only useful in particular translation contexts.

undrits commented 3 years ago

@ftyers i am planning to use it for some morphological analysis so that would be definitely useful. thanks!!