Class String
In: lib/musicextras/utils.rb
Parent: Object

Methods

Constants

MANGLE_CUTOFF_POINT = 22   Specifies the cutoff point for mangle() This should be, at the maximum, no more than the length of an mp3 tag, since we will often be getting our information from them. Shortening it further may produce better results in some cases, but it is probably okay how it is

Public Instance methods

Removes everything except word characters and shortens string to MANGLE_CUTOFF_POINT. This is used to match song titles when spaces, punctuation etc may be different.

remove_pronouns
Set to true if prefixing pronouns should be removed.

Defaults to false.

Removes extra blank lines that may have shown up from HTML conversions. Returns the new text

text
the text to convert

XXX: May not always do what we want. Report any weirdness

Converts a string of html to text

  • Turns ^Ms and <br>s into newlines
  • Replaces html entities with their expected value
  • Removes html tags

Converts text from encoding to utf8. encoding is read from readline’s Locale.codeset if available. Otherwise it defaults to iso-8859-1. If encoding is defined, it overrules readline’s Locale.codeset

[Validate]