protected function generateRulesets()
    {
        $model = $this->cldrRepository->getModel('supplemental/plurals');
        $pluralRulesSet = $model->getRawArray('plurals');

        $index = 0;
        foreach ($pluralRulesSet as $pluralRulesNodeString => $pluralRules) {
            $localeLanguages = $model->getAttributeValue($pluralRulesNodeString, 'locales');

            foreach (explode(' ', $localeLanguages) as $localeLanguage) {
                $this->rulesetsIndices[$localeLanguage] = $index;
            }

            if (is_array($pluralRules)) {
                $ruleset = [];
                foreach ($pluralRules as $pluralRuleNodeString => $pluralRule) {
                    $pluralForm = $model->getAttributeValue($pluralRuleNodeString, 'count');
                    $ruleset[$pluralForm] = $this->parseRule($pluralRule);
                }

                foreach (explode(' ', $localeLanguages) as $localeLanguage) {
                    $this->rulesets[$localeLanguage][$index] = $ruleset;
                }
            }

            ++$index;
        }
    }