7.6.5. set-class オプション
解析対象とする固有名クラスを指定します。
固有名クラスは正規表現文字列のリストで指定してください。
また、除外したいクラスは先頭に - を指定してください。
set-class オプション,
remove-class オプション,
add-class オプション
が同時に指定されている場合、
まず set-class, 次に remove-class, 最後に
add-class が評価されます。
set-class を指定しない場合、対象クラスは [r'.*']
になります。つまりデータベース内の全ての地名語が対象です。
クラス名の評価は指定された順番に行なわれます。
つまり「鉄道施設は除く、ただし駅は利用する」という場合は
[r'.*', r'-鉄道施設/.*', r'.*駅$']
のように指定します。
パラメータ
set-class : list of str
正規表現として解釈し、パターンに一致する 固有名クラスを持つ地名語を解析対象とします
7.6.5.1. リクエストの例
全ての固有名クラスから 鉄道施設/.* に一致するものを
除外したクラスを検索対象とします。
駅名は検索されなくなります。
{
"method": "geonlp.parse",
"params": {
"sentence": "和歌山市は晴れ。",
"options": {
"set-class": [
".*",
"-鉄道施設/.*"
]
}
},
"id": "test_parse_set_class"
}
7.6.5.2. レスポンスの例
{
"features": [
{
"geometry": {
"coordinates": [
135.170808,
34.230514
],
"type": "Point"
},
"properties": {
"geoword_properties": {
"address": "和歌山県和歌山市",
"body": "和歌山",
"body_variants": "和歌山",
"code": {},
"countyname": "",
"countyname_variants": "",
"dictionary_id": 1,
"dictionary_identifier": "geonlp:geoshape-city",
"entry_id": "30201A1968",
"geolod_id": "lQccqK",
"hypernym": [
"和歌山県"
],
"latitude": "34.23051400",
"longitude": "135.17080800",
"ne_class": "市区町村",
"prefname": "和歌山県",
"prefname_variants": "和歌山県",
"source": "1/和歌山市役所/和歌山市七番丁23/P34-14_30.xml",
"suffix": [
"市"
],
"valid_from": "1889-04-01",
"valid_to": ""
},
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "和歌山市",
"pos": "名詞",
"prononciation": "",
"subclass1": "固有名詞",
"subclass2": "地名語",
"subclass3": "lQccqK:和歌山市",
"surface": "和歌山市",
"yomi": ""
},
"node_type": "GEOWORD",
"surface": "和歌山市"
},
"type": "Feature"
},
{
"geometry": null,
"properties": {
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "は",
"pos": "助詞",
"prononciation": "ワ",
"subclass1": "係助詞",
"subclass2": "*",
"subclass3": "*",
"surface": "は",
"yomi": "ハ"
},
"node_type": "NORMAL",
"surface": "は"
},
"type": "Feature"
},
{
"geometry": null,
"properties": {
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "晴れ",
"pos": "名詞",
"prononciation": "ハレ",
"subclass1": "一般",
"subclass2": "*",
"subclass3": "*",
"surface": "晴れ",
"yomi": "ハレ"
},
"node_type": "NORMAL",
"surface": "晴れ"
},
"type": "Feature"
},
{
"geometry": null,
"properties": {
"morphemes": {
"conjugated_form": "*",
"conjugation_type": "*",
"original_form": "。",
"pos": "記号",
"prononciation": "。",
"subclass1": "句点",
"subclass2": "*",
"subclass3": "*",
"surface": "。",
"yomi": "。"
},
"node_type": "NORMAL",
"surface": "。"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}