Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No indices being built for variants #2

Closed
vzam opened this issue Mar 3, 2023 · 2 comments
Closed

No indices being built for variants #2

vzam opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vzam
Copy link

vzam commented Mar 3, 2023

Currently the index for the variants of a word in not filled in the XMLLexicon, which is why the words in a lexicon cannot be resolved by their variants. I checked the source and the index is never being assigned to so I guess it was forgotten about. You can see it yourself when you compare the source with the english variant of simpleNLG.

Here is a test in written kotlin that should succeed:

    @Test
    fun `noun phrase resolves word from lexicon by variant`() {
        val lexicon = Lexicon.getDefaultLexicon()
        val factory = NLGFactory(lexicon)

        val nounPhrase = factory.createNounPhrase("Menschen")

        assertEquals("Mensch", (nounPhrase.noun as WordElement).baseForm)
    }
@DaBr01 DaBr01 self-assigned this Mar 6, 2023
@DaBr01 DaBr01 added the bug Something isn't working label Mar 6, 2023
@DaBr01
Copy link
Contributor

DaBr01 commented Mar 6, 2023

Thanks for pointing this out. I will look into it.

DaBr01 added a commit that referenced this issue Mar 6, 2023
…ersion of inflected forms back to their lexical base form (#2)
@DaBr01 DaBr01 closed this as completed Mar 10, 2023
@DaBr01 DaBr01 reopened this Mar 10, 2023
@DaBr01
Copy link
Contributor

DaBr01 commented Mar 10, 2023

This will be fixed with the next commit, however, it should be used carefully. Because German is much richer in variants than English, there is often ambiguity between variants. Menschen, for example, can be the plural form of Mensch, but it can also be Genitiv Singular, as in "Der Name des Menschen ist Bob". SimpleNLG-DE will simply take whatever appears first in the lexicon.

Therefore, it is safer to use the base form and set the properties manually in order to make sure the right form is chosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants