Return the number of plurals for this catalog language, or 2 if no
        plural string is available.
326401
def _num_plurals(self, catalogue):
        
        match = re.search(r'nplurals=\s*(\d+)', self.get_plural(catalogue) or '')
        if match:
            return int(match.groups()[0])
        return 2
1127188
def ngettext(self, singular, plural, num, domain=None, **variables):
        
        variables.setdefault('num', num)
        t = self.get_translations(domain)
        return t.ungettext(singular, plural, num) % variables
1058526
def pluralize(locale, entry, count)
      return entry unless entry.is_a?(Hash) and count
      key = :zero if count == 0 && entry.has_key?(:zero)
      key ||= count <= 1 ? :one : :other
      raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key)
      entry[key]
    end
901900
def articles(self):
		'''  '''

		result = [None, None]
		element = self._first('NN')
		if element:
			result[0] = [element.split(' ')[0].replace('(die)', '').strip()]
			if 'kein Plur' in element:
				# There is no plural
				result[1] = ['']
			else:
				# If a plural form exists, there is only one possibility
				result[1] = ['die']
		return result
318217
function choosePluralForm(text, locale, count){
    var ret, texts, chosenText;
    if (count != null && text) {
      texts = text.split(delimeter);
      chosenText = texts[pluralTypeIndex(locale, count)] || texts[0];
      ret = trim(chosenText);
    } else {
      ret = text;
    }
    return ret;
  }
219877
function pluralize(word, count, inclusive) {
        var pluralized = count === 1
            ? pluralize.singular(word) : pluralize.plural(word);
        return (inclusive ? count + ' ' : '') + pluralized;
    }
271284
public PluralRules load(
        Locale locale,
        NumberType numType
    ) {

        Map<String, PluralRules> map;
        PluralRules stdRules;

        switch (numType) {
            case CARDINALS:
                map = CARDINAL_MAP;
                stdRules = STD_CARDINALS;
                break;
            case ORDINALS:
                map = ORDINAL_MAP;
                stdRules = STD_ORDINALS;
                break;
            default:
                throw new UnsupportedOperationException(numType.name());
        }

        PluralRules rules = null;
        String region = FormatUtils.getRegion(locale);

        if (!region.isEmpty()) {
            StringBuilder kb = new StringBuilder();
            kb.append(locale.getLanguage());
            kb.append('_');
            kb.append(region);
            rules = map.get(kb.toString());
        }

        if (rules == null) {
            rules = map.get(locale.getLanguage());
        }

        if (rules == null) {
            return stdRules;
        }

        return rules;

    }
173042
def plural(self, text, count=None):
        
        pre, word, post = self.partition_word(text)
        if not word:
            return text
        plural = self.postprocess(
            word,
            self._pl_special_adjective(word, count)
            or self._pl_special_verb(word, count)
            or self._plnoun(word, count),
        )
        return "{}{}{}".format(pre, plural, post)
1197335
def singularize(plural):
    
    if plural in UNCOUNTABLES:
        return plural
    for i in IRREGULAR:
        if i[1] == plural:
            return i[0]
    for i in SINGULARIZE_PATTERNS:
        if re.search(i[0], plural):
            return re.sub(i[0], i[1], plural)
    return plural
958745
@Override
  public int getNumberOfSyllables(String word, Language lang) {
    return getNumberOfSyllables(word, getLocale(lang));
  }
39913
function pluralForModel (model) {
  if (model.pluralModelName) {
    return model.pluralModelName
  }

  if (model.settings && model.settings.plural) {
    return model.settings.plural
  }

  if (
    model.definition &&
    model.definition.settings &&
    model.definition.settings.plural
  ) {
    return model.definition.settings.plural
  }

  return inflection.pluralize(model.sharedClass.name)
}
403155
def get_numwords():
    """"""
    numwords = {'and': (1, 0), 'a': (1, 1), 'an': (1, 1)}

    for idx, word in enumerate(UNITS):
        numwords[word] = (1, idx)
    for idx, word in enumerate(TENS):
        numwords[word] = (1, idx * 10)
    for idx, word in enumerate(SCALES):
        numwords[word] = (10 ** (idx * 3 or 2), 0)

    all_numbers = ur'|'.join(ur'\b%s\b' % i for i in numwords.keys() if i)

    return all_numbers, numwords
858537
def get_kind_name_plural(kind):
        ""
        if kind in ['comedy', 'cinema', 'dance', 'theatre']:
            return kind.title()
        elif kind == 'museum':
            return 'Galleries/Museums'
        else:
            return '{}s'.format(Event.get_kind_name(kind))
213498
function pluralize (value, word, options) {
  options = options || {}
  var output = ''
  var includeNumber = options.includeNumber != null ? options.includeNumber : false
  if(includeNumber === true) output += value + ' '
  if(!value && value !== 0 || !word) return output
  if(Array.isArray(word)) {
    output += word[value - 1] || word[word.length - 1]
  } else {
    output += word + (value === 1 ? '' : 's')
  }

  return output
}
1155907
public function sp($singular, $plural, $count, $autoTranslate = false) {
		if ((int)$count !== 1) {
			$result = $plural;
		} else {
			$result = $singular;
		}

		if ($autoTranslate) {
			$result = __($result);
		}
		return $result;
	}
581640
function ( number, pluralRules ) {
			var i,
				pluralForms = [ 'zero', 'one', 'two', 'few', 'many', 'other' ],
				pluralFormIndex = 0;

			for ( i = 0; i < pluralForms.length; i++ ) {
				if ( pluralRules[pluralForms[i]] ) {
					if ( pluralRuleParser( pluralRules[pluralForms[i]], number ) ) {
						return pluralFormIndex;
					}

					pluralFormIndex++;
				}
			}

			return pluralFormIndex;
		}
795348
public static function plural($string)
    {
        $result = $string;
        foreach (self::$_plural as $rule => $replacement) {
            $rule = self::_normalize($rule);
            if (preg_match($rule, $string)) {
                $result = preg_replace($rule, $replacement, $string);
                break;
            }
        }
        return $result;
    }