Package jazzparser :: Package taggers :: Package segmidi :: Module base
[hide private]
[frames] | no frames]

Source Code for Module jazzparser.taggers.segmidi.base

 1  """Base classes for segmidi taggers. 
 2   
 3  """ 
 4  """ 
 5  ============================== License ======================================== 
 6   Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding 
 7    
 8   This file is part of The Jazz Parser. 
 9    
10   The Jazz Parser is free software: you can redistribute it and/or modify 
11   it under the terms of the GNU General Public License as published by 
12   the Free Software Foundation, either version 3 of the License, or 
13   (at your option) any later version. 
14    
15   The Jazz Parser is distributed in the hope that it will be useful, 
16   but WITHOUT ANY WARRANTY; without even the implied warranty of 
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18   GNU General Public License for more details. 
19    
20   You should have received a copy of the GNU General Public License 
21   along with The Jazz Parser.  If not, see <http://www.gnu.org/licenses/>. 
22   
23  ============================ End license ====================================== 
24   
25  """ 
26  __author__ = "Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>"  
27   
28  from jazzparser import settings 
29  from jazzparser.taggers.models import ModelTagger 
30  from jazzparser.utils.options import ModuleOption 
31   
32 -class SegmidiTagger(ModelTagger):
33 """ 34 Base class for segmented MIDI taggers. 35 36 Inherits from L{jazzparser.taggers.models.ModelTagger}, so subclasses 37 should implement the abstract methods of this. 38 39 """ 40 COMPATIBLE_FORMALISMS = [ 41 'music_halfspan', 42 ] 43 INPUT_TYPES = ['segmidi'] 44
45 - def __init__(self, *args, **kwargs):
46 super(SegmidiTagger, self).__init__(*args, **kwargs)
47
48 - def get_signs(self, offset=0):
49 raise NotImplementedError, "called base SegmidiTagger's get_signs()"
50
51 - def get_word(self, index):
52 return "<midi segment %d>" % index
53
54 - def get_string_input(self):
55 return [str(i) for i in range(self.input_length)]
56