<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](stringprep.xhtml "stringprep --- Internet String Preparation") | - [上一頁](textwrap.xhtml "textwrap --- Text wrapping and filling") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [文本處理服務](text.xhtml) ? - $('.inline-search').show(0); | # [`unicodedata`](#module-unicodedata "unicodedata: Access the Unicode Database.") --- Unicode 數據庫 - - - - - - 此模塊提供對 Unicode 字符數據庫(UCD)的訪問,該數據庫定義所有 Unicode 字符的字符屬性。此數據庫中包含的數據是從 [UCD版本11.0.0](http://www.unicode.org/Public/11.0.0/ucd) \[http://www.unicode.org/Public/11.0.0/ucd\] 編譯的。 該模塊使用與 Unicode 標準附件 #44 , [“Unicode字符數據庫”](http://www.unicode.org/reports/tr44/tr44-6.html) \[http://www.unicode.org/reports/tr44/tr44-6.html\] 定義的相同名稱和符號。它定義了以下功能: `unicodedata.``lookup`(*name*)按名稱查找字符。如果找到具有給定名稱的字符,則返回相應的字符。 如果沒有找到,則 [`KeyError`](exceptions.xhtml#KeyError "KeyError") 被引發。 在 3.3 版更改: 已添加對名稱別名 [1](#id3) 和命名序列 [2](#id4) 的支持。 `unicodedata.``name`(*chr*\[, *default*\])返回分配給字符 *chr* 的名稱作為字符串。如果沒有定義名稱,則返回 *default* ,如果沒有給出,則 [`ValueError`](exceptions.xhtml#ValueError "ValueError") 被引發。 `unicodedata.``decimal`(*chr*\[, *default*\])返回分配給字符 *chr* 的十進制值作為整數。 如果沒有定義這樣的值,則返回 *default* ,如果沒有給出,則 [`ValueError`](exceptions.xhtml#ValueError "ValueError") 被引發。 `unicodedata.``digit`(*chr*\[, *default*\])返回分配給字符 *chr* 的數字值作為整數。 如果沒有定義這樣的值,則返回 *default* ,如果沒有給出,則 [`ValueError`](exceptions.xhtml#ValueError "ValueError") 被引發。 `unicodedata.``numeric`(*chr*\[, *default*\])返回分配給字符 *chr* 的數值作為浮點數。 如果沒有定義這樣的值,則返回 *default* ,如果沒有給出,則 [`ValueError`](exceptions.xhtml#ValueError "ValueError") 被引發。 `unicodedata.``category`(*chr*)返回分配給字符 *chr* 的常規類別為字符串。 `unicodedata.``bidirectional`(*chr*)返回分配給字符 *chr* 的雙向類作為字符串。如果未定義此類值,則返回空字符串。 `unicodedata.``combining`(*chr*)返回分配給字符 *chr* 的規范組合類作為整數。如果沒有定義組合類,則返回 `0` 。 `unicodedata.``east_asian_width`(*chr*)返回分配給字符 *chr* 的東亞寬度作為字符串。 `unicodedata.``mirrored`(*chr*)返回分配給字符 *chr* 的鏡像屬性為整數。如果字符在雙向文本中被識別為“鏡像”字符,則返回 `1` ,否則返回 `0` 。 `unicodedata.``decomposition`(*chr*)返回分配給字符 *chr* 的字符分解映射作為字符串。如果未定義此類映射,則返回空字符串。 `unicodedata.``normalize`(*form*, *unistr*)返回 Unicode 字符串 *unistr* 的正常形式 *form* 。 *form* 的有效值為 'NFC' 、 'NFKC' 、 'NFD' 和 'NFKD' 。 Unicode 標準基于規范等價和兼容性等效的定義定義了 Unicode 字符串的各種規范化形式。在 Unicode 中,可以以各種方式表示多個字符。 例如,字符 U+00C7 (帶有 CEDILLA 的 LATIN CAPITAL LETTER C )也可以表示為序列 U+0043( LATIN CAPITAL LETTER C )U+0327( COMBINING CEDILLA )。 對于每個字符,有兩種正規形式:正規形式 C 和正規形式 D 。正規形式D(NFD)也稱為規范分解,并將每個字符轉換為其分解形式。 正規形式C(NFC)首先應用規范分解,然后再次組合預組合字符。 除了這兩種形式之外,還有兩種基于兼容性等效的其他常規形式。 在 Unicode 中,支持某些字符,這些字符通常與其他字符統一。 例如, U+2160(ROMAN NUMERAL ONE)與 U+0049(LATIN CAPITAL LETTER I)完全相同。 但是, Unicode 支持它與現有字符集(例如 gb2312 )的兼容性。 正規形式KD(NFKD)將應用兼容性分解,即用其等價項替換所有兼容性字符。 正規形式KC(NFKC)首先應用兼容性分解,然后是規范組合。 即使兩個 unicode 字符串被規范化并且人類讀者看起來相同,如果一個具有組合字符而另一個沒有,則它們可能無法相等。 此外,該模塊暴露了以下常量: `unicodedata.``unidata_version`此模塊中使用的 Unicode 數據庫的版本。 `unicodedata.``ucd_3_2_0`這是一個與整個模塊具有相同方法的對象,但對于需要此特定版本的 Unicode 數據庫(如 IDNA )的應用程序,則使用 Unicode 數據庫版本 3.2 。 示例: ``` >>> import unicodedata >>> unicodedata.lookup('LEFT CURLY BRACKET') '{' >>> unicodedata.name('/') 'SOLIDUS' >>> unicodedata.decimal('9') 9 >>> unicodedata.decimal('a') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: not a decimal >>> unicodedata.category('A') # 'L'etter, 'u'ppercase 'Lu' >>> unicodedata.bidirectional('\u0660') # 'A'rabic, 'N'umber 'AN' ``` 腳注 [1](#id1)<http://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt> [2](#id2)<http://www.unicode.org/Public/11.0.0/ucd/NamedSequences.txt> ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](stringprep.xhtml "stringprep --- Internet String Preparation") | - [上一頁](textwrap.xhtml "textwrap --- Text wrapping and filling") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [文本處理服務](text.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看