music-text-normalization 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72adcbbf5294b8e0a5a661bc877aa586cc17fdf3
4
- data.tar.gz: 8e8dc189c6dc1a92fcb06280bd4ddd6a6051619d
3
+ metadata.gz: 96eb8c787372d979bbf78b65941f7022c1ed4e52
4
+ data.tar.gz: 80a9fa1c8455a2c9a4393e6bd6b5dcfdfd5401f9
5
5
  SHA512:
6
- metadata.gz: a542c9e081fe5a87894299cabc95d26436f6419585cf28d5676179e0fe2ae5493e535200469a74f9f2c15f73919d3d378925b5aadb7342c757d92537dd9c2813
7
- data.tar.gz: 2b6b56e4e46be681e25dac4efbd9c19887440002648ee12a99731b04b63c305b11bae28716e6531be3e9268128098334df86a068ef716859aa0af1298b2079b4
6
+ metadata.gz: 2046e58b2d2bfb0a354ed2cdb7866c060d749c20a14100304c52813d22034afbba5a0326721daacbdbede3f4399c98cf0f1fda3dcbefbb7b3893c85a5c587eeb
7
+ data.tar.gz: af6f0953813dbb0a10e03c8a1db0f604830ee99e1841376108e6665e8f3132d4599c993719f2381476c8523da0cc3571384d19918a07486a76cb70ce992a2e06
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ before_install:
3
+ - gem update bundler
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - 2.1.0
8
+ - 2.2.0
9
+ - 2.3.0
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # music-text-normalization
1
+ # music-text-normalization [![Build Status](https://secure.travis-ci.org/youpy/music-text-normalization.png)](http://secure.travis-ci.org/youpy/music-text-normalization)
2
2
 
3
3
  A library for normalizing music related texts
4
4
 
@@ -21,6 +21,8 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```ruby
24
+ require 'music/text/normalization'
25
+
24
26
  include Music::Text::Normalization
25
27
 
26
28
  normalize_artist_name('Run-D.M.C.') # => 'run_dmc'
data/Rakefile CHANGED
@@ -1,2 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ require 'rspec/core'
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec) do |spec|
6
+ spec.pattern = FileList['spec/**/*_spec.rb']
7
+ end
8
+
9
+ task :default => :spec
@@ -1,10 +1,13 @@
1
+ # coding: utf-8
1
2
  require "music/text/normalization/version"
2
3
 
3
4
  module Music
4
5
  module Text
5
6
  module Normalization
6
7
  def normalize_artist_name(text)
7
- lowercase_name = text.downcase
8
+ lowercase_name = text.
9
+ tr("0-9A-Za-z", "0-9A-Za-z").
10
+ downcase
8
11
 
9
12
  case lowercase_name
10
13
  when 'bruce springsteen and the e street band'
@@ -21,7 +24,7 @@ module Music
21
24
  lowercase_name.
22
25
  gsub(/['\.]/, '').
23
26
  sub(/^(a|an|the)\ +/, '').
24
- gsub(/[^a-z0-9]+/, '_').
27
+ gsub(/[^a-z0-9\p{Hiragana}\p{Katakana}ー-一-龠々]+/, '_').
25
28
  sub(/^_/, '').sub(/_$/, '')
26
29
  end
27
30
  end
@@ -1,7 +1,7 @@
1
1
  module Music
2
2
  module Text
3
3
  module Normalization
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["youpy@buycheapviagraonlinenow.com"]
11
11
  spec.summary = %q{A library for normalizing music related texts}
12
12
  spec.description = %q{A library for normalizing music related texts}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/youpy/music-text-normalization"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require File.dirname(__FILE__) + '/../../spec_helper'
2
3
 
3
4
  include Music::Text
@@ -17,6 +18,9 @@ describe Normalization do
17
18
  expect(Normalization.normalize_artist_name("A New Found Glory")).to eql('new_found_glory')
18
19
  expect(Normalization.normalize_artist_name("The Beatles")).to eql('the_beatles')
19
20
  expect(Normalization.normalize_artist_name("The Verve")).to eql('the_verve')
21
+ expect(Normalization.normalize_artist_name("ヒカシュー")).to eql('ヒカシュー')
22
+ expect(Normalization.normalize_artist_name("水曜日のカンパネラ")).to eql('水曜日のカンパネラ')
23
+ expect(Normalization.normalize_artist_name("the Beatles")).to eql('the_beatles')
20
24
  end
21
25
  end
22
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: music-text-normalization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - youpy
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - .gitignore
63
63
  - .rspec
64
+ - .travis.yml
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md
@@ -70,7 +71,7 @@ files:
70
71
  - music-text-normalization.gemspec
71
72
  - spec/music/text/normalization_spec.rb
72
73
  - spec/spec_helper.rb
73
- homepage: ''
74
+ homepage: https://github.com/youpy/music-text-normalization
74
75
  licenses:
75
76
  - MIT
76
77
  metadata: {}