ukeGeeks.chordParser Class
Reads an HTML (text) block looking for chords in format: [Emaj7] Returns the HTML block with wrapped chords: <code><strong><em>
Methods
_encloseChords
-
text
-
chords
Returns the input string having replaced all of the "bracketed chord names" (i.e. [D7]) with HTML marked-up version (i.e. <code><strong>[<em>D7</em>]</strong></code>)
Parameters:
-
text
String -
chords
StringArray
Returns:
_findChords
-
text
Returns an array of all of the unique bracket chord names. So even if [D7] appears a dozen times you'll only see it once in this list.
Parameters:
-
text
StringCPM Text Block to be parsed
Returns:
_packChords
-
text
Looks for consecutive chords and strips the whitespace between them -- thus "packing" the chords against each other with only a single space separating them.
Parameters:
-
text
String
Returns:
getChords
()
Array-chords
Getter method for _chords
Returns:
init
()
Void
Again this is a constructor replacement. Just here for consistency. Does nothing.
Returns:
parse
-
text
This does all of the work -- it's a Wrapper method that calls all of this classes other (private) methods in correct order.
Parameters:
-
text
StringCPM Text Block to be parsed
Returns:
Properties
_public
Object
attach public members to this object