Last active
August 29, 2015 14:00
-
-
Save tanraya/11056944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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