文本處理 (Text Processing) 服務¶
本章節介紹的模組 (module) 提供了廣泛的字串操作與其他文本處理服務。
在 二進位資料服務 下所描述的 codecs 模組也與文本處理高度相關。另外也請參閱在 Text Sequence Type --- str 中所描述的 Python 內建字串型別。
- string--- 常見的字串操作
- re--- 正規表示式 (regular expression) 操作
- difflib--- Helpers for computing deltas- Differ
- HtmlDiff
- context_diff()
- get_close_matches()
- ndiff()
- restore()
- unified_diff()
- diff_bytes()
- IS_LINE_JUNK()
- IS_CHARACTER_JUNK()
- SequenceMatcher 物件- SequenceMatcher- SequenceMatcher.set_seqs()
- SequenceMatcher.set_seq1()
- SequenceMatcher.set_seq2()
- SequenceMatcher.find_longest_match()
- SequenceMatcher.get_matching_blocks()
- SequenceMatcher.get_opcodes()
- SequenceMatcher.get_grouped_opcodes()
- SequenceMatcher.ratio()
- SequenceMatcher.quick_ratio()
- SequenceMatcher.real_quick_ratio()
 
 
- SequenceMatcher 範例
- Differ Objects
- Differ Example
- A command-line interface to difflib
- ndiff 範例:
 
- textwrap--- Text wrapping and filling- wrap()
- fill()
- shorten()
- dedent()
- indent()
- TextWrapper- TextWrapper.width
- TextWrapper.expand_tabs
- TextWrapper.tabsize
- TextWrapper.replace_whitespace
- TextWrapper.drop_whitespace
- TextWrapper.initial_indent
- TextWrapper.subsequent_indent
- TextWrapper.fix_sentence_endings
- TextWrapper.break_long_words
- TextWrapper.break_on_hyphens
- TextWrapper.max_lines
- TextWrapper.placeholder
- TextWrapper.wrap()
- TextWrapper.fill()
 
 
- unicodedata--- Unicode Database
- stringprep--- Internet String Preparation
- readline--- GNU readline interface
- rlcompleter--- Completion function for GNU readline