# 3.3.6.Character Filters（字符过滤器）

**Characterfilters**（字符过滤器）用于字符流传递到分词器（**tokenizer**）之前对它进行预处理。

一个**Characterfilters**（字符过滤器）接收原始文本作为字符流，通过**adding**（添加），**removing**（删除）或**changing**（更改）字符来转换流。例如，可以使用字符过滤器将**Arabic numerals**（阿拉伯数字）（**٠‎١٢٣٤٥٦٧٨‎٩‎**）转换为和它等价的**Latin**（拉丁数字）（**0123456789**），也可以用于从字符流中剥&#x79BB;**\<b>**&#x7B49;**HTML**元素。

**Elasticsearch**内置了许多的**characterfilters**（字符过滤器），可以用来构建 [custom analyzers](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/analysis-custom-analyzer.html)（自定义分词器）。

[HTML Strip Character Filter](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-htmlstrip-charfilter.html)

该**html\_strip**字符串过滤器可以删除类&#x4F3C;**\<b>**&#x7684;**HTML**元素和解码类似于 **&**&#x8FD9;样的 **HTML**实体。

[Mapping Character Filter](http://cwiki.apachecn.org/display/Elasticsearch/Mapping+Character+Filter)

该**mapping**字符串过滤器可以将所有指定的字符串替换成特定的字符串。

[Pattern Replace Character Filter](http://cwiki.apachecn.org/display/Elasticsearch/Pattern+Replace+Character+Filter)

该**pattern\_replace**字符串过滤器可以将满足正则表达式的所有字符串替换成特定的字符串


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xiaoxiami.gitbook.io/elasticsearch/ji-chu/33-analysisfen-679029/336character-filtersff08-zi-fu-guo-lv-qi-ff09.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
