use itertools.chain

This commit is contained in:
Joshua Chin 2015-07-07 14:54:19 -04:00
parent bbdc064528
commit 6a40e63060

View File

@ -4,6 +4,7 @@ import langcodes
import msgpack import msgpack
import re import re
import gzip import gzip
import itertools
import pathlib import pathlib
import random import random
import logging import logging
@ -226,8 +227,7 @@ def iter_wordlist(lang, wordlist='combined'):
with the same rounded frequency, appearing in alphabetical order within with the same rounded frequency, appearing in alphabetical order within
each band. each band.
""" """
for sublist in get_frequency_list(lang, wordlist): return itertools.chain(*get_frequency_list(lang, wordlist))
yield from sublist
def half_harmonic_mean(a, b): def half_harmonic_mean(a, b):