Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Commit

Permalink
Added unicode fractions to Swedish translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Håkansson committed Aug 14, 2013
1 parent b6f73bd commit b1899db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public void setLocale(FilterLocale target) {
filters = new CombinationFilter();
// Remove zero width space
filters.add(new RegexFilter("\\u200B", ""));
// vulgar fraction preceded by a digit must be separated by a space
filters.add(new RegexFilter("([\\d]+)([¼½¾])", "$1 $2"));
// One or more digit followed by zero or more digits, commas or periods
filters.add(new RegexFilter("([\\d]+[\\d,\\.]*)", "\u283c$1"));
// Insert a "reset character" between a digit and lower case a-j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@
<entry key="©">&#x2826;&#x2809;&#x2834;</entry> <!-- COPYRIGHT SIGN, 00a9 -->
<entry key="">&#x2826;&#x281E;&#x280D;&#x2834;</entry> <!-- TRADE MARK SIGN, 2122 -->
<entry key="®">&#x2826;&#x2817;&#x2834;</entry> <!-- REGISTERED SIGN, 00ae -->
<entry key="½">&#x283c;&#x2801;&#x280C;&#x283c;&#x2803;</entry>
<!-- VULGAR FRACTION ONE HALF, 00bd -->

<entry key="¼">&#x283c;&#x2801;&#x280c;&#x283c;&#x2819;</entry> <!-- VULGAR FRACTION ONE QUARTER, 00bc -->
<entry key="½">&#x283c;&#x2801;&#x280c;&#x283c;&#x2803;</entry> <!-- VULGAR FRACTION ONE HALF, 00bd -->
<entry key="¾">&#x283c;&#x2809;&#x280c;&#x283c;&#x2819;</entry> <!-- VULGAR FRACTION THREE QUARTERS, 00be -->

<entry key="×">&#x283b;&#x282d;</entry> <!-- MULTIPLICATION SIGN, 00D7 -->
<entry key="¹">&#x282c;&#x283c;&#x2801;</entry> <!-- SUPERSCRIPT ONE, 00b9 -->
<entry key="²">&#x282c;&#x283c;&#x2803;</entry> <!-- SUPERSCRIPT TWO, 00b2 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.io.FileNotFoundException;

import org.daisy.dotify.impl.translator.sv_SE.SwedishBrailleFilter;
import org.daisy.dotify.text.FilterLocale;
import org.junit.Test;

Expand Down Expand Up @@ -224,4 +223,9 @@ public void testFinalizer_performance() {
long actualTime = System.currentTimeMillis()-d;
assertTrue("Time exceeded threshold ("+threshold+" ms), was " + actualTime + " ms.", (actualTime<threshold));
}

@Test
public void testFractions_001() {
assertEquals("⠼⠃ ⠼⠁⠌⠼⠙⠂ ⠼⠁ ⠼⠁⠌⠼⠃⠂ ⠼⠉ ⠼⠉⠌⠼⠙", filter.filter("2¼, 1½, 3¾"));
}
}

0 comments on commit b1899db

Please sign in to comment.