cdimascio / py-readability-metrics

📗 Score text readability using a number of formulas: Flesch-Kincaid Grade Level, Gunning Fog, ARI, Dale Chall, SMOG, and more
https://py-readability-metrics.readthedocs.io/en/latest/
MIT License
352 stars 59 forks source link

DeprecationWarning: invalid escape sequence '\134/' #35

Open reefwing opened 6 months ago

reefwing commented 6 months ago

I am receiving the following deprecation warning (macOS, Python v3.11, py-readability-metrics v1.4.5):

.../readability/text/analyzer.py:132: DeprecationWarning: invalid escape sequence '\134/'
  match = re.match('^[.,\134/#!$%\134'\134^&\134*;:{}=\134-_`~()]$', token)

I think the problem is that the character \134 is supposed to represent an escape sequence, but it's invalid in this context. This could be fixed using something like:

  match = re.match(r'^[.,\\\/#!$%\^&\*;:{}=\-_`~()]$', token)