Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:param participant: Specify the participant(s); defaults to all
participants.
:param by_files: If True (default: False), return dict(absolute-path
filename: X for that file) instead of X for all files altogether.
:rtype: list(list(str)), or dict(str: list(list(str)))
"""
fn_to_characters = self._get_character_sents(
participant=participant, exclude=exclude, sents=True
)
if by_files:
return fn_to_characters
else:
return ListFromIterables(
*(v for _, v in sorted(fn_to_characters.items()))
)
tone=tone,
initial=initial,
final=final,
jyutping=jyutping,
character=character,
pos=pos,
word_range=word_range,
sent_range=sent_range,
tagged=tagged,
sents=sents,
)
if by_files:
return fn_to_results
else:
return ListFromIterables(
*(v for _, v in sorted(fn_to_results.items()))
)
def __init__(self, *iterables):
super(ListFromIterables, self).__init__()
self.input_iterables = iterables
self.from_iterables()
:param participant: Specify the participant(s); defaults to all
participants.
:param by_files: If True (default: False), return dict(absolute-path
filename: X for that file) instead of X for all files altogether.
:rtype: list(str), or dict(str: list(str))
"""
fn_to_jyutpings = self._get_jyutping_sents(
participant=participant, exclude=exclude, sents=False
)
if by_files:
return fn_to_jyutpings
else:
return ListFromIterables(
*(v for _, v in sorted(fn_to_jyutpings.items()))
)
:param participant: Specify the participant(s); defaults to all
participants.
:param by_files: If True (default: False), return dict(absolute-path
filename: X for that file) instead of X for all files altogether.
:rtype: list(list(str)), or dict(str: list(list(str)))
"""
fn_to_jyutpings = self._get_jyutping_sents(
participant=participant, exclude=exclude, sents=True
)
if by_files:
return fn_to_jyutpings
else:
return ListFromIterables(
*(v for _, v in sorted(fn_to_jyutpings.items()))
)
:param participant: Specify the participant(s); defaults to all
participants.
:param by_files: If True (default: False), return dict(absolute-path
filename: X for that file) instead of X for all files altogether.
:rtype: list(str), or dict(str: list(str))
"""
fn_to_characters = self._get_character_sents(
participant=participant, exclude=exclude, sents=False
)
if by_files:
return fn_to_characters
else:
return ListFromIterables(
*(v for _, v in sorted(fn_to_characters.items()))
)