Reduce the set of outgoing transitions by removing transitions that are also captured by the
'other'-transition. The 'other'-transition are transitions with the given character.

@param otherChar The character representing any other character.
14753
public void reduce(Character otherChar) {
        Set<Integer> seen = new HashSet<>();
        Queue<LevenshteinAutomatonState> q = new LinkedList<>();
        q.add(this);

        while (!q.isEmpty()) {
            LevenshteinAutomatonState s = q.poll();
            if (seen.contains(System.identityHashCode(s)))
                continue;

            LevenshteinAutomatonState otherTo = s.transitions.get(otherChar);
            if (otherTo == null) {
                // There is no reduction possible in this state: queue the to-states, mark this state
                // as seen and continue with the next state.
                for (LevenshteinAutomatonState toState : s.transitions.values())
                    q.add(toState);

                seen.add(System.identityHashCode(s));

                continue;
            }

            // Find transitions that can be removed, because they are handled by an 'other' transition. This
            // is the case when a transition is not the 'other' transition, but has the same to-state as the
            // 'other' transition.
            Set<Character> remove = new HashSet<>();
            for (Entry<Character, LevenshteinAutomatonState> trans : s.transitions.entrySet())
                if (!trans.getKey().equals(otherChar) && trans.getValue() == otherTo)
                    remove.add(trans.getKey());

            // Remove the transitions that were found.
            for (Character c : remove)
                s.transitions.remove(c);

            // Recompute the hash if the state table has changed.
            if (remove.size() != 0)
                s.d_recomputeHash = true;

            // We have now seen this state.
            seen.add(System.identityHashCode(s));

            // Queue states that can be reached via this state.
            for (LevenshteinAutomatonState toState : s.transitions.values())
                q.add(toState);
        }
    }
299036
public OrderingList<S> mergeRemainderOrdering(OrderingScore<S> other) {
        OrderingList<S> thisRemainderOrdering = getRemainderOrdering();

        if (this == other) {
            return thisRemainderOrdering;
        }

        OrderingList<S> otherRemainderOrdering = other.getRemainderOrdering();

        // Choose the longer list.

        if (thisRemainderOrdering.size() == 0) {
            return otherRemainderOrdering;
        } else {
            if (otherRemainderOrdering.size() == 0) {
                return thisRemainderOrdering;
            } else if (thisRemainderOrdering.size() >= otherRemainderOrdering.size()) {
                return thisRemainderOrdering;
            } else {
                return otherRemainderOrdering;
            }
        }
    }
691275
public UnicodeSet set(UnicodeSet other) {
        checkFrozen();
        list = other.list.clone();
        len = other.len;
        pat = other.pat;
        strings = new TreeSet<String>(other.strings);
        return this;
    }
684806
function (other) {
        assertNotNull(other);

        if (this.count() === 0) {
            return;
        }

        else if (other === this) {
            this.clear();
            return;
        }

        var table = this.table;
        forOf(other, function (element) {
            table.remove(element);
        });
    }
176542
private void writeChar(final char chr) throws IOException {
    switch (chr) {
      case '\t':
        this.Tab();
        break;
      case '\n': {
        this.out.write(this.lineSeparator);
        this.lineNumber++;
        this.prevMode = this.mode;
        this.mode = MODE_START_LINE;
        this.linePosition = 0;
        for (final Extra e : extras) {
          e.onNewLine(this, this.lineNumber);
        }
      }
      break;
      case '\r':
        break;
      default: {
        if (!Character.isISOControl(chr)) {
          this.out.write(chr);
          this.linePosition++;
          if (this.mode == MODE_START_LINE) {
            this.mode = this.prevMode;
          }
        }
      }
      break;
    }
  }
780428
public void copyFromPropertyDescriptor(EntityField other) {
        this.setter = other.setter;
        this.getter = other.getter;
        this.javaType = other.javaType;
        this.name = other.name;
    }
449575
public final int toChars(int[] src, int srcOff, int srcLen, char[] dest, int destOff) {
    if (srcLen < 0) {
      throw new IllegalArgumentException("srcLen must be >= 0");
    }
    int written = 0;
    for (int i = 0; i < srcLen; ++i) {
      written += Character.toChars(src[srcOff + i], dest, destOff + written);
    }
    return written;
  }
