I did a quick POC for allowing back reference in match lemmas. The (rough)
patch is attached.
I must say I have mixed feelings about this: the logic in match state is
quite complicated, I've modified the code path that works for my rule and
also for the new test I've added. But tracing and
Jesper wrote:
> It looks very strange to me to include ".*" in a replacement expression.
I understand that it looks strange. But in some cases, the result of
replacement
is a regexp. That's why regexp syntax can appear inside the
regexp_replace="".
I see other examples in:
- the Polish
Yes, but I think those would be included in the $2 which catches everything
after fname (.*).
It looks very strange to me to include ".*" in a replacement expression.
But now I stated my observation so it is up to you if you want to go into
it.
Best,
Jesper
2016-09-13 23:21 GMT+02:00
There are some cases where last name would have extra tags.
Regards,
Andriy
On Sep 13, 2016 5:05 PM, "Jesper Hertel" wrote:
> Hi Andriy,
>
> As a beginner in LanguageTool I know almost nothing about this, but I do
> have a few decades of experience in regular
Hi Andriy,
As a beginner in LanguageTool I know almost nothing about this, but I do
have a few decades of experience in regular expressions, and the .* looks
strange to me in a replacement expression:
postag_replace="$1lname$2.*"
Are you sure it shouldn't simply be
postag_replace="$1lname$2"
2016-09-13 22:27 GMT+02:00 Andriy Rysin :
> Sorry if this is already written somewhere - I looked at wiki pages but
> could not find anything relevant.
>
> I have two tokens (first name and last name) and in the suggestion I want
> to inflect second token the same as the first.
On 2016-09-13 22:27, Andriy Rysin wrote:
> postag="(noun.*:m.*:)fname(.*)"
> postag_replace="$1lname$2.*">2
>
> but it sends the tests into 100% CPU loop and I don't have access to
> my Eclipse to try to debug this.
You can just run "jstack " to get a stacktrace and see where it's
looping.