Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
parsers.parser_tools.ParserTools Class Reference

This class encapsulates some common static methods used by various parsers. More...

Inheritance diagram for parsers.parser_tools.ParserTools:

Static Public Member Functions

def include_seg
 Checks whether or not a given segment passes all filters in a given list. More...
 
def pick_rand_segs
 Picks n random segments from a list (without duplicates). More...
 
def pick_contiguous_segs
 Picks n consecutive elements from a list. More...
 
def hacked_pick_rand_segs
 

Detailed Description

This class encapsulates some common static methods used by various parsers.

Definition at line 6 of file parser_tools.py.

Member Function Documentation

def parsers.parser_tools.ParserTools.hacked_pick_rand_segs (   n,
  segs,
  filename 
)
static

Definition at line 56 of file parser_tools.py.

def parsers.parser_tools.ParserTools.include_seg (   seg,
  seg_filters 
)
static

Checks whether or not a given segment passes all filters in a given list.

The filters are run in such a way that any changes they make on the segment or it's utterances are made permanent.

Parameters
seg(Segment) the segment to put through the filters
seg_filters(list) list of SegFilter objects
Returns
(boolean) True if segment passed all filters, False otherwise

Definition at line 12 of file parser_tools.py.

def parsers.parser_tools.ParserTools.pick_contiguous_segs (   n,
  segs 
)
static

Picks n consecutive elements from a list.

Parameters
n(int) number of segments to pick from the given list
segs(list) List of Segment objects to draw from
Returns
(list) List of n consecutive Segment objects. If returned list is empty, there were less than n segments in segs.

Definition at line 47 of file parser_tools.py.

def parsers.parser_tools.ParserTools.pick_rand_segs (   n,
  segs 
)
static

Picks n random segments from a list (without duplicates).

Parameters
n(int) number of segments to pick from the given list
segs(list) List of Segment objects to pick from
Returns
(list) List of picked Segment objects. If returned list is empty, there were less than n segments in segs.

Definition at line 30 of file parser_tools.py.


The documentation for this class was generated from the following file: