updating acip's import stuff from BinaryFileGenerator
This commit is contained in:
parent
4e10517b71
commit
2f21cd29f9
2 changed files with 19 additions and 15 deletions
|
@ -101,19 +101,15 @@ public class BinaryFileGenerator extends LinkedList
|
||||||
{
|
{
|
||||||
final short newDefiniendum=1, halfDefiniendum=2, definition=3;
|
final short newDefiniendum=1, halfDefiniendum=2, definition=3;
|
||||||
short status=newDefiniendum;
|
short status=newDefiniendum;
|
||||||
int marker, len, marker2, n=0, total=0, currentPage=0, currentLine=0;
|
int marker, len, marker2, n=0, total=0, currentPage=0, currentLine=1;
|
||||||
char ch;
|
char ch;
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(archivo)));
|
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(archivo)));
|
||||||
String entrada="", s1, s2, previous="", currentLetter="", temp="";
|
String entrada="", s1="", s2="", currentLetter="", temp="";
|
||||||
boolean markerNotFound;
|
boolean markerNotFound;
|
||||||
|
|
||||||
currentLine=1;
|
|
||||||
|
|
||||||
// used for acip dict
|
// used for acip dict
|
||||||
if (delimiter==' ')
|
if (delimiter==' ')
|
||||||
{
|
{
|
||||||
s1="";
|
|
||||||
s2="";
|
|
||||||
outAHere:
|
outAHere:
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -143,7 +139,7 @@ public class BinaryFileGenerator extends LinkedList
|
||||||
}
|
}
|
||||||
|
|
||||||
// get current letter
|
// get current letter
|
||||||
if ((entrada.charAt(0)=='(' || entrada.charAt(0)=='{' || entrada.charAt(0)=='?') && previous.trim().equals(""))
|
if (entrada.charAt(0)=='(' || entrada.charAt(0)=='{' || entrada.charAt(0)=='?')
|
||||||
{
|
{
|
||||||
currentLetter = entrada.substring(1, entrada.length()-2);
|
currentLetter = entrada.substring(1, entrada.length()-2);
|
||||||
/*out.println(currentPage + ": " + currentLetter);
|
/*out.println(currentPage + ": " + currentLetter);
|
||||||
|
@ -215,7 +211,7 @@ public class BinaryFileGenerator extends LinkedList
|
||||||
status because it will be updated below. */
|
status because it will be updated below. */
|
||||||
if (status==definition)
|
if (status==definition)
|
||||||
{
|
{
|
||||||
add(s1, s2, defNum);
|
add(s1, s2, defNum);
|
||||||
s1=""; s2="";
|
s1=""; s2="";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,11 +227,18 @@ public class BinaryFileGenerator extends LinkedList
|
||||||
markerNotFound=false;
|
markerNotFound=false;
|
||||||
marker2=marker+1;
|
marker2=marker+1;
|
||||||
break;
|
break;
|
||||||
case '(':
|
case '(': case '<':
|
||||||
markerNotFound=false;
|
markerNotFound=false;
|
||||||
marker2=marker;
|
marker2=marker;
|
||||||
break;
|
break;
|
||||||
case 'g': case ' ': // verify "g " and " "
|
case 'g': // verify "g "
|
||||||
|
if (marker+1<len && Manipulate.isVowel(entrada.charAt(marker-1)) && entrada.charAt(marker+1)==' ')
|
||||||
|
{
|
||||||
|
markerNotFound=false;
|
||||||
|
marker2=++marker;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ' ': // verify " "
|
||||||
if (marker+1<len && entrada.charAt(marker+1)==' ')
|
if (marker+1<len && entrada.charAt(marker+1)==' ')
|
||||||
{
|
{
|
||||||
markerNotFound=false;
|
markerNotFound=false;
|
||||||
|
@ -270,7 +273,7 @@ public class BinaryFileGenerator extends LinkedList
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s1 = s1 + entrada.substring(0,marker);
|
s1 = s1 + entrada.substring(0,marker).trim();
|
||||||
s2 = "[" + currentPage + "] " + entrada.substring(marker2).trim();
|
s2 = "[" + currentPage + "] " + entrada.substring(marker2).trim();
|
||||||
status=definition;
|
status=definition;
|
||||||
|
|
||||||
|
@ -563,7 +566,7 @@ public class BinaryFileGenerator extends LinkedList
|
||||||
{
|
{
|
||||||
if (args[i].equals("-tab"))
|
if (args[i].equals("-tab"))
|
||||||
delimiter='\t';
|
delimiter='\t';
|
||||||
else if (args[1].equals("-acip"))
|
else if (args[i].equals("-acip"))
|
||||||
delimiter=' ';
|
delimiter=' ';
|
||||||
else
|
else
|
||||||
delimiter=args[i].charAt(1);
|
delimiter=args[i].charAt(1);
|
||||||
|
|
|
@ -108,8 +108,8 @@ public class Manipulate
|
||||||
nuevaLinea = new String(caract);
|
nuevaLinea = new String(caract);
|
||||||
|
|
||||||
/* ahora hacer los cambios de Michael Roach ts -> tsh, tz -> ts, v -> w,
|
/* ahora hacer los cambios de Michael Roach ts -> tsh, tz -> ts, v -> w,
|
||||||
TH -> Th, SH -> Sh, : -> H, dh -> d+h, gh -> g+h, bh -> b+h, dzh -> dz+h,
|
TH -> Th, kSH, kaSH -> k+Sh, SH -> Sh, : -> H, dh -> d+h, gh -> g+h, bh -> b+h, dzh -> dz+h,
|
||||||
kSH -> k+Sh, aa -> a, a'a -> A, ai->i, aee ->ai, au->u, aoo->au, ae->e,
|
aa -> a, a'a -> A, ai->i, aee ->ai, au->u, aoo->au, ae->e,
|
||||||
ao->o, ee->ai, oo->au, 'I->-I I->-i, a'i->I, a'u->U, a'e->E, a'o->O,
|
ao->o, ee->ai, oo->au, 'I->-I I->-i, a'i->I, a'u->U, a'e->E, a'o->O,
|
||||||
a'i->I, a'u->U, a'e->E, a'o->O, ,->/, # -> @##, * -> @#, \ -> ?, ` -> !,
|
a'i->I, a'u->U, a'e->E, a'o->O, ,->/, # -> @##, * -> @#, \ -> ?, ` -> !,
|
||||||
/-/ -> (-), ga-y -> g.y, g-y -> g.y */
|
/-/ -> (-), ga-y -> g.y, g-y -> g.y */
|
||||||
|
@ -119,13 +119,14 @@ public class Manipulate
|
||||||
nuevaLinea = replace(nuevaLinea, "tq", "tsh");
|
nuevaLinea = replace(nuevaLinea, "tq", "tsh");
|
||||||
nuevaLinea = replace(nuevaLinea, "v", "w");
|
nuevaLinea = replace(nuevaLinea, "v", "w");
|
||||||
nuevaLinea = replace(nuevaLinea, "TH", "Th");
|
nuevaLinea = replace(nuevaLinea, "TH", "Th");
|
||||||
|
nuevaLinea = replace(nuevaLinea, "kSH", "k+Sh");
|
||||||
|
nuevaLinea = replace(nuevaLinea, "kaSH", "k+Sh");
|
||||||
nuevaLinea = replace(nuevaLinea, "SH", "Sh");
|
nuevaLinea = replace(nuevaLinea, "SH", "Sh");
|
||||||
nuevaLinea = replace(nuevaLinea, ":", "H");
|
nuevaLinea = replace(nuevaLinea, ":", "H");
|
||||||
nuevaLinea = replace(nuevaLinea, "dh", "d+h");
|
nuevaLinea = replace(nuevaLinea, "dh", "d+h");
|
||||||
nuevaLinea = replace(nuevaLinea, "gh", "g+h");
|
nuevaLinea = replace(nuevaLinea, "gh", "g+h");
|
||||||
nuevaLinea = replace(nuevaLinea, "bh", "b+h");
|
nuevaLinea = replace(nuevaLinea, "bh", "b+h");
|
||||||
nuevaLinea = replace(nuevaLinea, "dzh", "dz+h");
|
nuevaLinea = replace(nuevaLinea, "dzh", "dz+h");
|
||||||
nuevaLinea = replace(nuevaLinea, "kSH", "k+Sh");
|
|
||||||
nuevaLinea = replace(nuevaLinea, "aa", "a");
|
nuevaLinea = replace(nuevaLinea, "aa", "a");
|
||||||
nuevaLinea = replace(nuevaLinea, "ai", "i");
|
nuevaLinea = replace(nuevaLinea, "ai", "i");
|
||||||
nuevaLinea = replace(nuevaLinea, "aee", "ai");
|
nuevaLinea = replace(nuevaLinea, "aee", "ai");
|
||||||
|
|
Loading…
Reference in a new issue