perambulate 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.idea/codeStyleSettings.xml +9 -0
- data/Gemfile.lock +1 -1
- data/README +4 -2
- data/lib/perambulate.rb +11 -13
- data/lib/perambulate/designations.rb +1 -0
- data/lib/perambulate/parser/parser.rb +2 -1
- data/lib/perambulate/version.rb +1 -1
- metadata +2 -1
data/Gemfile.lock
CHANGED
data/README
CHANGED
data/lib/perambulate.rb
CHANGED
@@ -4,21 +4,19 @@ require "perambulate/lexer/aussie_lexer"
|
|
4
4
|
require "perambulate/parser/parser"
|
5
5
|
require "perambulate/designations"
|
6
6
|
|
7
|
+
module Perambulate
|
7
8
|
|
8
|
-
|
9
|
+
@@configuration = {:default_parser => "Australian"}
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
return @@configuration
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.configure(&block)
|
17
|
-
yield @@configuration
|
18
|
-
end
|
11
|
+
def self.config
|
12
|
+
@@configuration
|
13
|
+
end
|
19
14
|
|
20
|
-
|
21
|
-
|
22
|
-
end
|
15
|
+
def self.configure(&block)
|
16
|
+
yield @@configuration
|
23
17
|
end
|
24
18
|
|
19
|
+
def self.create_address(address_string)
|
20
|
+
address = Perambulate::Parser.new().parse(address_string)
|
21
|
+
end
|
22
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "whittle"
|
2
|
+
require "lib/perambulate/designations"
|
2
3
|
|
3
4
|
module Perambulate
|
4
5
|
class Parser < Whittle::Parser
|
@@ -9,7 +10,7 @@ module Perambulate
|
|
9
10
|
rule(:unit_symbol => /Unit|Num|Number|No/i)
|
10
11
|
rule(:unit_separator => /\/|-|,/)
|
11
12
|
rule(:street_separator => /,/)
|
12
|
-
rule(:designation =>
|
13
|
+
rule(:designation => Perambulate::Designations::PARSELIST)
|
13
14
|
|
14
15
|
rule(:word => /[a-zA-Z]+/)
|
15
16
|
|
data/lib/perambulate/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perambulate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -115,6 +115,7 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
+
- .idea/codeStyleSettings.xml
|
118
119
|
- CONTRIBUTING.md
|
119
120
|
- Gemfile
|
120
121
|
- Gemfile.lock
|