module QT::TlRule
Extended Modules
Defined in:
core/mt_core/tl_rule.crcore/mt_core/tl_rule/_base_rules.cr
core/mt_core/tl_rule/adjt_rules/fold_adjt_adv_bu.cr
core/mt_core/tl_rule/adjt_rules/fold_adjt_noun.cr
core/mt_core/tl_rule/adjt_rules/fold_adjt_ude2.cr
core/mt_core/tl_rule/adjt_rules/fold_adjts.cr
core/mt_core/tl_rule/adjt_rules/scan_adjt.cr
core/mt_core/tl_rule/compare_rules/fold_compare.cr
core/mt_core/tl_rule/compare_rules/fold_compare_bi3.cr
core/mt_core/tl_rule/compare_rules/fold_compare_vyou.cr
core/mt_core/tl_rule/fold_left/fold_postpos.cr
core/mt_core/tl_rule/funcws_rules/fold_adverb_node.cr
core/mt_core/tl_rule/funcws_rules/fold_adverbs.cr
core/mt_core/tl_rule/funcws_rules/fold_onomat.cr
core/mt_core/tl_rule/funcws_rules/junction_rules.cr
core/mt_core/tl_rule/mixed_rules/fold_mixed.cr
core/mt_core/tl_rule/mixed_rules/heal_mixed.cr
core/mt_core/tl_rule/noun_rules/fold_noun_adjt.cr
core/mt_core/tl_rule/noun_rules/fold_noun_after.cr
core/mt_core/tl_rule/noun_rules/fold_noun_left.cr
core/mt_core/tl_rule/noun_rules/fold_noun_noun.cr
core/mt_core/tl_rule/noun_rules/fold_noun_verb.cr
core/mt_core/tl_rule/noun_rules/fold_nouns.cr
core/mt_core/tl_rule/noun_rules/fold_spaces.cr
core/mt_core/tl_rule/noun_rules/noun_enum.cr
core/mt_core/tl_rule/noun_rules/scan_nouns.cr
core/mt_core/tl_rule/number_rules/fold_numbers.cr
core/mt_core/tl_rule/number_rules/ndigit_rules.cr
core/mt_core/tl_rule/number_rules/nhanzi_rules.cr
core/mt_core/tl_rule/number_rules/nquant_rules.cr
core/mt_core/tl_rule/number_rules/quanti_rules.cr
core/mt_core/tl_rule/particles_rules/fold_auxils.cr
core/mt_core/tl_rule/particles_rules/fold_ude1.cr
core/mt_core/tl_rule/particles_rules/fold_ude3.cr
core/mt_core/tl_rule/particles_rules/fold_usou.cr
core/mt_core/tl_rule/particles_rules/fold_uzhi.cr
core/mt_core/tl_rule/particles_rules/ude1_rules/fold_noun_ude1.cr
core/mt_core/tl_rule/particles_rules/ude1_rules/fold_verb_ude1.cr
core/mt_core/tl_rule/prepos_rules/fold_pre_ba3.cr
core/mt_core/tl_rule/prepos_rules/fold_prepos_inner.cr
core/mt_core/tl_rule/prepos_rules/fold_preposes.cr
core/mt_core/tl_rule/pronoun_rules/fold_prodem_nounish.cr
core/mt_core/tl_rule/pronoun_rules/fold_prodems.cr
core/mt_core/tl_rule/pronoun_rules/fold_proints.cr
core/mt_core/tl_rule/pronoun_rules/fold_pronouns.cr
core/mt_core/tl_rule/pronoun_rules/fold_propers.cr
core/mt_core/tl_rule/punct_rules/fold_nested.cr
core/mt_core/tl_rule/special_rules/fold_special.cr
core/mt_core/tl_rule/special_rules/fold_vshi.cr
core/mt_core/tl_rule/special_rules/第_rules.cr
core/mt_core/tl_rule/string_rules/fold_litstr.cr
core/mt_core/tl_rule/string_rules/fold_string.cr
core/mt_core/tl_rule/string_rules/fold_urlstr.cr
core/mt_core/tl_rule/timeword_rules/fold_timeword.cr
core/mt_core/tl_rule/verb_rules/fold_verb_advbu.cr
core/mt_core/tl_rule/verb_rules/fold_verb_auxils.cr
core/mt_core/tl_rule/verb_rules/fold_verb_compls.cr
core/mt_core/tl_rule/verb_rules/fold_verb_nquant.cr
core/mt_core/tl_rule/verb_rules/fold_verb_object.cr
core/mt_core/tl_rule/verb_rules/fold_verb_uzhe.cr
core/mt_core/tl_rule/verb_rules/fold_verb_vdirs.cr
core/mt_core/tl_rule/verb_rules/fold_verb_verb.cr
core/mt_core/tl_rule/verb_rules/fold_verbs.cr
core/mt_core/tl_rule/verb_rules/fold_vmodals.cr
core/mt_core/tl_rule/verb_rules/misc_verb_rules.cr
core/mt_core/tl_rule/verb_rules/scan_verbs.cr
Constant Summary
-
BA3_HANDLERS =
{'剑', '刀', '枪'}
-
BA3_IN_HANDS =
{'米', '花', '盐', '糖', '麦', '谷'}
-
MAP_上 =
{"lên", "trên", "thượng"}
-
MAP_下 =
{"xuống", "dưới", "hạ"}
-
MEASURES =
{"宽" => "rộng", "高" => "cao", "长" => "dài", "远" => "xa", "重" => "nặng"}
-
PRE_NUM_APPROS =
{"近" => "gần", "约" => "chừng", "小于" => "ít hơn"}
-
QUANTI_PRE_APPRO =
{"多" => "hơn", "来" => "chừng", "余" => "trên", "几" => "mấy"}
-
QUANTI_SUF_APPRO =
{"宽" => "rộng", "高" => "cao", "长" => "dài", "远" => "xa", "重" => "nặng", "多" => "hơn", "来" => "chừng", "左右" => "khoảng", "前后" => "khoảng", "上下" => "khoảng", "间" => "khoảng", "后间" => "khoảng", "后" => "sau", "之后" => "sau", "时" => "lúc", "之时" => "lúc", "上" => "trên", "之上" => "trên", "下" => "dưới", "之下" => "dưới", "前" => "trước", "之前" => "trước", "里" => "trong", "内" => "trong", "中" => "trong", "后内" => "trong", "后中" => "trong"}
-
SUFFIXES =
{"的日子" => {"thời gian", PosTag::Ntime, true}, "的时候" => {"lúc", PosTag::Postpos, true}, "时" => {"khi", PosTag::Postpos, true}, "们" => {"các", PosTag::Noun, true}, "语" => {"tiếng", PosTag::Nother, true}, "性" => {"tính", PosTag::Ajno, true}, "所" => {"nơi", PosTag::Posit, true}, "界" => {"giới", PosTag::Posit, false}, "化" => {"hoá", PosTag::Verb, false}, "级" => {"cấp", PosTag::Nattr, true}, "型" => {"hình", PosTag::Nattr, true}, "状" => {"dạng", PosTag::Nattr, true}, "色" => {"màu", PosTag::Nattr, true}}
-
VERB_COMBINE =
{"爱", "喜欢", "避免", "忍不住"}
Instance Method Summary
- #boundary?(node : Nil)
- #boundary?(node : MtNode)
- #can_combine_adjt?(left : MtNode, right : MtNode | Nil)
- #can_combine_verb_verb?(verb : MtNode, verb_2 : MtNode)
- #clean_nquant(nquant : MtNode, prodem : MtNode | Nil)
- #clean_个!(node : MtNode) : MtNode
- #concoord_is_prepos?(node : MtNode | Nil)
- #deep_clean_个!(node : MtNode) : Nil
- #do_not_flip?(key : String)
- #end_sentence?(node : Nil)
- #end_sentence?(node : MtNode)
- #exact_year?(node : MtNode, appro : Int32 = 0) : Bool
- #find_verb_after(right : MtNode)
-
#find_verb_after_for_prepos(node : MtNode, skip_comma = true) : MtNode | Nil
ameba:disable Metrics/CyclomaticComplexity
- #fix_adverb!(node : MtNode, succ = node.succ) : Tuple(MtNode, MtNode | Nil)
- #fix_grammar!(node : MtNode) : Nil
- #fix_space_val!(node : MtNode)
- #fix_上下(node : MtNode, vals = node.key == "上" ? MAP_上 : MAP_下) : MtNode
- #flip_proper_noun?(proper : MtNode, noun : MtNode) : Bool
- #fold!(head : MtNode, tail : MtNode, tag : PosTag = PosTag::Unkn, dic : Int32 = 9, flip : Bool = false)
- #fold_adj_adv!(node : MtNode, prev = node.prev?)
- #fold_adjt_adv_bu!(adjt : MtNode, adv : MtNode, prev : MtNode | Nil)
- #fold_adjt_as_noun!(node : MtNode)
- #fold_adjt_hao!(node : MtNode) : MtNode
- #fold_adjt_junction!(node : MtNode, prev = node.prev?, succ = node.succ?)
- #fold_adjt_measure(adjt : MtTerm, succ = adjt.succ?)
- #fold_adjt_noun!(adjt : MtNode, noun : MtNode | Nil, ude1 : MtNode | Nil = nil)
- #fold_adjt_ude2!(adjt : MtNode, ude2 : MtNode)
-
#fold_adjts!(adjt : MtNode, prev : MtNode | Nil = nil) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_adv_bu!(node : MtNode, succ = node.succ) : MtNode
- #fold_adv_fei!(node : MtNode, succ = node.succ) : MtNode
- #fold_adv_mei!(node : MtNode, succ = node.succ) : MtNode
-
#fold_adverb_base!(node : MtNode, succ = node.succ) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_adverb_node!(adv : MtNode, node = adv.succ, tag = node.tag, dic = 4) : MtNode
- #fold_adverb_ude3!(node : MtNode, succ : MtNode) : MtNode
- #fold_adverb_verb!(adverb : MtNode, verb : MtNode)
- #fold_adverbs!(node : MtNode, succ = node.succ?) : MtNode
- #fold_auxils!(node : MtNode, mode = 1) : MtNode
- #fold_compare(head : MtNode, tail : MtNode, head_val = head.val)
- #fold_compare_bi3!(prepos : MtNode, succ = prepos.succ?, mode = 0)
- #fold_compare_bi3_after!(node : MtNode, last : MtNode)
-
#fold_compare_vyou!(vyou : MtNode, noun : MtNode, tail : MtNode)
ameba:disable Metrics/CyclomaticComplexity
- #fold_day?(num : MtNode | Nil) : MtNode | Nil
- #fold_head_ude1_noun!(head : MtNode)
- #fold_hour!(node : MtNode, succ : MtNode, appro : Int32 = 0)
- #fold_left!(right : MtNode, left : MtNode) : MtNode | Nil
- #fold_left_verb!(node : MtNode, prev : MtNode | Nil)
- #fold_list!(head : MtNode, tail : MtNode | Nil = nil) : Nil
- #fold_litstr!(root : MtNode) : MtNode
- #fold_minute!(node : MtNode, succ : MtNode, appro : Int32 = 0)
- #fold_mixed!(node, prev = node.prev?, succ = node.succ?)
- #fold_modifier!(node : MtNode, succ = node.succ?, nega : MtNode | Nil = nil)
- #fold_month!(prev : MtNode, node : MtNode, appro : Int32 = 0)
-
#fold_ndigit!(node : MtNode, prev : MtNode | Nil = nil)
ameba:disable Metrics/CyclomaticComplexity
- #fold_ndigit_nhanzi!(node : MtNode, succ : MtNode) : MtNode
- #fold_nested!(head : MtNode, tail : MtNode)
- #fold_nhanzi!(node : MtNode, prev : MtNode | Nil = nil) : MtNode
- #fold_nhanzi_dian!(node : MtNode, succ : MtNode, prev : MtNode | Nil) : MtNode
-
#fold_noun_adjt!(noun : MtNode, adjt : MtNode)
ameba:disable Metrics/CyclomaticComplexity
- #fold_noun_after!(noun : MtNode, succ = noun.succ?) : MtNode
- #fold_noun_concoord!(node : MtNode, prev = node.prev?, succ = node.succ?)
-
#fold_noun_noun!(node : MtNode, succ : MtNode, mode = 0)
ameba:disable Metrics/CyclomaticComplexity
- #fold_noun_penum!(head : MtNode, join : MtNode)
- #fold_noun_space!(noun : MtNode, space : MtNode) : MtNode
- #fold_noun_space!(noun : MtNode) : MtNode
- #fold_noun_ude1!(noun : MtNode, ude1 : MtNode, right : MtNode, mode = 0) : MtNode
-
#fold_noun_verb!(noun : MtNode, verb : MtNode)
ameba:disable Metrics/CyclomaticComplexity
-
#fold_nouns!(noun : MtNode, mode : Int32 = 0) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_nquant_noun!(prev : MtNode, node : MtNode)
- #fold_number!(node : MtNode, prev : MtNode | Nil = nil)
- #fold_number_hour!(node : MtNode, succ : MtNode) : MtNode
- #fold_number_minute!(node : MtNode, succ : MtNode, is_time = false) : MtNode
-
#fold_once!(node : MtNode) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_onomat!(node : MtNode, succ = node.succ?)
- #fold_other_preposes!(node : MtNode, succ : MtNode, mode : Int32)
- #fold_postpos!(postpos : MtList, left : MtNode) : MtList | Nil
- #fold_pre_ba3!(node : MtNode, succ = node.succ?, mode = 0) : MtNode
- #fold_pre_bei!(node : MtNode, succ = node.succ?, mode = 0) : MtNode
- #fold_pre_dui!(node : MtNode, succ = node.succ?, mode = 0) : MtNode
- #fold_pre_quanti_appro!(node : MtNode, succ : MtNode) : Tuple(MtNode, Int32)
- #fold_pre_zai!(node : MtNode, succ = node.succ?, mode = 0) : MtNode
-
#fold_prepos_inner!(prepos : MtNode, succ = prepos.succ?, mode = 0) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_prepos_left(prepos : MtNode, noun : MtNode, ude1 : MtNode, tail : MtNode)
- #fold_preposes!(node : MtNode, succ = node.succ?, mode = 0) : MtNode
- #fold_prezai_places?(node : MtNode, noun : MtNode, ude1 : MtNode, tail : MtNode) : MtNode | Nil
-
#fold_pro_dems!(node : MtNode, succ : MtNode) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_pro_ints!(proint : MtNode, succ = node.succ?)
- #fold_pro_per!(node : MtNode, succ : Nil) : MtNode
-
#fold_pro_per!(proper : MtNode, succ : MtNode) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_prodem_nominal!(prodem : MtNode | Nil, nominal : MtNode | Nil)
- #fold_proji_nhanzi!(node : MtNode, succ : MtNode)
- #fold_proji_right!(node : MtNode)
- #fold_pronouns!(pronoun : MtNode, succ = pronoun.succ?) : MtNode
-
#fold_proper_nominal!(proper : MtNode, nominal : MtNode) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_space!(node : MtNode) : MtNode
- #fold_specials!(node : MtNode)
- #fold_strings!(node : MtNode) : MtNode
- #fold_suf_quanti_appro!(node : MtNode, succ = node.succ?) : MtNode
- #fold_suffix!(suff : MtTerm, left : MtNode) : MtList | Nil
- #fold_time_appro!(node : MtNode)
- #fold_time_prev!(node : MtNode, prev : MtNode) : MtNode
- #fold_timeword!(node : MtNode, succ = node.succ?) : MtNode
-
#fold_ude1!(ude1 : MtNode, prev = ude1.prev?, succ = ude1.succ?) : MtNode
do not return left when fail to prevent infinity loop!
-
#fold_ude1_left!(ude1 : MtNode, left : MtNode, right : MtNode | Nil) : MtNode
do not return left when fail to prevent infinity loop
- #fold_uniqs_by_key!(node : MtNode, succ = node.succ?)
- #fold_urlstr!(root : MtNode) : MtNode
- #fold_usuo!(usuo : MtNode, succ = usuo.succ?)
- #fold_uzhi!(uzhi : MtNode, prev : MtNode = uzhi.prev, succ = uzhi.succ?) : MtNode
- #fold_v_shi!(vshi : MtNode, succ = vshi.succ?)
- #fold_verb_advbu!(verb : MtNode, adv_bu : MtNode, succ = adv_bu.succ?) : MtNode
- #fold_verb_advbu_verb!(verb : MtNode, adv_bu : MtNode, verb_2 : MtNode)
- #fold_verb_as_noun!(node : MtNode, mode = 0)
- #fold_verb_auxils!(verb : MtNode, auxil : MtNode) : MtNode
- #fold_verb_compare(head : MtNode) : MtNode | Nil
- #fold_verb_compl!(verb : MtNode, compl : MtNode) : MtNode | Nil
-
#fold_verb_junction!(junc : MtNode, verb = junc.prev, succ = junc.succ?)
ameba:disable Metrics/CyclomaticComplexity
- #fold_verb_nquant!(verb : MtNode, tail : MtNode, has_ule = false)
-
#fold_verb_object!(verb : MtNode, succ : MtNode | Nil)
ameba:disable Metrics/CyclomaticComplexity
- #fold_verb_ude1!(verb : MtNode, ude1 : MtNode, right : MtNode, mode = 0)
- #fold_verb_ude1!(node : MtNode, succ = node.succ?)
- #fold_verb_ude3!(node : MtNode, succ : MtNode) : MtNode
- #fold_verb_ule!(verb : MtNode, node : MtNode, succ = node.succ?)
- #fold_verb_uzhe!(prev : MtNode, uzhe : MtNode, succ = uzhe.succ?) : MtNode
-
#fold_verb_vdirs!(verb : MtNode, vdir : MtNode) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_verb_verb!(verb_1 : MtNode, verb_2 : MtNode) : MtNode
-
#fold_verbs!(verb : MtNode, prev : MtNode | Nil = nil) : MtNode
ameba:disable Metrics/CyclomaticComplexity
-
#fold_vmodals!(node : MtNode, succ = node.succ?, nega : MtNode | Nil = nil) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #fold_vyou!(vyou : MtNode, succ : MtNode)
- #fold_vyou_ude1!(vyou : MtNode, ude1 : MtNode, noun : MtNode)
- #fold_year!(prev : MtNode, node : MtNode, appro : Int32 = 0)
- #fold_yi_verb!(node : MtNode, succ : MtNode)
- #fold_什么_noun!(prev : MtNode, node : MtNode)
- #fold_第!(node : MtNode)
-
#fuse_number!(node : MtNode, prev : MtNode | Nil = nil) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #guess_nested_tag(head : MtNode, tail : MtNode)
- #guess_pre_ba3_defn(noun : MtTerm) : String | Nil
- #guess_pre_ba3_defn(noun : MtNode) : String | Nil
- #guess_quoted_tag(head : MtNode, tail : MtNode)
- #has_verb_after?(right : MtNode) : Bool
- #he2_is_prepos?(node : MtNode, succ = node.succ?) : Bool
- #heal_adj_hao!(node : MtNode)
- #heal_ajad!(node : MtNode, prev : MtNode | Nil, succ : MtNode | Nil) : MtNode
-
#heal_ajno!(node : MtNode, prev : MtNode | Nil, succ : MtNode | Nil) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #heal_has_ge4!(node : MtNode)
- #heal_mixed!(node : MtNode, prev = node.prev, succ = node.succ?)
-
#heal_pro_dem!(pro_dem : MtNode) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #heal_quanti!(node : MtNode) : MtNode
- #heal_ude2!(node : MtNode) : MtNode
- #heal_ude3!(node : MtNode, succ = node.succ?) : MtNode
- #heal_ule!(node : MtNode, prev = node.prev?, succ = node.succ?) : MtNode
-
#heal_vead!(node : MtTerm, prev : MtNode | Nil, succ : MtNode | Nil) : MtTerm
ameba:disable Metrics/CyclomaticComplexity
-
#heal_veno!(node : MtTerm, prev : MtNode | Nil, succ : MtNode | Nil) : MtTerm
ameba:disable Metrics/CyclomaticComplexity
- #heal_vm_hui!(node : MtNode, succ = node.succ?, prev = node.prev?) : MtNode
-
#heal_vm_xiang!(node : MtNode, succ = node.succ?, nega : MtNode | Nil = nil) : MtNode
ameba:disable Metrics/CyclomaticComplexity
- #is_adverb?(node : MtNode) : Bool
- #is_concoord?(node : Nil)
- #is_concoord?(node : MtNode)
- #is_linking_verb?(head : MtNode, succ : MtNode | Nil) : Bool
- #is_percent?(prev : MtNode, uzhi : MtNode)
- #is_pre_appro_num?(prev : MtNode | Nil)
- #is_pre_quanti_appro?(node : MtNode)
- #keep_pure_numeral?(node : MtNode | Nil) : Bool | MtNode
- #keep_ule?(prev : MtNode, node : MtNode, succ = node.succ?) : Bool
- #map_closer_char(char : Char)
- #map_nqtype(node : MtNode)
- #map_pro_dem!(key : String) : Tuple(PosTag, String)
-
#meld_number!(node : MtNode)
ameba:disable Metrics/CyclomaticComplexity
- #need_2_objects?(node : MtList)
- #need_2_objects?(node : MtTerm)
- #need_2_objects?(key : String)
- #not_quanti?(node : MtNode)
-
#noun_can_combine?(prev : MtNode | Nil, succ : MtNode | Nil) : Bool
ameba:disable Metrics/CyclomaticComplexity
- #pre_ba3_is_qtnoun?(node : MtNode, succ = node.succ?)
- #prodem_shoud_split?(node : MtNode)
- #read_minute_quanti?(node : MtNode | Nil) : MtTerm | Nil
- #read_second_quanti?(node : MtNode | Nil) : MtTerm | Nil
- #scan_adjt!(node : MtNode | Nil) : MtNode | Nil
-
#scan_noun!(node : MtNode | Nil, mode : Int32 = 0, prodem : MtNode | Nil = nil, nquant : MtNode | Nil = nil)
ameba:disable Metrics/CyclomaticComplexity
- #scan_verb!(node : MtNode)
- #scan_verbs!(node : MtNode)
-
#should_apply_ude1_after_verb?(verb : MtNode, right : MtNode | Nil, prev = verb.prev?)
ameba:disable Metrics/CyclomaticComplexity
- #should_flip_prodem?(prodem : MtNode)
- #should_fold_noun_concoord?(noun : MtNode, concoord : MtNode) : Bool
- #similar_tag?(left : MtNode, right : MtNode)
- #split_prodem!(node : MtNode, succ : MtNode | Nil = node.succ?)
- #vmodal_is_noun?(node : MtNode)
Instance Method Detail
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
do not return left when fail to prevent infinity loop!
do not return left when fail to prevent infinity loop
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity
ameba:disable Metrics/CyclomaticComplexity