Skip to content

Instantly share code, notes, and snippets.

@tanraya
Last active August 29, 2015 14:00
Show Gist options
  • Save tanraya/11056944 to your computer and use it in GitHub Desktop.
Save tanraya/11056944 to your computer and use it in GitHub Desktop.
# encoding: utf-8
require 'yaml'
require 'unicode_utils'
module Petrovich
NOMINATIVE = :nominative # именительный
GENITIVE = :genitive # родительный
DATIVE = :dative # дательный
ACCUSATIVE = :accusative # винительный
INSTRUMENTAL = :instrumental # творительный
PREPOSITIONAL = :prepositional # предложный
CASES = [NOMINATIVE, GENITIVE, DATIVE, ACCUSATIVE, INSTRUMENTAL, PREPOSITIONAL]
RULES = YAML.load_file(File.expand_path('../../../rules/rules.yml', __FILE__))
# Методы склонения ФИО
module InflectionMethods
def firstname(name, inflection_case)
end
def middlename(name, inflection_case)
end
def lastname(name, inflection_case)
end
def inflect(firstname, middlename, lastname, inflection_case)
end
end
# Методы определения пола по ФИО
module GenderMethods
def detect_gender(firstname, middlename, lastname)
end
end
# Методы для поиска по словарю
module SearchMethods
class UnknownCaseError < StandartError;end
class UnknownRuleError < StandartError;end
class ApplyRuleError < StandartError;end
# Найденное правило
class MatchedRule
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment