anemoi 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/anemoi CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # coding: utf-8
2
3
 
3
4
  require "pp"
4
5
  require "date"
@@ -12,4 +13,19 @@ end
12
13
  $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
13
14
  require "anemoi"
14
15
 
16
+ module Horai
17
+ class JaJP < Parser
18
+ def normalize(text)
19
+ normalized = text
20
+ normalized = normalized.tr(NORMALIZE_FROM, NORMALIZE_TO)
21
+ digits = "一二三四五六七八九十百千"
22
+ classes = "万億兆"
23
+ normalized.gsub!(/[#{digits}][#{digits}#{classes}]*/) do |match|
24
+ JaNumber::JaNumberParser::parse(match)
25
+ end
26
+ return normalized
27
+ end
28
+ end
29
+ end
30
+
15
31
  pp Anemoi.get_weather(text)
@@ -197,7 +197,7 @@ module Anemoi
197
197
  end
198
198
 
199
199
  def canonical_city(text)
200
- text.gsub!("東京都","東京")
200
+ text = text.gsub("東京都","東京")
201
201
  text
202
202
  end
203
203
  end
@@ -1,3 +1,3 @@
1
1
  module Anemoi
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anemoi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: