Skip to content

Commit

Permalink
Closes #160 and #140
Browse files Browse the repository at this point in the history
Correctly handling the tilde (#160) solves #140 at the same time
  • Loading branch information
sylvainhalle committed Mar 31, 2021
1 parent bce40fb commit 3d2279e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Core/src/ca/uqac/lif/textidote/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class Main
/**
* A version string
*/
public static final String VERSION_STRING = "0.8.1";
public static final String VERSION_STRING = "0.8.2";

/**
* The name of the Aspell dictionary file to look for in a folder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ protected AnnotatedString removeMarkup(AnnotatedString as_out, int line_pos)
as_out = as_out.replaceAll("\\\\\\-", "");
// Non-breaking spaces
as_out = as_out.replaceAll("~", " ");
as_out = as_out.replaceAll("\\\\,", " ");
// Dots
as_out = as_out.replaceAll("\\\\(dots|cdots|ldots)", "...");
// Inline display math with only digits and letters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ public void testRemoveMarkup5() throws TextCleanerException
assertEquals("Hello", as.toString());
}

@Test
public void testRemoveMarkup6() throws TextCleanerException
{
LatexCleaner detexer = new LatexCleaner().setIgnoreBeforeDocument(false);
AnnotatedString as = detexer.clean(AnnotatedString.read(new Scanner("Something~with tilde")));
assertEquals("Something with tilde", as.toString());
}

@Test
public void testRemoveMarkup7() throws TextCleanerException
{
LatexCleaner detexer = new LatexCleaner().setIgnoreBeforeDocument(false);
AnnotatedString as = detexer.clean(AnnotatedString.read(new Scanner("Something\\,with comma")));
assertEquals("Something with comma", as.toString());
}

@Test
public void testRemoveMathMarkup1() throws TextCleanerException
{
Expand Down

0 comments on commit 3d2279e

Please sign in to comment.