New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pt] LanguageTool doesn't detect the need of crasis in sentence #3709
Comments
Yes, @jaumeortola said I need to create a list of words with crasis by hand. It is in my TO-DO list. |
I don't know how do you guys work with LanguageTool's code, but if you allow me, I have some pseudo-codes for you. By the way, I am using the grammar "A gramática para concursos públicos" by Fernando Pestana (most of the examples and explanations that I will use are from his grammar). It's a grammar for Brazilian Portuguese, I don't know how much it's different from European Portuguese. If LT sees some structure like ((noun OR adjective) + "a" + (noun OR adjective)) you already can say that something is wrong. For example, "Glória a rainha" can be corrected to "Glória , a rainha" or "Glória à rainha". Other example:
Since there is an indefinite article before "caça", LT can easily know that "caça" is a noun instead a conjugation of the verb "caçar". Even if LT doesn't know about prepositional phrases, the software can detect that there is something wrong here – rememeber the ((noun OR adjective) + "a" + (noun OR adjective)) "rule" –, so it can suggest the following sentences:
The sentence (1) is strange, but we expect that the user will be able to choose the correct sentence. LT surely already knows the gender of the nouns, so you can make the rule that the crasis cannot be used before masculine nouns (so you don't need to inform noun by noun, the software should be able to handle with it by itself). The crasis is not applicable to the sentence just below because the nouns are masculine:
Now you only need to worry with the exceptions, that are the feminine words "casa" and "terra":
But these exceptions have an exception, you must use the crasis if these words are accompanied by adjective or phrase with value of adjective (actually, anything that modifies the noun if I am not mistaken):
Here is my pseudo-code
I believe that the list of words that you need to make manually is a list of verbs, am I right? Because seems to me that LT can detect the gender of the Portuguese noun. Does LT can determine whether a Portuguese verb is intransitive, direct transitive or indirect transitive?
"Conheço a aluna" doesn't have crasis because "conhecer" is a direct transitive verb while "Refiro-me à aluna" has crasis because "referir" is an indirect transitive verb. It's very difficult (if it's not impossible) to LT know if it's dealing with a general noun (that does'n receive crasis) or a defined noun (that receives crasis). So it's better if LT treat this case like the crasis is optional here (actually it's not optional, the rules are clear! But it's difficult to teach a software to know the difference...). The following two sentences are correct, the difference is that the nouns in the first one have general meaning while the nouns in the second sentence are individualized.
From now, I will talk only about more cases where the crasis is prohibited. I don't tell about other obligatory cases because I don't know how would you teach LT how to detect adjective/adverbial/conjunctive/prepositional "locuções", although the ((noun OR adjective OR pronoun) + "a" + (noun OR adjective OR pronoun)) "rule" can accidentally detect a lot of these "locuções". Also, I won't talk about the facultative cases because I don't think it's necessary to LT and only would make thing more complex than they already are. There is no crasis before the indefinite article "uma":
However, there is an exception, before a numeral showing time, you must use crasis
There is no crasis before names of saints or famous women:
But Pestana says that the crasis is mandatory in "Tenho devoção à Virgem" because the definite article can appear because fo intentional/emotional/stylistic reasons, therefore, if we want to be close to such historic figures, treating them with affection, the use of article is not wrong.
There is no crasis before personal pronouns, interrogative pronouns, undefined pronouns, demonstrative pronouns and relative pronouns.
But of course that there are exceptions... you can use crasis before:
There is no crasis before a verb in the infinitive
There is no crasis after any preposition
There is no crasis between repeated words that form a phrase
There is no crasis before expressions substantived sentences
Of course that there are more information to be taken into account and my pseudocode surely has a lot of flaws, but I do think that it's a good start. |
Here is the sentence:
It should be:
For those who don't know Portuguese, the crasis "à" is a contraction between the preposition "a" (that means "to" or "at") and the feminine definite article "a".
Anyway, even if a crasis doesn't apply here, LT should notice that something is strange since there is a possible definite article ("a") just after a name ("policial") but nothing between them. The following four sentences below are correct:
Exposta, a polícia - The police is exposed
Exposta à polícia - She is exposed to the police
Glória, a rainha - Glória the queen
Glória à rainha - Glory to the queen
However, the following two sentences below are wrong, but LT doesn't detect any error.
Exposta a polícia
Glória a rainha
The text was updated successfully, but these errors were encountered: