[pt] Portuguese rule contribution/discussion

Hi All,

Just using this thread as suggested to report a Euro Portuguese issue. It looks like the Portuguese-Portugal library doesn’t like perfectly fine 2nd person conjugations:

The tool suggests to replace with a formal treatment, but these verbs are all fine. Fixing this would reduce false flags significantly.

Thanks!

Blue highlights stands for style.
When you are addressing unknown people, the use of “tu” is consider informal and as such, potentially disrespectful. You may not have dealt with it yet, since it depends on the environment that you move in, and which people you usually address but this distinction is not unique to European Portuguese.

False positive is when a rule detects something that it is not meant to detect, but this rule was designed to detect this and it was actually designed to have only false negatives, which it does in a great amount.

Error types are designed independently, so, if this rule does not apply to your writing style, just click “Ignore this type of error”.

Thanks for the details, Thiago. I was looking to reduce the number of these flags in the API, so we will try to disable the stylistic suggestions.

S

@tiagosantos

Hello Tiago!

I know you are a busy person, but I found a false positive:
“Vamos todos comer a sopa!”

Could you find some free time to improve this?

Thank you!

Hi Marco,

I think this case can be solved with disambiguation. I’ll look into it.

Regards

@tiagosantos

Hello Tiago,

I was trying to create a rule but it gives errors in TESTRULES PT.

What is wrong with this?:

<rule id='PREFERIR_ANTES' name="Preferir">
<!--      Created by Marco A.G.Pinto, Portuguese rule      -->
  <pattern>
      <token inflected='yes'>preferir</token>
		  <token>antes</token>
  </pattern>
  <message>Substitua por <suggestion><match no='1' postag='V.+' postag_regexp='yes'>preferir</match></suggestion>.</message>
  <example correction="prefere">A Ana <marker>prefere antes</marker> a Matemática.</example>
</rule>	

Thanks!

Same verb, no need to inject POSs. Try replacing: <match no='1' postag='V.+' postag_regexp='yes'>preferir</match> for this: \1

Thanks, it worked!

1 Like

@tiagosantos

Hello,

Sorry for not being very active lately due to lack of free time.

I found a bug in the latest pt_PT.

When we use ": " it says it requires a space at the end, but the space is already there.

A few nightlies ago, LT for pt_PT wasn’t also suggesting the dash in some “-”.

Just two bug reports.

Thank you!

Kind regards,

@tiagosantos

Hello!

Where is the file in which we add morphologic data.

I am unable to find it.

I want to add to it some words.

Thank you!

It’s org/languagetool/resource/pt/added.txt

Thank you, Daniel.

@tiagosantos

I have added:

|cibersegurança|cibersegurança|NCCS000|
|ciberdefesa|ciberdefesa|NCFS000|
|freeware|freeware|NCMS000|
|shareware|shareware|NCMS000|

Could you confirm it all is correct?

Thanks!

Looks good to me.

@tiagosantos

The following sentence seems to give two false positives:

A Ana é perita em páginas web.

I noticed “web” hasn’t got morphologic information.

How do I add it to added.txt since it is both plural and singular?

Thanks!

The false positive in perita should be fixed now. Regarding web, it is indeed an unescapable barbarism, but:

That would be the neutral tag. For unusual combinations check:

@tiagosantos

I don’t want to screw up before the official release, so, to be sure:

web web NCFN000

Is this I need to add to added.txt?

Thank you!

Looks good.

@tiagosantos

A Ana é perita em páginas web.

Still gives a numeric error :frowning:

This should also be fixed now.