Skip to content

Commit

Permalink
Extension of rules sh:010 and sh:011
Browse files Browse the repository at this point in the history
Change rule sh:010 to allow comma after the period.
Change rule sh:011 to allow comma after the period.
Add "e.g." to rule sh:011
  • Loading branch information
toolcreator committed Jul 19, 2019
1 parent 2d0f38b commit a043c22
Show file tree
Hide file tree
Showing 130 changed files with 387 additions and 306 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ If the `--check` option is used, you can add the `--languagemodel xx` option to

### LaTeX subtleties

- Use a backslash after the last period in "i.e." and "et al."; otherwise
LaTeX will think it is a full stop ending a sentence. [sh:010, sh:011]
- Use a backslash or a comma after the last period in "i.e.", "e.g." and "et al.";
otherwise LaTeX will think it is a full stop ending a sentence. [sh:010, sh:011]
- There should not be a space before a semicolon or a colon. If in your
language, typographic rules require a space here, LaTeX takes care of
inserting it without your intervention. [sh:d:005, sh:d:006]
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/src/ca/uqac/lif/textidote/rules/regex.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ sh:003 \\(sub)*section\{[A-Z0-9\s,:;]*?\} A section title should not be writte
sh:007 \\paragraph\{\s*[a-z].*?\} A paragraph heading should start with a capital letter.
sh:008 \\paragraph\{.*?[\.,;:]\s*\} A paragraph heading should not end with a punctuation symbol.
sh:009 \\paragraph\{[A-Z0-9\s,:;]*?\} A paragraph heading should not be written in all caps. The LaTeX stylesheet takes care of rendering titles in caps if needed.
sh:010 et al\.[^\\] Use a backslash after the period; otherwise LaTeX will think it is a full stop ending a sentence.
sh:011 i\.e\.[^\\] Use a backslash after the second period; otherwise LaTeX will think it is a full stop ending a sentence.
sh:012 \\fg\s Utilisez '\fg{}' au lieu de '\fg'; sinon le mot suivant sera collé au guillemet fermant.
sh:010 et al\.[^\\,] Use a backslash or comma after the period; otherwise LaTeX will think it is a full stop ending a sentence.
sh:011 (i\.e\.|e\.g\.)[^\\,] Use a backslash or comma after the second period; otherwise LaTeX will think it is a full stop ending a sentence.
sh:012 \\fg\s Utilisez '\fg{}' au lieu de '\fg'; sinon le mot suivant sera collé au guillemet fermant.

# Citations and references

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,85 @@ public void testCmul5()
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(1, ad_list.size());
}

@Test
public void test010_1()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("et al. foo"));
Rule r = m_rules.get("sh:010");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(1, ad_list.size());
}

@Test
public void test010_2()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("et al.\\ foo"));
Rule r = m_rules.get("sh:010");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(0, ad_list.size());
}

@Test
public void test010_3()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("et al., foo"));
Rule r = m_rules.get("sh:010");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(0, ad_list.size());
}

@Test
public void test011_1()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("i.e. foo"));
Rule r = m_rules.get("sh:011");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(1, ad_list.size());
}

@Test
public void test011_2()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("i.e.\\ foo"));
Rule r = m_rules.get("sh:011");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(0, ad_list.size());
}

@Test
public void test011_3()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("i.e., foo"));
Rule r = m_rules.get("sh:011");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(0, ad_list.size());
}

@Test
public void test011_4()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("e.g. foo"));
Rule r = m_rules.get("sh:011");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(1, ad_list.size());
}

@Test
public void test011_5()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("e.g.\\ foo"));
Rule r = m_rules.get("sh:011");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(0, ad_list.size());
}

@Test
public void test011_6()
{
AnnotatedString in_string = AnnotatedString.read(new Scanner("e.g., foo"));
Rule r = m_rules.get("sh:011");
List<Advice> ad_list = r.evaluate(in_string, in_string);
assertEquals(0, ad_list.size());
}
}
4 changes: 2 additions & 2 deletions docs/javadoc/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:03 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>All Classes (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:03 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>All Classes (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/Advice.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:13 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Advice (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/AdviceRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:13 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>AdviceRenderer (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/Linter.Language.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:13 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Linter.Language (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/Linter.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:13 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Linter (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/LinterException.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:13 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>LinterException (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Main (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/Rule.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Rule (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/RuleException.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:01 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>RuleException (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/as/AnnotatedString.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:02 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>AnnotatedString (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/as/Match.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:02 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Match (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/as/Position.Nowhere.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:02 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Position.Nowhere (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/as/Position.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:02 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Position (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/javadoc/ca/uqac/lif/textidote/as/Range.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_191) on Sat Jan 19 11:21:02 EST 2019 -->
<!-- Generated by javadoc (1.8.0_222) on Fri Jul 19 21:00:14 CEST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Range (TeXtidote Documentation)</title>
<meta name="date" content="2019-01-19">
<meta name="date" content="2019-07-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
Loading

0 comments on commit a043c22

Please sign in to comment.