Skip to content

Cyclical suggestion  #51

Description

@Kristober

I have a open issue in Yfirlestur but it's probably more appropriate for GreynirCorrect, creating here for visability.
Issue in Yfirlestur

If we take the text Hann vil for example. GreynirCorrect will give two suggestion, the latter one being the same as the original input. What appears to be happening is that the latter suggestion is based on the input being the first suggestion, instead of being based off the original input Hann vil.
As a consequence I get this cyclical suggestion: Hann vil -> Hann vill -> Hann vil... There is no resolution for the word vil / vill

Response given by Yfirlestur for text Hann vil

{
    "result": [
        [
            {
                "annotations": [
                    {
                        "code": "P_wrong_person",
                        "detail": null,
                        "end": 1,
                        "end_char": 7,
                        "references": [],
                        "start": 0,
                        "start_char": 0,
                        "suggest": "Hann vill",
                        "suggestlist": null,
                        "text": "Orðasambandið 'Hann vil' var leiðrétt í 'Hann vill'"
                    },
                    {
                        "code": "BEYGVILLA",
                        "detail": "Beygingarmyndin 'vill' er ekki í samræmi við málvenju, 'vil' er ákjósanlegra.",
                        "end": 1,
                        "end_char": 7,
                        "references": [],
                        "start": 1,
                        "start_char": 4,
                        "suggest": "vil",
                        "suggestlist": null,
                        "text": "Beygingarvilla: 'vill' -> 'vil'"
                    }
                ],
                "corrected": "Hann vil",
                "nonce": "41903140",
                "original": "Hann vil",
                "token": "458f66a39f679f710e313e3d1e456e0971abd7405453b32543e47048d4351b2d",
                "tokens": [
                    {
                        "i": 0,
                        "k": 6,
                        "o": "Hann",
                        "x": "Hann"
                    },
                    {
                        "i": 4,
                        "k": 6,
                        "o": " vil",
                        "x": "vil"
                    }
                ]
            }
        ]
    ],
    "stats": {
        "ambiguity": 1.0,
        "num_chars": 8,
        "num_parsed": 1,
        "num_sentences": 1,
        "num_tokens": 2
    },
    "text": "Hann vil",
    "valid": true
}

If I use the first suggestion Hann vill and call this service again with my new string Hann vill I will get this suggestion (basically the latter suggestion again).

Response given by Yfirlestur for text Hann vill

{
    "result": [
        [
            {
                "annotations": [
                    {
                        "code": "BEYGVILLA",
                        "detail": "Beygingarmyndin 'vill' er ekki í samræmi við málvenju, 'vil' er ákjósanlegra.",
                        "end": 1,
                        "end_char": 8,
                        "references": [],
                        "start": 1,
                        "start_char": 4,
                        "suggest": "vil",
                        "suggestlist": null,
                        "text": "Beygingarvilla: 'vill' -> 'vil'"
                    }
                ],
                "corrected": "Hann vil",
                "nonce": "28078813",
                "original": "Hann vill",
                "token": "8d2b53caad5b029b1064172be9ca776a6c0b7b539af3e6b668973c937433ea7c",
                "tokens": [
                    {
                        "i": 0,
                        "k": 6,
                        "o": "Hann",
                        "x": "Hann"
                    },
                    {
                        "i": 4,
                        "k": 6,
                        "o": " vill",
                        "x": "vil"
                    }
                ]
            }
        ]
    ],
    "stats": {
        "ambiguity": 1.0,
        "num_chars": 9,
        "num_parsed": 1,
        "num_sentences": 1,
        "num_tokens": 2
    },
    "text": "Hann vill",
    "valid": true
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions