Git Product home page Git Product logo

Comments (9)

danielnaber avatar danielnaber commented on July 20, 2024

The min/max stuff is still buggy, see the ignored tests in PatternRuleMatcherTest. So instead of porting the buggy change to disambiguation, I'm still trying to find a clean solution based on a finite state machine. That work happens in my personal fork at https://github.com/danielnaber/languagetool/commits/new_engine

from languagetool.

milekpl avatar milekpl commented on July 20, 2024

OK, changing the flag on this...

from languagetool.

milekpl avatar milekpl commented on July 20, 2024

Daniel, as you can see in the repo, I thought I had a cleaner implementation. But I don't, and I didn't solve the "min="2" problem.

However, after thinking a bit, we may use a similar strategy as we use with < or > and phrases: simply create n rules in memory for min=n, by repeating token n times in the rule, and appropriately renumbering any match elements and references? This is basically the strategy used by DFA/NFA algorithms when compiling {n,m} to automata, and it seems to be the easiest. I fixed the reason for failing tests in the PatternRuleMatcherTest (it was a very easy bug), so that's the only remaining problem, right?

from languagetool.

danielnaber avatar danielnaber commented on July 20, 2024

Yes, that seems to be the easiest way. It would be good if you can give it a try.

from languagetool.

milekpl avatar milekpl commented on July 20, 2024

OK, will do.

from languagetool.

milekpl avatar milekpl commented on July 20, 2024

Seems to work fine right now, and I don't see any remaining bugs (more tests are now in demo rules, as we deal with "min" via XML loader). One thing that I do not understand is why we have multiple rule matches for max > 1. Is that on purpose?

from languagetool.

danielnaber avatar danielnaber commented on July 20, 2024

I don't remember... maybe the fact that I couldn't get that working was one of the reasons I limited it to 1 in the first place. But it seems wrong.

from languagetool.

milekpl avatar milekpl commented on July 20, 2024

Well, you did not limit "max"... I will look into that then.

from languagetool.

milekpl avatar milekpl commented on July 20, 2024

OK, it works, but as we could have some GSoC students, I'll simply add issues for these fixes (they are quite trivial).

from languagetool.

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.