daniel-lerch / vocup

Vocabulary trainer.
https://www.microsoft.com/store/apps/9N6W2H3QJQMM
GNU Affero General Public License v3.0
9 stars 3 forks source link

Evaluate optional expressions only works when a space is included #61

Open jdelange22 opened 6 months ago

jdelange22 commented 6 months ago

Right now, an optional expression is only considered optional when there is a space before the first bracket (the first of the two parentheses). I sometimes find words that have this optional expression without a space before. Like "some(one)" for example. The part "(one)" in this example isn't considered optional.

daniel-lerch commented 6 months ago

Feel free to open a PR to fix this. It should be possible to implement this entirely in Vocup.Util.Evaluator.

jdelange22 commented 6 months ago

@daniel-lerch so you agree with me this needs fixing? Even though this is programmed to work the way it is right now right? I saw the evaluator so the fix is pretty simple. Will make a PR.

daniel-lerch commented 6 months ago

As you can see in the unit tests, I mostly had English verbs with (to) {verb} in mind when designing this feature. The edge case upset (about sth)/(that) in the unit test is a strange example. Users could enter that word as upset (about sth/that) to get a proper optional expression evaluation.

Please go ahead fixing this.