Loading tutorials
str is a sequence of Unicode code points. The previous chapter covered code points, encodings, and what counts as a character. Here we use that to answer a narrower question: how should7 min read"caf\u00e9" and "cafe\u0301" compare equal. Here you will learn what the two "K" forms do beyond that, when they help, and which info6 min readunicodedata.normalize rewrites a string without changing how it looks. Accent removal is built on NFD, so that is the one idea you need to keep in mind.6 min readunicodedata.normalize and case folding with str.casefold(). Here we deal with the last filtering7 min readcasefold(), the four Unicode normalisation forms, accent stripping with unicodedata.combining, and stop word lists. It covers how those steps interact. You will learn which steps must come before which, how to build a pipe5 min readlower() and casefold(). You should know what NFC, NFD, NFKC, and NFKD do. You should be able to strip combining accents with unicodedata. You should also be comfortable with a simpl7 min read