Giter VIP home page Giter VIP logo

Comments (9)

LinguList avatar LinguList commented on July 27, 2024

This is the new behavior!

from abvd.

LinguList avatar LinguList commented on July 27, 2024

It is there to catch explicitly these errors.

from abvd.

LinguList avatar LinguList commented on July 27, 2024

Go to line 222 in pylexibank/providers/abvd.py and change add_lexemes to add_forms_from_value.

First fix, as add_lexemes is deprecated.

from abvd.

LinguList avatar LinguList commented on July 27, 2024

Ah, and if you think that the ? is "normal" behavior, you can fix this also from within there, and add a line that checks if this form actually is a question makr or not. I.e., you check entry.name and see if it is a valid entry.

from abvd.

LinguList avatar LinguList commented on July 27, 2024

Ah, I get it now, sorry for not reading properly before. There is something wrong, I guess, as the entry should not pass the clean_form command, which is called after splitting it, and yields an empty form, which is then NOT passed to add_form. And clean_form reacts per default specifically on ? as a character here.

from abvd.

LinguList avatar LinguList commented on July 27, 2024

So the fix we need is in pylexibank code, dataset.py:

    def split_forms(self, item, value):
        if value in self.lexemes:  # pragma: no cover
            self.log.debug('overriding via lexemes.csv: %r -> %r' % (value, self.lexemes[value]))
        value = self.lexemes.get(value, value)
        return [self.clean_form(item, form)
                for form in split_text_with_context(value, separators='/,;')]

needs to be modified to:

    def split_forms(self, item, value):
        if value in self.lexemes:  # pragma: no cover
            self.log.debug('overriding via lexemes.csv: %r -> %r' % (value, self.lexemes[value]))
        value = self.lexemes.get(value, value)
        forms = [self.clean_form(item, form)
                for form in split_text_with_context(value, separators='/,;')]
        return [f for f in form if f]

Or similar. As this will only return forms that are not None, and this is crashing the code by now.

from abvd.

LinguList avatar LinguList commented on July 27, 2024

I'd say, this is a good example, why it was good to modify the behavior of the add_lexemes to being more transparent.

from abvd.

LinguList avatar LinguList commented on July 27, 2024

Just linked this as a bug in pylexibank.

from abvd.

SimonGreenhill avatar SimonGreenhill commented on July 27, 2024

Fixed.

from abvd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.