
org.languagetool.rules.gl.GalicianBarbarismsRule Maven / Gradle / Ivy
/* LanguageTool, a natural language style checker
* Copyright (C) 2005 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.gl;
import org.languagetool.language.Galician;
import org.languagetool.rules.AbstractSimpleReplaceRule2;
import org.languagetool.rules.Categories;
import org.languagetool.rules.Example;
import org.languagetool.rules.ITSIssueType;
import org.languagetool.tools.Tools;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import java.net.URL;
/**
* A rule that matches words which should not be used and suggests correct ones instead.
* Romanian implementations. Loads the list of words from
* /ro/replace.txt
.
*
* @author Tiago F. Santos (localized from romanian)
* @since 4.0
*/
public class GalicianBarbarismsRule extends AbstractSimpleReplaceRule2 {
public static final String GALICIAN_BARBARISM_RULE = "GL_BARBARISM_REPLACE";
private static final String FILE_NAME = "/gl/barbarisms.txt";
private static final Locale GL_LOCALE = new Locale("gl"); // locale used on case-conversion
@Override
public final List getFileNames() {
return Collections.singletonList(FILE_NAME);
}
public GalicianBarbarismsRule(ResourceBundle messages) throws IOException {
super(messages, new Galician());
setCategory(Categories.STYLE.getCategory(messages));
setLocQualityIssueType(ITSIssueType.LocaleViolation);
addExamplePair(Example.wrong("curriculum vitae "),
Example.fixed("currículo "));
}
@Override
public final String getId() {
return GALICIAN_BARBARISM_RULE;
}
@Override
public String getDescription() {
return "Palabras de orixe estranxeira evitábeis";
}
@Override
public String getShort() {
return "Xenismo";
}
@Override
public String getMessage() {
return "'$match' é un xenismo. É preferíbel dicir $suggestions";
}
@Override
public String getSuggestionsSeparator() {
return " ou ";
}
@Override
public URL getUrl() {
return Tools.getUrl("https://gl.wikipedia.org/wiki/Xenismo");
}
@Override
public Locale getLocale() {
return GL_LOCALE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy