-import language_models
import sys
from functools import lru_cache
+from support.language_models import Pwords
+
sys.setrecursionlimit(1000000)
@lru_cache()
"""
if not text: return []
candidates = ([first]+segment(rest) for first,rest in splits(text))
- return max(candidates, key=language_models.Pwords)
+ return max(candidates, key=Pwords)
def splits(text, L=20):
"""Return a list of all possible (first, rest) pairs, len(first)<=L.