pattern icon indicating copy to clipboard operation
pattern copied to clipboard

In Python 2.7, taxonomy based search doesn't work

Open IntelliMind opened this issue 6 years ago • 0 comments

from pattern.search import search, taxonomy, Classifier
from pattern.en import parsetree

for flower in ("rose", "lily", "daisy", "daffodil", "begonia"):
      taxonomy.append(flower, type="flower")

tree = parsetree("A field of white daffodils.", lemmata=True) 
result = search("FLOWER", t)                              # TypeError: can't compile 'str' object

The search function fails in 2.7, whereas it works in 3.6.4

IntelliMind avatar Jan 30 '19 12:01 IntelliMind