(dirpath, iso_lang_map, min_len=25)
return ds
Args:
        dirpath (str or :class:`pathlib.Path`)
        iso_lang_map (Dict[str, str])
        min_len (int): minimum text length in *chars*

    Returns:
        List[Tuple[str, str]]
Args:
        dirpath (str or :class:`pathlib.Path`)
        iso_lang_map (Dict[str, str])
        min_len (int): minimum text length in *chars*
Args : dirpath ( str or : class : pathlib . Path ) iso_lang_map ( Dict [ str str ] ) min_len ( int ) : minimum text length in * chars *
def load_tatoeba_data(dirpath, iso_lang_map, min_len=25):
    """
    Args:
        dirpath (str or :class:`pathlib.Path`)
        iso_lang_map (Dict[str, str])
        min_len (int): minimum text length in *chars*

    Returns:
        List[Tuple[str, str]]
    """
    dirpath = textacy.utils.to_path(dirpath).resolve()
    rows = textacy.io.read_csv(
        dirpath.joinpath("sentences.csv"),
        fieldnames=["sent_id", "iso-639-3", "text"],
        delimiter="\t",
        quoting=1,
    )
    langs = set(iso_lang_map.keys())
    ds = [
        (row["text"], iso_lang_map[row["iso-639-3"]])
        for row in rows
        if row["iso-639-3"] in langs
        and itertoolz.count(char for char in row["text"] if char.isalnum()) >= min_len
    ]
    return ds
def load_tatoeba_data ( dirpath , iso_lang_map , min_len = 25 ) : dirpath = textacy . utils . to_path ( dirpath ) . resolve ( ) rows = textacy . io . read_csv ( dirpath . joinpath ( "sentences.csv" ) , fieldnames = [ "sent_id" , "iso-639-3" , "text" ] , delimiter = "\t" , quoting = 1 , ) langs = set ( iso_lang_map . keys ( ) ) ds = [ ( row [ "text" ] , iso_lang_map [ row [ "iso-639-3" ] ] ) for row in rows if row [ "iso-639-3" ] in langs and itertoolz . count ( char for char in row [ "text" ] if char . isalnum ( ) ) >= min_len ] return ds