def write_oneline_noun_no_noun(oneline): if len(oneline) < 3: return for i, j, k in zip(range(0, len(oneline) - 2), range(1, len(oneline) - 1), range(2, len(oneline))): n1, p, n2 = oneline[i], oneline[j], oneline[k] if NLP33.is_noun(n1) and is_particle_no(p) and NLP33.is_noun(n2): print(n1["surface"], p["surface"], n2["surface"])
def collect_nouns_with_index(oneline): nouns_with_index = [] for i in range(0, len(oneline)): if NLP33.is_noun(oneline[i]): nouns_with_index.append([i, oneline[i]]) return nouns_with_index