1
の間にある単語が「hello bla bla bla world」(どこでも別の数のblaを表示できます)の正規表現を書くにはどうすればいいですか?手動で書く必要がありますかIS_ALPHA ?あなたが本当にあなたの間にIS_ALPHA
単語の数を気にしない場合、私はのように見える*
数量詞を、使用することができます...非重要な用語の進出数にSpacy allowable terms with allowed terms with
import spacy
from spacy.matcher import Matcher
from spacy.attrs import POS, LOWER, IS_PUNCT, IS_ALPHA
nlp = spacy.load('en')
matcher = Matcher(nlp.vocab)
text=u"hello bla bla bla world"
matcher.add_pattern("my regex1", [{LOWER: "hello"}, {IS_ALPHA: True}, {LOWER: "world"}])
doc = nlp(text)
matches = matcher(doc)
print(matches)