/*
*******************************************************************************
- * Copyright (C) 2012, International Business Machines Corporation and *
+ * Copyright (C) 2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
*/
public static int next32(CharacterIterator ci) {
// If the current position is at a surrogate pair, move to the trail surrogate
- // which leaves it in positon for underlying iterator's next() to work.
+ // which leaves it in position for underlying iterator's next() to work.
int c= ci.current();
if (c >= UTF16.LEAD_SURROGATE_MIN_VALUE && c<=UTF16.LEAD_SURROGATE_MAX_VALUE) {
c = ci.next();
// The call site does an initial ci.next() and calls this function
// if the 16 bit value it gets is >= LEAD_SURROGATE_MIN_VALUE.
// NOTE: we leave the underlying char iterator positioned in the
- // middle of a surroage pair. ci.next() will work correctly
+ // middle of a surrogate pair. ci.next() will work correctly
// from there, but the ci.getIndex() will be wrong, and needs
// adjustment.
public static int nextTrail32(CharacterIterator ci, int lead) {
/*
*******************************************************************************
- * Copyright (C) 2005-2012 International Business Machines Corporation and *
+ * Copyright (C) 2005-2013 International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
if (stateTable[row + RBBIDataWrapper.ACCEPTING] != 0) {
// Because this is an accepting state, any in-progress look-ahead match
- // is no longer relavant. Clear out the pending lookahead status.
+ // is no longer relevant. Clear out the pending lookahead status.
lookaheadStatus = 0;
}
} // End of state machine main loop
// The state machine is done. Check whether it found a match...
- // If c == DONE32 we ran off the end as normal, no match found. Move forward one.
- // If the iterator failed to advance in the match engine when c != DONE32,
- // force it ahead by one. (This second condition really indicates a defect
- // in the break rules. They should always match at least one character.)
+ // If the iterator failed to advance in the match engine force it ahead by one.
+ // This indicates a defect in the break rules, which should always match
+ // at least one character.
+
if (result == initialPosition) {
- if (TRACE && c != DONE32) {
+ if (TRACE) {
System.out.println("Iterator did not move. Advancing by 1.");
}
text.setIndex(initialPosition);