Skip to content

Commit

Permalink
Android Pie: add java.text.BreakIterator.
Browse files Browse the repository at this point in the history
	Change on 2019/05/24 by antoniocortes <antoniocortes@google.com>

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249842328
  • Loading branch information
antonio-cortes-perez committed Jun 3, 2019
1 parent b36b257 commit a5cbf0f
Show file tree
Hide file tree
Showing 18 changed files with 2,814 additions and 845 deletions.
20 changes: 18 additions & 2 deletions jre_emul/JreEmulation.xcodeproj/project.pbxproj
Expand Up @@ -802,6 +802,8 @@
FA1DD7BD215418F300D0B800 /* TestCertUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DD7BC215418F200D0B800 /* TestCertUtils.m */; }; FA1DD7BD215418F300D0B800 /* TestCertUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DD7BC215418F200D0B800 /* TestCertUtils.m */; };
FA1DD7BF2154190800D0B800 /* mySSLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DD7BE2154190700D0B800 /* mySSLSession.m */; }; FA1DD7BF2154190800D0B800 /* mySSLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DD7BE2154190700D0B800 /* mySSLSession.m */; };
FA1DD7C1215419D400D0B800 /* TestSSLSocketPair.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DD7C0215419D400D0B800 /* TestSSLSocketPair.m */; }; FA1DD7C1215419D400D0B800 /* TestSSLSocketPair.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DD7C0215419D400D0B800 /* TestSSLSocketPair.m */; };
FA1F0236229749AF00AE9C73 /* BreakIteratorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1F02352297499F00AE9C73 /* BreakIteratorTest.m */; };
FA1F0238229749FC00AE9C73 /* BreakIteratorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1F0237229749FB00AE9C73 /* BreakIteratorTest.m */; };
FA2EECB521EFB55000B88A06 /* CompletableFutureTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA2EECB421EFB54F00B88A06 /* CompletableFutureTest.m */; }; FA2EECB521EFB55000B88A06 /* CompletableFutureTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA2EECB421EFB54F00B88A06 /* CompletableFutureTest.m */; };
FA3ACD812229A27B00ECCC8F /* IosHttpURLConnectionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3ACD802229A27A00ECCC8F /* IosHttpURLConnectionTest.m */; }; FA3ACD812229A27B00ECCC8F /* IosHttpURLConnectionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3ACD802229A27A00ECCC8F /* IosHttpURLConnectionTest.m */; };
FA40676421C07E6100988DFD /* MethodTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA40675021C07E5E00988DFD /* MethodTest.m */; }; FA40676421C07E6100988DFD /* MethodTest.m in Sources */ = {isa = PBXBuildFile; fileRef = FA40675021C07E5E00988DFD /* MethodTest.m */; };
Expand Down Expand Up @@ -3974,6 +3976,12 @@
FA1DD7BC215418F200D0B800 /* TestCertUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestCertUtils.m; path = org/apache/harmony/security/tests/support/TestCertUtils.m; sourceTree = "<group>"; }; FA1DD7BC215418F200D0B800 /* TestCertUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestCertUtils.m; path = org/apache/harmony/security/tests/support/TestCertUtils.m; sourceTree = "<group>"; };
FA1DD7BE2154190700D0B800 /* mySSLSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = mySSLSession.m; path = org/apache/harmony/xnet/tests/support/mySSLSession.m; sourceTree = "<group>"; }; FA1DD7BE2154190700D0B800 /* mySSLSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = mySSLSession.m; path = org/apache/harmony/xnet/tests/support/mySSLSession.m; sourceTree = "<group>"; };
FA1DD7C0215419D400D0B800 /* TestSSLSocketPair.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestSSLSocketPair.m; path = libcore/javax/net/ssl/TestSSLSocketPair.m; sourceTree = "<group>"; }; FA1DD7C0215419D400D0B800 /* TestSSLSocketPair.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestSSLSocketPair.m; path = libcore/javax/net/ssl/TestSSLSocketPair.m; sourceTree = "<group>"; };
FA1F0231229748EB00AE9C73 /* BreakIterator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BreakIterator.h; path = build_result/Classes/java/text/BreakIterator.h; sourceTree = "<group>"; };
FA1F0232229748EC00AE9C73 /* IcuIteratorWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = IcuIteratorWrapper.m; path = build_result/Classes/java/text/IcuIteratorWrapper.m; sourceTree = "<group>"; };
FA1F0233229748EC00AE9C73 /* BreakIterator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BreakIterator.m; path = build_result/Classes/java/text/BreakIterator.m; sourceTree = "<group>"; };
FA1F0234229748EC00AE9C73 /* IcuIteratorWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IcuIteratorWrapper.h; path = build_result/Classes/java/text/IcuIteratorWrapper.h; sourceTree = "<group>"; };
FA1F02352297499F00AE9C73 /* BreakIteratorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BreakIteratorTest.m; path = libcore/java/text/BreakIteratorTest.m; sourceTree = "<group>"; };
FA1F0237229749FB00AE9C73 /* BreakIteratorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BreakIteratorTest.m; path = org/apache/harmony/tests/java/text/BreakIteratorTest.m; sourceTree = "<group>"; };
FA2EECB421EFB54F00B88A06 /* CompletableFutureTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CompletableFutureTest.m; path = jsr166/CompletableFutureTest.m; sourceTree = "<group>"; }; FA2EECB421EFB54F00B88A06 /* CompletableFutureTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CompletableFutureTest.m; path = jsr166/CompletableFutureTest.m; sourceTree = "<group>"; };
FA3ACD802229A27A00ECCC8F /* IosHttpURLConnectionTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IosHttpURLConnectionTest.m; path = com/google/j2objc/net/IosHttpURLConnectionTest.m; sourceTree = "<group>"; }; FA3ACD802229A27A00ECCC8F /* IosHttpURLConnectionTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IosHttpURLConnectionTest.m; path = com/google/j2objc/net/IosHttpURLConnectionTest.m; sourceTree = "<group>"; };
FA3ACD822229A94300ECCC8F /* CompletableFuture.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CompletableFuture.m; path = build_result/Classes/java/util/concurrent/CompletableFuture.m; sourceTree = "<group>"; }; FA3ACD822229A94300ECCC8F /* CompletableFuture.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CompletableFuture.m; path = build_result/Classes/java/util/concurrent/CompletableFuture.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4320,8 +4328,6 @@
067219221559B9D200645E1B /* Transpiled Classes */ = { 067219221559B9D200645E1B /* Transpiled Classes */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
FA3ACD832229A94300ECCC8F /* CompletableFuture.h */,
FA3ACD822229A94300ECCC8F /* CompletableFuture.m */,
06721AC51559CB4200645E1B /* AbstractCollection.h */, 06721AC51559CB4200645E1B /* AbstractCollection.h */,
06721A291559C91600645E1B /* AbstractCollection.m */, 06721A291559C91600645E1B /* AbstractCollection.m */,
06F290BD18972DF800676F1D /* AbstractExecutorService.h */, 06F290BD18972DF800676F1D /* AbstractExecutorService.h */,
Expand Down Expand Up @@ -4512,6 +4518,8 @@
06F290C418972DF800676F1D /* BlockingQueue.m */, 06F290C418972DF800676F1D /* BlockingQueue.m */,
06721B341559CC0300645E1B /* Boolean.h */, 06721B341559CC0300645E1B /* Boolean.h */,
067219D11559C87100645E1B /* Boolean.m */, 067219D11559C87100645E1B /* Boolean.m */,
FA1F0231229748EB00AE9C73 /* BreakIterator.h */,
FA1F0233229748EC00AE9C73 /* BreakIterator.m */,
06F290C518972DF800676F1D /* BrokenBarrierException.h */, 06F290C518972DF800676F1D /* BrokenBarrierException.h */,
06F290C618972DF800676F1D /* BrokenBarrierException.m */, 06F290C618972DF800676F1D /* BrokenBarrierException.m */,
06DD329716A13FA000AD7ACE /* Buffer.h */, 06DD329716A13FA000AD7ACE /* Buffer.h */,
Expand Down Expand Up @@ -4706,6 +4714,8 @@
06F2908218972DA200676F1D /* Comparator.m */, 06F2908218972DA200676F1D /* Comparator.m */,
0671E4E421BDCEF4002E0681 /* Comparators.h */, 0671E4E421BDCEF4002E0681 /* Comparators.h */,
0671E4CD21BDCEF0002E0681 /* Comparators.m */, 0671E4CD21BDCEF0002E0681 /* Comparators.m */,
FA3ACD832229A94300ECCC8F /* CompletableFuture.h */,
FA3ACD822229A94300ECCC8F /* CompletableFuture.m */,
06F290CB18972DF800676F1D /* CompletionService.h */, 06F290CB18972DF800676F1D /* CompletionService.h */,
06F290CC18972DF800676F1D /* CompletionService.m */, 06F290CC18972DF800676F1D /* CompletionService.m */,
06721ADF1559CB9200645E1B /* ConcurrentHashMap.h */, 06721ADF1559CB9200645E1B /* ConcurrentHashMap.h */,
Expand Down Expand Up @@ -5137,6 +5147,8 @@
FA6C098D2187C1B6006C646A /* icu */, FA6C098D2187C1B6006C646A /* icu */,
06ED3DE217D1666A0014750E /* ICU.h */, 06ED3DE217D1666A0014750E /* ICU.h */,
06ED3DE317D1666A0014750E /* ICU.m */, 06ED3DE317D1666A0014750E /* ICU.m */,
FA1F0234229748EC00AE9C73 /* IcuIteratorWrapper.h */,
FA1F0232229748EC00AE9C73 /* IcuIteratorWrapper.m */,
06721AE91559CB9200645E1B /* IdentityHashMap.h */, 06721AE91559CB9200645E1B /* IdentityHashMap.h */,
06721A4F1559C99E00645E1B /* IdentityHashMap.m */, 06721A4F1559C99E00645E1B /* IdentityHashMap.m */,
0671E52821BDEE4F002E0681 /* IDN.m */, 0671E52821BDEE4F002E0681 /* IDN.m */,
Expand Down Expand Up @@ -6529,6 +6541,8 @@
067B13141EEDC3DC0013CBAF /* BlockingQueueTest.m */, 067B13141EEDC3DC0013CBAF /* BlockingQueueTest.m */,
FA5C0C7E21BFFE67000B6275 /* BooleanTest.m */, FA5C0C7E21BFFE67000B6275 /* BooleanTest.m */,
062028931D512E78001EE455 /* BoundedGenericMethodsTests.m */, 062028931D512E78001EE455 /* BoundedGenericMethodsTests.m */,
FA1F02352297499F00AE9C73 /* BreakIteratorTest.m */,
FA1F0237229749FB00AE9C73 /* BreakIteratorTest.m */,
063A62CC1F67267C001DC971 /* BrokenInputStream.m */, 063A62CC1F67267C001DC971 /* BrokenInputStream.m */,
0620267F1D512D08001EE455 /* BufferTest.m */, 0620267F1D512D08001EE455 /* BufferTest.m */,
FA5C0C6D21BFFE64000B6275 /* ByteTest.m */, FA5C0C6D21BFFE64000B6275 /* ByteTest.m */,
Expand Down Expand Up @@ -8036,6 +8050,7 @@
062029441D512F25001EE455 /* InvalidParameterSpecExceptionTest.m in Sources */, 062029441D512F25001EE455 /* InvalidParameterSpecExceptionTest.m in Sources */,
062028AC1D512E78001EE455 /* AccessibleObjectTest.m in Sources */, 062028AC1D512E78001EE455 /* AccessibleObjectTest.m in Sources */,
FA5C0CAA21BFFE6B000B6275 /* ErrorTest.m in Sources */, FA5C0CAA21BFFE6B000B6275 /* ErrorTest.m in Sources */,
FA1F0238229749FC00AE9C73 /* BreakIteratorTest.m in Sources */,
062026A01D512D08001EE455 /* CookiesTest.m in Sources */, 062026A01D512D08001EE455 /* CookiesTest.m in Sources */,
063A62E81F67269E001DC971 /* DefaultHandler2Test.m in Sources */, 063A62E81F67269E001DC971 /* DefaultHandler2Test.m in Sources */,
062026BF1D512D08001EE455 /* DecimalFormatTest.m in Sources */, 062026BF1D512D08001EE455 /* DecimalFormatTest.m in Sources */,
Expand Down Expand Up @@ -8291,6 +8306,7 @@
062B4F291ED76C1200D4E7D8 /* OldJarFileTest.m in Sources */, 062B4F291ED76C1200D4E7D8 /* OldJarFileTest.m in Sources */,
062024F41D512AA2001EE455 /* AllJreTests.m in Sources */, 062024F41D512AA2001EE455 /* AllJreTests.m in Sources */,
062026A21D512D08001EE455 /* InetAddressTest.m in Sources */, 062026A21D512D08001EE455 /* InetAddressTest.m in Sources */,
FA1F0236229749AF00AE9C73 /* BreakIteratorTest.m in Sources */,
062028AE1D512E78001EE455 /* BoundedGenericMethodsTests.m in Sources */, 062028AE1D512E78001EE455 /* BoundedGenericMethodsTests.m in Sources */,
062029411D512F25001EE455 /* ECPublicKeySpecTest.m in Sources */, 062029411D512F25001EE455 /* ECPublicKeySpecTest.m in Sources */,
FA5C0CC521BFFFAA000B6275 /* SpliteratorTester.m in Sources */, FA5C0CC521BFFFAA000B6275 /* SpliteratorTester.m in Sources */,
Expand Down
@@ -0,0 +1,108 @@
/* GENERATED SOURCE. DO NOT MODIFY. */
// © 2017 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
package android.icu.impl;

import java.text.CharacterIterator;

/**
* Implement the Java CharacterIterator interface on a CharSequence.
* Intended for internal use by ICU only.
* @hide Only a subset of ICU is exposed in Android
*/
public class CSCharacterIterator implements CharacterIterator {

private int index;
private CharSequence seq;


/**
* Constructor.
* @param text The CharSequence to iterate over.
*/
public CSCharacterIterator(CharSequence text) {
if (text == null) {
throw new NullPointerException();
}
seq = text;
index = 0;
}

/** @{inheritDoc} */
@Override
public char first() {
index = 0;
return current();
}

/** @{inheritDoc} */
@Override
public char last() {
index = seq.length();
return previous();
}

/** @{inheritDoc} */
@Override
public char current() {
if (index == seq.length()) {
return DONE;
}
return seq.charAt(index);
}

/** @{inheritDoc} */
@Override
public char next() {
if (index < seq.length()) {
++index;
}
return current();
}

/** @{inheritDoc} */
@Override
public char previous() {
if (index == 0) {
return DONE;
}
--index;
return current();
}

/** @{inheritDoc} */
@Override
public char setIndex(int position) {
if (position < 0 || position > seq.length()) {
throw new IllegalArgumentException();
}
index = position;
return current();
}

/** @{inheritDoc} */
@Override
public int getBeginIndex() {
return 0;
}

/** @{inheritDoc} */
@Override
public int getEndIndex() {
return seq.length();
}

/** @{inheritDoc} */
@Override
public int getIndex() {
return index;
}

/** @{inheritDoc} */
@Override
public Object clone() {
CSCharacterIterator copy = new CSCharacterIterator(seq);
copy.setIndex(index);
return copy;
}
}
Expand Up @@ -11,6 +11,7 @@


import java.text.CharacterIterator; import java.text.CharacterIterator;
import java.util.HashSet; import java.util.HashSet;
import java.util.Locale;


import android.icu.impl.ICUResourceBundle.OpenType; import android.icu.impl.ICUResourceBundle.OpenType;
import android.icu.text.BreakIterator; import android.icu.text.BreakIterator;
Expand Down Expand Up @@ -59,7 +60,7 @@ private final void resetState() {
/** /**
* Is there an exception at this point? * Is there an exception at this point?
* *
* @param n * @param n the location of the possible break
* @return * @return
*/ */
private final boolean breakExceptionAt(int n) { private final boolean breakExceptionAt(int n) {
Expand All @@ -73,6 +74,8 @@ private final boolean breakExceptionAt(int n) {
backwardsTrie.reset(); backwardsTrie.reset();
int uch; int uch;




// Assume a space is following the '.' (so we handle the case: "Mr. /Brown") // Assume a space is following the '.' (so we handle the case: "Mr. /Brown")
if ((uch = text.previousCodePoint()) == ' ') { // TODO: skip a class of chars here?? if ((uch = text.previousCodePoint()) == ' ') { // TODO: skip a class of chars here??
// TODO only do this the 1st time? // TODO only do this the 1st time?
Expand Down Expand Up @@ -272,13 +275,16 @@ public static class Builder extends FilteredBreakIteratorBuilder {
/** /**
* filter set to store all exceptions * filter set to store all exceptions
*/ */
private HashSet<String> filterSet = new HashSet<String>(); private HashSet<CharSequence> filterSet = new HashSet<CharSequence>();


static final int PARTIAL = (1 << 0); // < partial - need to run through forward trie static final int PARTIAL = (1 << 0); // < partial - need to run through forward trie
static final int MATCH = (1 << 1); // < exact match - skip this one. static final int MATCH = (1 << 1); // < exact match - skip this one.
static final int SuppressInReverse = (1 << 0); static final int SuppressInReverse = (1 << 0);
static final int AddToForward = (1 << 1); static final int AddToForward = (1 << 1);


public Builder(Locale loc) {
this(ULocale.forLocale(loc));
}
/** /**
* Create SimpleFilteredBreakIteratorBuilder using given locale * Create SimpleFilteredBreakIteratorBuilder using given locale
* @param loc the locale to get filtered iterators * @param loc the locale to get filtered iterators
Expand All @@ -302,28 +308,20 @@ public Builder(ULocale loc) {
* Create SimpleFilteredBreakIteratorBuilder with no exception * Create SimpleFilteredBreakIteratorBuilder with no exception
*/ */
public Builder() { public Builder() {
filterSet = new HashSet<String>();
} }


@Override @Override
public boolean suppressBreakAfter(String str) { public boolean suppressBreakAfter(CharSequence str) {
if (filterSet == null) {
filterSet = new HashSet<String>();
}
return filterSet.add(str); return filterSet.add(str);
} }


@Override @Override
public boolean unsuppressBreakAfter(String str) { public boolean unsuppressBreakAfter(CharSequence str) {
if (filterSet == null) { return filterSet.remove(str);
return false;
} else {
return filterSet.remove(str);
}
} }


@Override @Override
public BreakIterator build(BreakIterator adoptBreakIterator) { public BreakIterator wrapIteratorWithFilter(BreakIterator adoptBreakIterator) {
if( filterSet.isEmpty() ) { if( filterSet.isEmpty() ) {
// Short circuit - nothing to except. // Short circuit - nothing to except.
return adoptBreakIterator; return adoptBreakIterator;
Expand All @@ -336,29 +334,30 @@ public BreakIterator build(BreakIterator adoptBreakIterator) {
int fwdCount = 0; int fwdCount = 0;


int subCount = filterSet.size(); int subCount = filterSet.size();
String[] ustrs = new String[subCount]; CharSequence[] ustrs = new CharSequence[subCount];
int[] partials = new int[subCount]; int[] partials = new int[subCount];


CharsTrie backwardsTrie = null; // i.e. ".srM" for Mrs. CharsTrie backwardsTrie = null; // i.e. ".srM" for Mrs.
CharsTrie forwardsPartialTrie = null; // Has ".a" for "a.M." CharsTrie forwardsPartialTrie = null; // Has ".a" for "a.M."


int i = 0; int i = 0;
for (String s : filterSet) { for (CharSequence s : filterSet) {
ustrs[i] = s; // copy by value? ustrs[i] = s; // copy by value?
partials[i] = 0; // default: no partial partials[i] = 0; // default: no partial
i++; i++;
} }


for (i = 0; i < subCount; i++) { for (i = 0; i < subCount; i++) {
int nn = ustrs[i].indexOf('.'); // TODO: non-'.' abbreviations String thisStr = ustrs[i].toString(); // TODO: don't cast to String?
if (nn > -1 && (nn + 1) != ustrs[i].length()) { int nn = thisStr.indexOf('.'); // TODO: non-'.' abbreviations
if (nn > -1 && (nn + 1) != thisStr.length()) {
// is partial. // is partial.
// is it unique? // is it unique?
int sameAs = -1; int sameAs = -1;
for (int j = 0; j < subCount; j++) { for (int j = 0; j < subCount; j++) {
if (j == i) if (j == i)
continue; continue;
if (ustrs[i].regionMatches(0, ustrs[j], 0, nn + 1)) { if (thisStr.regionMatches(0, ustrs[j].toString() /* TODO */, 0, nn + 1)) {
if (partials[j] == 0) { // hasn't been processed yet if (partials[j] == 0) { // hasn't been processed yet
partials[j] = SuppressInReverse | AddToForward; partials[j] = SuppressInReverse | AddToForward;
} else if ((partials[j] & SuppressInReverse) != 0) { } else if ((partials[j] & SuppressInReverse) != 0) {
Expand All @@ -368,7 +367,7 @@ public BreakIterator build(BreakIterator adoptBreakIterator) {
} }


if ((sameAs == -1) && (partials[i] == 0)) { if ((sameAs == -1) && (partials[i] == 0)) {
StringBuilder prefix = new StringBuilder(ustrs[i].substring(0, nn + 1)); StringBuilder prefix = new StringBuilder(thisStr.substring(0, nn + 1));
// first one - add the prefix to the reverse table. // first one - add the prefix to the reverse table.
prefix.reverse(); prefix.reverse();
builder.add(prefix, PARTIAL); builder.add(prefix, PARTIAL);
Expand All @@ -379,8 +378,9 @@ public BreakIterator build(BreakIterator adoptBreakIterator) {
} }


for (i = 0; i < subCount; i++) { for (i = 0; i < subCount; i++) {
final String thisStr = ustrs[i].toString(); // TODO
if (partials[i] == 0) { if (partials[i] == 0) {
StringBuilder reversed = new StringBuilder(ustrs[i]).reverse(); StringBuilder reversed = new StringBuilder(thisStr).reverse();
builder.add(reversed, MATCH); builder.add(reversed, MATCH);
revCount++; revCount++;
} else { } else {
Expand All @@ -389,7 +389,7 @@ public BreakIterator build(BreakIterator adoptBreakIterator) {
// forward, // forward,
// instead of "Ph.D." since we already know the "Ph." part is a match. // instead of "Ph.D." since we already know the "Ph." part is a match.
// would need the trie to be able to hold 0-length strings, though. // would need the trie to be able to hold 0-length strings, though.
builder2.add(ustrs[i], MATCH); // forward builder2.add(thisStr, MATCH); // forward
fwdCount++; fwdCount++;
} }
} }
Expand Down

0 comments on commit a5cbf0f

Please sign in to comment.