1 package de.uni_hamburg.corpora.validation;
8 import java.io.IOException;
9 import java.net.URISyntaxException;
10 import java.util.Collection;
11 import javax.xml.parsers.ParserConfigurationException;
12 import javax.xml.transform.TransformerException;
13 import javax.xml.xpath.XPathExpressionException;
14 import org.xml.sax.SAXException;
24 boolean apostrophe =
false;
38 throws SAXException, IOException, ParserConfigurationException, URISyntaxException, TransformerException, XPathExpressionException {
40 comaFile = cd.toSaveableString();
41 if (comaFile.contains(
"'")) {
44 comaFile = comaFile.replaceAll(
"'",
"’");
46 cd.updateUnformattedString(comaFile);
47 cio.
write(cd, cd.getURL());
48 stats.
addFix(
function, cd,
"Corrected the apostrophes");
50 System.out.println(
"Coma file is containing apostrophe(s) ’");
51 stats.
addCritical(
function, cd,
"Coma file is containing apostrophe(s) ’");
54 stats.
addCorrect(
function, cd,
"Coma file does not contain apostrophes");
67 Class cl = Class.forName(
"de.uni_hamburg.corpora.ComaData");
69 }
catch (ClassNotFoundException ex) {
81 String description =
"This class checks whether or not the coma file " 82 +
"contains an apostrophe '. If it does then these all apostrophes" 83 +
" ' are changed to apostrophes ’.";
88 public Report function(
Corpus c, Boolean fix)
throws SAXException, IOException, ParserConfigurationException, URISyntaxException, TransformerException, XPathExpressionException {
91 stats =
function(cd, fix);
void addCritical(String description)
void addCorrect(String statId, String description)
Collection< Class<?extends CorpusData > > getIsUsableFor()
void addException(Throwable e, String description)
void write(CorpusData cd, URL url)
void addFix(String statId, CorpusData cd, String description)