quadrismegistus / prosodic

Prosodic: a metrical-phonological parser, written in Python. For English and Finnish, with flexible language support.
http://quadrismegistus.github.io/prosodic/
GNU General Public License v3.0
276 stars 42 forks source link

AttributeError: module 'regex' has no attribute 'Pattern' #33

Closed aletote closed 3 years ago

aletote commented 3 years ago

Hi, I'm getting this error on my Macbook Pro, can you help me?

Python 3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import prosodic as p text = p.Text("Shall I compare thee to a summer's day?") Traceback (most recent call last): File "", line 1, in File "/Users/ale/Desktop/prosodic/prosodic/lib/Text.py", line 85, in init self.init_text(lines) File "/Users/ale/Desktop/prosodic/prosodic/lib/Text.py", line 319, in init_text newwords=self.dict.get(tok,stress_ambiguity=self.stress_ambiguity) File "/Users/ale/Desktop/prosodic/prosodic/lib/Dictionary.py", line 551, in get words=self.getprep(word,config=self.config) File "/Users/ale/Desktop/prosodic/prosodic/dicts/en/english.py", line 100, in get sylls_text = syllabify_orth(token,num_sylls=num_sylls) File "/Users/ale/Desktop/prosodic/prosodic/dicts/en/english.py", line 354, in syllabify_orth return syllabify_orth_with_nltk(token,num_sylls=num_sylls) File "/Users/ale/Desktop/prosodic/prosodic/dicts/en/english.py", line 337, in syllabify_orth_with_nltk from nltk.tokenize import SyllableTokenizer File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nltk/init.py", line 137, in from nltk.text import * File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nltk/text.py", line 29, in from nltk.tokenize import sent_tokenize File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nltk/tokenize/init.py", line 65, in from nltk.tokenize.casual import TweetTokenizer, casual_tokenize File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nltk/tokenize/casual.py", line 272, in class TweetTokenizer: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/nltk/tokenize/casual.py", line 357, in TweetTokenizer def WORD_RE(self) -> regex.Pattern: AttributeError: module 'regex' has no attribute 'Pattern'

tomaarsen commented 3 years ago

@aletote Please update your regex module to a version above 2021.8.3:

pip install -U regex

See https://github.com/nltk/nltk/pull/2834 for more information. I'll close this issue as this should be fixed now. Feel free to respond if it hasn't been.