File size: 409 Bytes
21d29cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import re


PERSIAN_ALPHA = "ءآئابتثجحخدذرزسشصضطظعغفقلمنهوپچژکگیە"  # noqa: E501
PERSIAN_DIGIT = "۰۱۲۳۴۵۶۷۸۹"


ZWNJ = "\u200c"
PUNK = '\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_\`\{\|\}\~\«\»\؟\:\×\٬\٫\﷼\٪\،'

PERSIAN = (
    "a-zA-Z0-9" +
    PERSIAN_ALPHA +
    PERSIAN_DIGIT +
    ZWNJ +
    PUNK
)

PERSIAN_REGEX = r"[^" + PERSIAN + "+]"