@Override int parse( Map<Object, Long> unitsToValues, CharSequence text, int pos ) { int start = pos; pos = this.numItem.parse(unitsToValues, text, pos); if (pos < 0) { return pos; } pos = this.sepItem.parse(unitsToValues, text, pos); if (pos < 0) { return pos; } long value = unitsToValues.get(this.numItem.getUnit()).longValue(); String s = this.pluralForms.get(this.rules.getCategory(value)); int n = s.length(); if (pos + n > text.length() - this.getReserved()) { return ~start; } for (int i = 0; i < n; i++) { if (s.charAt(i) != text.charAt(pos + i)) { return ~start; } } return pos + n; }