-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#96 start adding post and pre reform variants of Portuguese
- Loading branch information
1 parent
2720c78
commit f1b5d51
Showing
11 changed files
with
3,715 additions
and
3,496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...uage-modules/pt/src/main/java/org/languagetool/language/PostReformPortugalPortuguese.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* LanguageTool, a natural language style checker | ||
* Copyright (C) 2014 Daniel Naber (http://www.danielnaber.de) | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 | ||
* USA | ||
*/ | ||
package org.languagetool.language; | ||
|
||
import org.languagetool.rules.Rule; | ||
import org.languagetool.rules.pt.PostReformPortugueseCompoundRule; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Post-spelling-reform Portuguese. | ||
* @since 2.6 | ||
*/ | ||
public class PostReformPortugalPortuguese extends PortugalPortuguese { | ||
|
||
@Override | ||
public String getName() { | ||
return "Portuguese (Portugal, post-reform)"; | ||
} | ||
|
||
@Override | ||
public String getVariant() { | ||
return "post-reform"; | ||
} | ||
|
||
@Override | ||
public List<Class<? extends Rule>> getRelevantRules() { | ||
final List<Class<? extends Rule>> rules = new ArrayList<>(super.getRelevantRules()); | ||
rules.add(PostReformPortugueseCompoundRule.class); | ||
return rules; | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
...guage-modules/pt/src/main/java/org/languagetool/language/PreReformPortugalPortuguese.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* LanguageTool, a natural language style checker | ||
* Copyright (C) 2014 Daniel Naber (http://www.danielnaber.de) | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 | ||
* USA | ||
*/ | ||
package org.languagetool.language; | ||
|
||
import org.languagetool.rules.Rule; | ||
import org.languagetool.rules.pt.PreReformPortugueseCompoundRule; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Pre-spelling-reform Portuguese. | ||
* @since 2.6 | ||
*/ | ||
public class PreReformPortugalPortuguese extends PortugalPortuguese { | ||
|
||
@Override | ||
public String getName() { | ||
return "Portuguese (Portugal, pre-reform)"; | ||
} | ||
|
||
@Override | ||
public String getVariant() { | ||
return "pre-reform"; | ||
} | ||
|
||
@Override | ||
public List<Class<? extends Rule>> getRelevantRules() { | ||
final List<Class<? extends Rule>> rules = new ArrayList<>(super.getRelevantRules()); | ||
rules.add(PreReformPortugueseCompoundRule.class); | ||
return rules; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...-modules/pt/src/main/java/org/languagetool/rules/pt/PostReformPortugueseCompoundRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* LanguageTool, a natural language style checker | ||
* Copyright (C) 2006 Daniel Naber (http://www.danielnaber.de) | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 | ||
* USA | ||
*/ | ||
package org.languagetool.rules.pt; | ||
|
||
import org.languagetool.rules.AbstractCompoundRule; | ||
|
||
import java.io.IOException; | ||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* Checks that compounds (if in the list) are not written as separate words. | ||
* @since 2.6 | ||
*/ | ||
public class PostReformPortugueseCompoundRule extends AbstractCompoundRule { | ||
|
||
private static final String FILE_NAME = "/pt/post-reform-compounds.txt"; | ||
|
||
public PostReformPortugueseCompoundRule(final ResourceBundle messages) throws IOException { | ||
super(messages, FILE_NAME, | ||
"Esta palavra é hifenizada.", | ||
"Esta palavra é escrita em conjunto.", | ||
"Esta palavra é uma palavra ou com um hífen."); | ||
super.setShort("Juntos grafias de palavras"); | ||
} | ||
|
||
|
||
@Override | ||
public String getId() { | ||
return "PT_COMPOUNDS_PRE_REFORM"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Juntos ortografia de palavras, por exemplo 'CD-ROM' em vez de 'CD ROM'"; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...e-modules/pt/src/main/java/org/languagetool/rules/pt/PreReformPortugueseCompoundRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* LanguageTool, a natural language style checker | ||
* Copyright (C) 2006 Daniel Naber (http://www.danielnaber.de) | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 | ||
* USA | ||
*/ | ||
package org.languagetool.rules.pt; | ||
|
||
import org.languagetool.rules.AbstractCompoundRule; | ||
|
||
import java.io.IOException; | ||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* Checks that compounds (if in the list) are not written as separate words. | ||
* @since 2.6 | ||
*/ | ||
public class PreReformPortugueseCompoundRule extends AbstractCompoundRule { | ||
|
||
private static final String FILE_NAME = "/pt/pre-reform-compounds.txt"; | ||
|
||
public PreReformPortugueseCompoundRule(final ResourceBundle messages) throws IOException { | ||
super(messages, FILE_NAME, | ||
"Esta palavra é hifenizada.", | ||
"Esta palavra é escrita em conjunto.", | ||
"Esta palavra é uma palavra ou com um hífen."); | ||
super.setShort("Juntos grafias de palavras"); | ||
} | ||
|
||
|
||
@Override | ||
public String getId() { | ||
return "PT_COMPOUNDS_POST_REFORM"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Juntos ortografia de palavras, por exemplo 'CD-ROM' em vez de 'CD ROM'"; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...nguage-modules/pt/src/main/resources/META-INF/org/languagetool/language-module.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
languageClasses=org.languagetool.language.Portuguese,org.languagetool.language.PortugalPortuguese,org.languagetool.language.BrazilianPortuguese | ||
languageClasses=org.languagetool.language.Portuguese,org.languagetool.language.PortugalPortuguese,org.languagetool.language.PreReformPortugalPortuguese,org.languagetool.language.PostReformPortugalPortuguese,org.languagetool.language.BrazilianPortuguese |
11 changes: 11 additions & 0 deletions
11
...uage-modules/pt/src/main/resources/org/languagetool/resource/pt/post-reform-compounds.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# LanguageTool, a natural language style checker (http://www.languagetool.org) | ||
# Copyright (C) 2005-2014 Daniel Naber (http://www.danielnaber.de) | ||
|
||
# Portuguese post-reform compound words that are usually not written as | ||
# separate words. | ||
# Encoding: UTF-8 | ||
# All words must contain at least one hyphen, even if the | ||
# word is usually not spelled with a hyphen | ||
# "+" at the end of the line will turn off the suggestion that | ||
|
||
# TODO: add words here |
Oops, something went wrong.