# Copyright 2010-2020, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Generates POSMatcher rules:
#
# format:
# FunctionName1 RegexPattern1
# FunctionName2 RegexPattern2
# FunctionName3 RegexPattern3
# ..
#
# Generates the following methods inside POSMatcher
# uint16 POSMatcher::Get<FunctionalName>Id() { ... }
# bool   POSMatcher::Is<FunctionalName>(uint16 id) { ... }
#
# Example:
# uint16 POSMatcher::GetFirstNameId() { ... }
# bool   POSMatcher::IsFirstName(uint16 id) { ... }

Functional ^(助詞|助動詞|動詞,非自立|名詞,非自立|形容詞,非自立|動詞,接尾|名詞,接尾|形容詞,接尾)

Unknown    名詞,サ変接続

FirstName  名詞,固有名詞,人名,名
LastName   名詞,固有名詞,人名,姓

Number      名詞,数,アラビア数字
KanjiNumber 名詞,数,漢数字

# Used in CandidateFilter
WeakCompoundNounPrefix 接頭詞,名詞接続,
WeakCompoundVerbPrefix 接頭詞,動詞接続,
WeakCompoundFillerPrefix フィラー,
WeakCompoundNounSuffix ^名詞,(サ変接続|ナイ形容詞語幹|一般|副詞可能|形容詞語幹)
WeakCompoundVerbSuffix 動詞,自立

# Used in Segmenter
# if the following particles exist at the beggining of a segment,
# concat them with the next content word.
# ex.
# にかく => に書く, not に|書く
AcceptableParticleAtBeginOfSegment ^助詞,*,*,*,*,*,(が|で|と|に|にて|の|へ|より|も|と|から|は|や)$

# Used in UserHistoryRewriter
JapanesePunctuations 記号,(句点|読点)

# Used in SymbolRewriter
OpenBracket 記号,括弧開
CloseBracket 記号,括弧閉

# Used in SingleKanjiRewriter
GeneralSymbol 記号,一般,

Zipcode 特殊,郵便番号

# 短縮よみ
IsolatedWord 特殊,短縮よみ

# サジェストのみ
SuggestOnlyWord 特殊,サジェストのみ

# Used in UsageRewriter
ContentWordWithConjugation ^(動詞,自立,*,*,五段|動詞,自立,*,*,一段|形容詞,自立)

# 末尾語
SuffixWord ^(助詞|助動詞|動詞,非自立|動詞,接尾|形容詞,非自立|形容詞,接尾|動詞,自立,*,*,サ変・スル)

# 助数詞
CounterSuffixWord 名詞,接尾,助数詞

# 固有名詞
UniqueNoun ^名詞,固有名詞

# 一般名詞
GeneralNoun ^名詞,一般,*,*,*,*,*$

# 代名詞
Pronoun ^名詞,代名詞,

# Content Noun
ContentNoun ^名詞,(一般|固有名詞|副詞可能|サ変接続),

# Noun prefix
NounPrefix ^接頭詞,名詞接続,

# EOS symbols
EOSSymbol ^(記号,(句点|読点|アルファベット|一般|括弧開|括弧閉))|^(名詞,数,(アラビア数字|区切り文字))

# 副詞
Adverb ^副詞,

# 副詞節 suffix
AdverbSegmentSuffix ^助詞,*,*,*,*,*,(から|で|と|に|にて|の|へ|を)$

# 並立助詞
ParallelMarker ^助詞,並立助詞

# These rules are used for removing candidate "書います", "書いたい",
# "書いすぎ", "書った"etc

# て助動詞/助詞
TeSuffix (助詞,接続助詞,*,*,*,*,(て|ちゃ)|助詞,並立助詞,*,*,*,*,たり|助詞,終助詞,*,*,*,*,てん|助動詞,*,*,*,特殊・タ,|動詞,非自立,*,*,一段,*,てる|助動詞,*,*,*,下二・タ行,連用形,つ|動詞,非自立,*,*,五段・カ行イ音便,*,とく|動詞,非自立,*,*,五段・カ行促音便,*,てく|動詞,非自立,*,*,五段・ラ行,*,(たる|とる)|動詞,非自立,*,*,五段・ワ行促音便,*,(ちゃう|ちまう)|動詞,非自立,*,*,一段,連用形,てる)

# 助動詞,助詞
# For "書いX", if X is VerbSuffix and X is not TeSuffix, it is invalid.
VerbSuffix (^動詞,非自立|^助詞,接続助詞|^助動詞)

# カ行イ音便 タ接続 "書い"-て "書い"-た
# カ行促音便 タ接続 "言っ"-て "言っ"-た
KagyoTaConnectionVerb ^動詞,(非自立|自立),*,*,五段・カ行(促音便|イ音便),連用タ接続

# ワ行促音便 連用形 "買っ" -て "買っ"-た
# This rule is used for removing candidate "買いた"
# Do not match ウ音便, because "吸うた" is acceptable.
WagyoRenyoConnectionVerb ^動詞,(非自立|自立),*,*,五段・ワ行促音便,連用形