993725
public void writeCharacters(final char[] ch, final int start, final int length) throws SAXException {
        if (elementStack.isEmpty()) {
            throw new IllegalStateException("Current state does not allow Character writing");
        }
        processStartElement();
        transformer.characters(ch, start, length);
    }
173947
public void elemDivide(VTensor other) {
        checkEqualSize(this, other);
        for (int c = 0; c < this.size(); c++) {
            divideValue(c, other.getValue(c));
        }
    }
41955
@Override
    public CharacterHandler getHandler(char ch) {
        if(wsHandler != null && Character.isWhitespace(ch)) {
            return wsHandler;
        }

        if(ignoreWhitespaces && Character.isWhitespace(ch)) {
            return GlobalCharacterHandlers.NOOP_CHARACTER_HANDLER;
        }

        if(leaveOnWhitespace && Character.isWhitespace(ch)) {
            return GlobalCharacterHandlers.LEAVE_STATE_HANDLER;
        }

        CharacterHandler handler = enterStateHandlers.getHandler(ch);
        if(handler != null) {
            return handler;
        }
        handler = handlers.getHandler(ch);
        if(handler != null) {
            return handler;
        }
        return defaultHandler;
    }
1254658
private boolean differentChars(char c1, char c2) {
        if (65 <= c1 && c1 < 97) {
            c1 +=32;
        }

        if (65 <= c2 && c2 < 97) {
            c2 +=32;
        }
        return c1 != c2;
    }
592804
@Override
    public boolean startsWith(final String other) {
        if (other == null) {
            throw new IllegalArgumentException("other path input must be specified");
        }
        final Path otherPath = this.fromString(other);
        return this.startsWith(otherPath);
    }
941535
@Override
    protected String doForward(final String hierarchical) {
        log.debug("Converting outgoing identifier: {}", hierarchical);
        final List<String> segments = asList(hierarchical.split(separator));
        if (segments.size() <= levels) {
            // must be a root identifier
            return "";
        }
        List<String> firstSegments = emptyList();
        List<String> lastSegment = emptyList();
        if (segments.size() > levels + 1) {
            // we subtract one for the final segment, then levels for the
            // inserted hierarchy segments we want to remove
            firstSegments = segments.subList(0, segments.size() - 1 - levels);
            lastSegment = singletonList(getLast(segments));
        } else {
            // just the trailing non-hierarchical segment
            lastSegment = singletonList(getLast(segments));
        }
        return on(separator).join(concat(firstSegments, lastSegment));
    }
544740
private int _countConsecutiveChars (final char ch)
  {
    int nCount = 0;
    for (int i = 0; i < m_sValue.length (); i++)
    {
      final char c = m_sValue.charAt (i);
      if (c != ' ')
      {
        if (c != ch)
          return 0;
        nCount++;
      }
    }
    return nCount;
  }
599581
def strings(self, otherchar=None):
		'''
			
		'''

		# In the case of a regex like "[^abc]", there are infinitely many (well, a
		# very large finite number of) single characters which will match. It's not
		# productive to iterate over all of these giving every single example.
		# You must supply your own "otherchar" to stand in for all of these
		# possibilities.
		for string in self.to_fsm().strings():

			# Have to represent `fsm.anything_else` somehow.
			if fsm.anything_else in string:
				if otherchar == None:
					raise Exception("Please choose an 'otherchar'")
				string = [
					otherchar if char == fsm.anything_else else char
					for char in string
				]

			yield "".join(string)
515099
public void addTransition(Character c, State s) {
        transitions.put(c, s);
        d_recomputeHash = true;
    }
64700
public boolean equalsIgnoreCase(final StrBuilder other) {
        if (this == other) {
            return true;
        }
        if (this.size != other.size) {
            return false;
        }
        final char thisBuf[] = this.buffer;
        final char otherBuf[] = other.buffer;
        for (int i = size - 1; i >= 0; i--) {
            final char c1 = thisBuf[i];
            final char c2 = otherBuf[i];
            if (c1 != c2 && Character.toUpperCase(c1) != Character.toUpperCase(c2)) {
                return false;
            }
        }
        return true;
    }