본문 바로가기
WIKI 기술 지식 베이스

Armenian analyzer

원문 보기 위키 갱신

출처: 문서

본문

아르메니아어 애널라이저

내장된 armenian 애널라이저는 다음 명령을 사용해 텍스트 필드에 적용할 수 있어요:

PUT /arabic-index
{
  "mappings": {
    "properties": {
      "content": {
        "type": "text",
        "analyzer": "armenian"
      }
    }
  }
}

{% include copy-curl.html %}

어간 제외

다음 명령을 사용하면 이 언어 애널라이저에서 stem_exclusion을 사용할 수 있어요:

PUT index_with_stem_exclusion_armenian_analyzer
{
  "settings": {
    "analysis": {
      "analyzer": {
        "stem_exclusion_armenian_analyzer": {
          "type": "armenian",
          "stem_exclusion": ["բարև", "խաղաղություն"] 
        }
      }
    }
  }
}

{% include copy-curl.html %}

아르메니아어 애널라이저 내부 구조

armenian 애널라이저는 다음 구성 요소로 이루어져 있어요:

  • 토크나이저: standard

  • 토큰 필터:

    • lowercase
    • stop (Armenian)
    • keyword
    • stemmer (Armenian)

커스텀 아르메니아어 애널라이저

다음 명령을 사용해 커스텀 아르메니아어 애널라이저를 만들 수 있어요:

PUT /armenian-index
{
  "settings": {
    "analysis": {
      "filter": {
        "armenian_stop": {
          "type": "stop",
          "stopwords": "_armenian_"
        },
        "armenian_stemmer": {
          "type": "stemmer",
          "language": "armenian"
        },
        "armenian_keywords": {
          "type":       "keyword_marker",
          "keywords":   [] 
        }
      },
      "analyzer": {
        "armenian_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "armenian_stop",
            "armenian_keywords",
            "armenian_stemmer"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "content": {
        "type": "text",
        "analyzer": "armenian_analyzer"
      }
    }
  }
}

{% include copy-curl.html %}

생성된 토큰

애널라이저가 생성한 토큰을 살펴보려면 다음 요청을 사용해요:

GET armenian-index/_analyze
{
  "analyzer": "stem_exclusion_armenian_analyzer",
  "text": "բարև բոլորին, մենք խաղաղություն ենք ուզում և նոր օր ենք սկսել"
}

{% include copy-curl.html %}

응답에는 생성된 토큰이 담겨 있어요:

{
  "tokens": [
    {"token": "բարև","start_offset": 0,"end_offset": 4,"type": "<ALPHANUM>","position": 0},
    {"token": "բոլոր","start_offset": 5,"end_offset": 12,"type": "<ALPHANUM>","position": 1},
    {"token": "խաղաղություն","start_offset": 19,"end_offset": 31,"type": "<ALPHANUM>","position": 3},
    {"token": "ուզ","start_offset": 36,"end_offset": 42,"type": "<ALPHANUM>","position": 5},
    {"token": "նոր","start_offset": 45,"end_offset": 48,"type": "<ALPHANUM>","position": 7},
    {"token": "օր","start_offset": 49,"end_offset": 51,"type": "<ALPHANUM>","position": 8},
    {"token": "սկսել","start_offset": 56,"end_offset": 61,"type": "<ALPHANUM>","position": 10}
  ]
}

더 알아보기 (Learn more)