Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenquotes.git

Add em as ambiguous contraction

AuthorDave Jarvis <email>
Date2022-08-27 18:48:25 GMT-0700
Commitb630827de832456de4f81d6177ad639be88f8d1c
Parentc9e451a
src/main/java/com/whitemagicsoftware/keenquotes/parser/Contractions.java
// armadillo
"dillo",
- // them
- "em",
// themselves,
"emselves",
// he|e pluribus unum
"e",
+ // them|letter m|em-dash|Emily
+ "em",
// here|earlier
"ere",
src/test/java/com/whitemagicsoftware/keenquotes/parser/CurlerTest.java
@Test
+ public void test_Parse_AmbiguousQuotes_PartiallyCurled() throws IOException {
+ testCurler( createCurler( FILTER_PLAIN ), "ambiguous-n-pass.txt" );
+ }
+
+ @Test
public void test_Parse_UncurledQuotesXml_CurlyQuotes() throws IOException {
testCurler( createCurler( FILTER_XML ), "xml.txt" );
src/test/resources/com/whitemagicsoftware/keenquotes/texts/ambiguous-n-pass.txt
# ########################################################################
Book 'em, Danno. Rock 'n' roll. ''Cause 'twas the season.
-Book &apos;em, Danno. Rock &apos;n&apos; roll. &lsquo;'Cause &apos;twas the season.
+Book &apos;em, Danno. Rock &apos;n&apos; roll. &lsquo;&apos;Cause &apos;twas the season.
-"Jarvis, sir? Why, him as 'listed some years ago, and fought under
-&ldquo;Jarvis, sir? Why, him as 'listed some years ago, and fought under
+The ’cause and effect’ consideration applies ’cause the horses’ hoofs are hard.
+The &lsquo;cause and effect&rsquo; consideration applies 'cause the horses' hoofs are hard.
src/test/resources/com/whitemagicsoftware/keenquotes/texts/unambiguous-2-pass.txt
# Single quotes
# ########################################################################
-
' '
&lsquo; &rsquo;
# Mixed
# ########################################################################
+She said, "Let's call them an 'em' and an 'en' dash based on letter widths."
+She said, &ldquo;Let&apos;s call them an &lsquo;em&rsquo; and an &lsquo;en&rsquo; dash based on letter widths.&rdquo;
+
"Granpa Harry 'spects you, Miss Mayton."
&ldquo;Granpa Harry &apos;spects you, Miss Mayton.&rdquo;
&ldquo;Not much o&apos; fellow-creaturs, I think, Miss; all I know—my old master, as war a knowin&apos; man, used to say, says he, &lsquo;If e&apos;er I sow my wheat wi&apos;out brinin&apos;, I&apos;m a Dutchman,&rsquo; says he; an&apos; that war as much as to say as a Dutchman war a fool, or next door. Nay, nay, I aren&apos;t goin&apos; to bother mysen about Dutchmen. There&apos;s fools enoo, an&apos; rogues enoo, wi&apos;out lookin&apos; i&apos; books for &apos;em.&rdquo;
-But I must leave the proofs to those who 've seen 'em;\n\nBut this I heard her say, and can't be wrong\n\nAnd all may think which way their judgments lean 'em,\n\n''T is strange---the Hebrew noun which means "I am,"\n\nThe English always use to govern d--n.'
-But I must leave the proofs to those who &apos;ve seen &apos;em;\n\nBut this I heard her say, and can&apos;t be wrong\n\nAnd all may think which way their judgments lean &apos;em,\n\n&lsquo;&apos;T is strange---the Hebrew noun which means &ldquo;I am,&rdquo;\n\nThe English always use to govern d--n.&rsquo;
+I leave proofs to those who 've seen 'em;\n\nBut this I heard her say, and can't be wrong\n\nAnd all may think which way their judgments lean 'em,\n\n''T is strange---the Hebrew noun which means "I am,"\n\nThe English always use to govern d--n.'
+I leave proofs to those who &apos;ve seen &apos;em;\n\nBut this I heard her say, and can&apos;t be wrong\n\nAnd all may think which way their judgments lean &apos;em,\n\n&lsquo;&apos;T is strange---the Hebrew noun which means &ldquo;I am,&rdquo;\n\nThe English always use to govern d--n.&rsquo;
+
+"Jarvis, sir? Why, him as 'listed some years ago, and fought under\n\nSir Reginald.'
+&ldquo;Jarvis, sir? Why, him as &lsquo;listed some years ago, and fought under\n\nSir Reginald.&rsquo;
# ########################################################################
Delta18 lines added, 8 lines removed, 10-line increase