numru-units 1.7.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/ChangeLog +31 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +2 -2
- data/README.rdoc +232 -0
- data/Rakefile +1 -38
- data/install.rb +4 -31
- data/lib/numru/units.rb +2 -3505
- data/lib/numru/units/units.rb +3099 -0
- data/lib/numru/units/version.rb +5 -0
- data/numru-units.gemspec +25 -0
- data/src/Makefile +3 -5
- data/src/dcunits.txt +26 -5
- data/src/lex.rb +1 -1
- data/src/rules.rb +2 -2
- data/src/test.rb +8 -8
- data/src/units.racc +422 -419
- data/src/units.rb +648 -1053
- data/src/utab.rb +417 -416
- data/src/version.rb +2 -0
- metadata +48 -63
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b9aa6ff8758cccbbc3bac5299c946c1cafd1de45
|
4
|
+
data.tar.gz: dffe312aefd1531fc4e2a4a355b1e1c572b35d07
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e065c34277db2b4a6913a45b9107503e4be0e4777945e264fe384e65c7ce60f42ebad84794dc0b9af44c06ec7ac30f1db88db1966aa86c95bedc52e5f0a8b0d8
|
7
|
+
data.tar.gz: 2bac48e91ab581506aa81e8b90413d0b676595cd7442acc020596b779e5e2e259e510e15c9a32703df5866d1d33bcf8957fb24cdf15a9902b0efe5f30eab0c86
|
data/.gitignore
ADDED
data/ChangeLog
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
Tue Feb 17 2015 T Horinouchi
|
2
|
+
* version 1.9 released ((cvs) tag: numru-units-1_9)
|
3
|
+
Fri Jan 23 2015 T Horinouchi
|
4
|
+
* dcunits.txt
|
5
|
+
* added a description as comments at the beginning of the file
|
6
|
+
* added units: cd, candela
|
7
|
+
* changed the mode of the following units
|
8
|
+
* S to N: kg, %, permil, d
|
9
|
+
* S to P: percent
|
10
|
+
* added a meteorological unit gpm (mode: N, definition: m).
|
11
|
+
* LICENSE.txt: updated (years)
|
12
|
+
* src/version.rb: added
|
13
|
+
* src/Makefile: updated to use version.rb
|
14
|
+
Tue Jan 20 2015 T Horinouchi
|
15
|
+
* src/lex.rb: Regexp changed: UTC --> (UTC|Z)
|
16
|
+
Mon Jan 12 2015 T Horinouchi
|
17
|
+
* version 1.8 released ((cvs) tag: numru-units-1_8)
|
18
|
+
Mon Jan 12 2015 T Horinouchi <-- S Nishizawa [dennou-ruby:003805] and
|
19
|
+
T Koshiro [dennou-ruby:003806] (files to patch was corrected, though)
|
20
|
+
* src/rules.rb: Update to support ruby 2.1 or later
|
21
|
+
(l.10: origin_exp { yyaccept; } --> origin_exp { val[0] })
|
22
|
+
and a cleaner treatment of the NumRu:: wrapper
|
23
|
+
(l.1: class Units --> class NumRu::Units).
|
24
|
+
* src/test.rb: updated (handling of "" and numeric expressions:
|
25
|
+
float --> rational)
|
26
|
+
* src/Makefile: updated in response to the change in rule.rb
|
27
|
+
* install.rb: updated (ruby 1.6 support abondoned)
|
28
|
+
* src/units.racc, src/units.rb, lib/numru/units.rb: regenreated
|
29
|
+
|
30
|
+
Fri Mar 14 2014 T Koshiro < M Nakano [dennou-ruby:003646]
|
31
|
+
* install.rb: for Ruby 2.x
|
1
32
|
Thu Aug 4 2011 T Horinouchi
|
2
33
|
* version 1.7 released ((cvs) tag: numru-units-1_7)
|
3
34
|
* LICENSE.txt: added (BSD 2-clause)
|
data/Gemfile
ADDED
data/LICENSE.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
NumRu::Units is copyrighted free software by
|
1
|
+
NumRu::Units is copyrighted free software by
|
2
2
|
GFD Dennou Club (http://www.gfd-dennou.org/).
|
3
3
|
|
4
|
-
Copyright
|
4
|
+
Copyright 2004-2015 (C) GFD Dennou Club
|
5
5
|
(http://www.gfd-dennou.org/) All rights reserved.
|
6
6
|
|
7
7
|
Redistribution and use in source and binary forms, with or without
|
data/README.rdoc
ADDED
@@ -0,0 +1,232 @@
|
|
1
|
+
=begin
|
2
|
+
=class NumRu::Units
|
3
|
+
|
4
|
+
* ((<Overview>))
|
5
|
+
* ((<Installation>))
|
6
|
+
* ((<Usage Examples>))
|
7
|
+
* ((<Class Methods>))
|
8
|
+
* ((<Instance Methods>))
|
9
|
+
* ((<Supported units|URL:http://ruby.gfd-dennou.org/products/numru-units/doc/dcunits.txt>)) (Plural form allowed if the second field is "P")
|
10
|
+
|
11
|
+
==Overview
|
12
|
+
|
13
|
+
A class of units of physical quantities.
|
14
|
+
|
15
|
+
This class covers most functionality of UNIDATA's
|
16
|
+
((<UDUNITS Library|URL:http://www.unidata.ucar.edu/packages/udunits/>)),
|
17
|
+
however, with a more sophisticated handling of string expressions.
|
18
|
+
|
19
|
+
UDUNITS always decomposes units into the four base units and discards
|
20
|
+
the original string expressions. Therefore, 'hPa' always becomes
|
21
|
+
'100 kg.m-1.sec-1', and 'day' always becomes '86400 sec'. On the other
|
22
|
+
hand, this library tries to keep the original expressions as much as
|
23
|
+
possible by default, while allowing partial to complete decompositions
|
24
|
+
if needed.
|
25
|
+
|
26
|
+
==Installation
|
27
|
+
|
28
|
+
Move to the top directly of this library (where you find
|
29
|
+
the file install.rb). Then, type in the following:
|
30
|
+
|
31
|
+
% ruby install.rb
|
32
|
+
|
33
|
+
==Usage Examples
|
34
|
+
|
35
|
+
Here is an example using the "irb" interactive shell ("(('%'))" is the
|
36
|
+
command prompt, and "(('>>'))" is the irb prompt -- Type in those after it
|
37
|
+
to test. "(('=>'))" shows the result.):
|
38
|
+
|
39
|
+
% irb --simple-prompt
|
40
|
+
>> require "numru/units"
|
41
|
+
=> true
|
42
|
+
>> un1 = NumRu::Units.new('kg.m2/s')
|
43
|
+
=> Units{kg.m2/s}
|
44
|
+
>> un2 = NumRu::Units.new('g.m')
|
45
|
+
=> Units{g.m}
|
46
|
+
>> un3 = un1 / un2
|
47
|
+
=> Units[Multi[Pow[Name[g], Number[-1]], Name[kg], Pow[Name[m], Number[1]], Pow[Name[s], Number[-1]]]]
|
48
|
+
>> un1.to_s
|
49
|
+
=> "kg.m2/s"
|
50
|
+
>> un2.to_s
|
51
|
+
=> "g.m"
|
52
|
+
>> un3.to_s
|
53
|
+
=> "g-1 kg.m1 s-1"
|
54
|
+
>> un3.reduce5
|
55
|
+
=> Units[Multi[Number[1000], Pow[Name[m], Number[1]], Pow[Name[s], Number[-1]]]]
|
56
|
+
>> un3.to_s
|
57
|
+
=> "1000 m1 s-1"
|
58
|
+
|
59
|
+
Note the difference between the results of (('un3.to_s'))
|
60
|
+
before and after (('un3.reduce5')),
|
61
|
+
where the former retains the literal expression
|
62
|
+
of each atomic unit, while the latter does the maximum reduction.
|
63
|
+
You can change the default behavior by using the class method
|
64
|
+
(('reduce_level=')):
|
65
|
+
|
66
|
+
>> NumRu::Units.reduce_level = 5
|
67
|
+
=> :reduce5
|
68
|
+
>> un3.to_s
|
69
|
+
=> "1000 m1 s-1"
|
70
|
+
|
71
|
+
Note that you can eliminate the prefix (('NumRu::')) by "including"
|
72
|
+
it:
|
73
|
+
|
74
|
+
>> require "numru/units"
|
75
|
+
=> true
|
76
|
+
>> include NumRu
|
77
|
+
=> Object
|
78
|
+
>> un1 = Units.new('kg.m2/s')
|
79
|
+
=> Units{kg.m2/s}
|
80
|
+
>> Units.reduce_level = 5
|
81
|
+
=> :reduce5
|
82
|
+
|
83
|
+
==Class Methods
|
84
|
+
|
85
|
+
In what follows, the prefix (('NumRu::')) is omitted for conciseness.
|
86
|
+
See ((<Usage Examples>)) on this issue.
|
87
|
+
|
88
|
+
---Units.new(string)
|
89
|
+
Constructor.
|
90
|
+
|
91
|
+
ARGUMENTS
|
92
|
+
* string (String): string expression of the units.
|
93
|
+
[factor] units; [factor] time units [since ...] (see EXAMPLES below)
|
94
|
+
|
95
|
+
RETURN VALUE
|
96
|
+
* a Units
|
97
|
+
|
98
|
+
EXAMPLE
|
99
|
+
|
100
|
+
units = Units.new('kg.m2/s')
|
101
|
+
units = Units.new('100 m')
|
102
|
+
units = Units.new('g/kg')
|
103
|
+
units = Units.new('hour since 2003-10-01 00:00:0 +0:00')
|
104
|
+
units = Units.new('hour since 2003-10-01') # same as above
|
105
|
+
units = Units.new('minutes since 2003-10-01 03:15:22.5 -6:00')
|
106
|
+
|
107
|
+
---Units[string]
|
108
|
+
|
109
|
+
Same as ((<Units.new>))
|
110
|
+
|
111
|
+
---Units.reduce_level=(n)
|
112
|
+
Set the reduction level before ((<to_s>)) is applied.
|
113
|
+
|
114
|
+
ARGUMENTS
|
115
|
+
* n (Integer): the reduction level. The default value is 4.
|
116
|
+
Use 5 if you want a full reduction. Levels lower than 4
|
117
|
+
will not be needed.
|
118
|
+
|
119
|
+
==Instance Methods
|
120
|
+
|
121
|
+
---to_s
|
122
|
+
Returns a string expression of the units.
|
123
|
+
|
124
|
+
---*(other)
|
125
|
+
Multiplies self with another units.
|
126
|
+
Applies ((<reduce4>)) to format the string expression of the result.
|
127
|
+
|
128
|
+
ARGUMENTS
|
129
|
+
* other [Units]: the other units
|
130
|
+
|
131
|
+
RETURN VALUE
|
132
|
+
* a Units
|
133
|
+
|
134
|
+
---/(other)
|
135
|
+
Divides self with another units.
|
136
|
+
Applies ((<reduce4>)) to format the string expression of the result.
|
137
|
+
|
138
|
+
ARGUMENTS
|
139
|
+
* other [Units]: the other units
|
140
|
+
|
141
|
+
RETURN VALUE
|
142
|
+
* a Units
|
143
|
+
|
144
|
+
---**(pow)
|
145
|
+
Power.
|
146
|
+
Applies ((<reduce4>)) to format the string expression of the result.
|
147
|
+
|
148
|
+
ARGUMENTS
|
149
|
+
* pow [Numeric -- Integer, Rational, or Float]
|
150
|
+
|
151
|
+
RETURN VALUE
|
152
|
+
* a Units
|
153
|
+
|
154
|
+
---==(other)
|
155
|
+
Whether the two units are the same.
|
156
|
+
('m/s' and 'm.s-1' are the same, for instance.)
|
157
|
+
|
158
|
+
---===(other)
|
159
|
+
Same as ((<==>)).
|
160
|
+
|
161
|
+
---=~(other)
|
162
|
+
Whether the two units are compatible (i.e., with the same dimensionality).
|
163
|
+
('m/s' and '10 m.s-1' are compatible, for instance.)
|
164
|
+
|
165
|
+
---reduce4
|
166
|
+
Moderately reduces the string expression of the units (destructive method).
|
167
|
+
This method preserves string expression of atomic units.
|
168
|
+
See also ((<reduce5>)).
|
169
|
+
|
170
|
+
RETURN VALUE
|
171
|
+
* self
|
172
|
+
|
173
|
+
EXAMPLE
|
174
|
+
Untis.new('hour/hour').reduce4.to_s
|
175
|
+
# => "1"
|
176
|
+
Units.new('mm/m').reduce4.to_s
|
177
|
+
# => "mm.m-1"
|
178
|
+
|
179
|
+
---reduce5
|
180
|
+
Aggressively reduces the string expression of the units (destructive method).
|
181
|
+
See also ((<reduce4>)).
|
182
|
+
|
183
|
+
RETURN VALUE
|
184
|
+
* self
|
185
|
+
|
186
|
+
EXAMPLE
|
187
|
+
Units.new('hour/hour').reduce4.to_s
|
188
|
+
# => "1"
|
189
|
+
Units.new('mm/m').reduce5.to_s
|
190
|
+
# => "0.001"
|
191
|
+
|
192
|
+
---convert(numeric, to_units)
|
193
|
+
Converts a numeric of the current units (=self) to ((|to_units|)).
|
194
|
+
|
195
|
+
ARGUMENTS
|
196
|
+
* numeric [Numeric]: the numeric to convert
|
197
|
+
* to_units [Units]: the units converted into
|
198
|
+
|
199
|
+
RETURN VALUE
|
200
|
+
* a Numeric
|
201
|
+
|
202
|
+
EXCEPTIONS
|
203
|
+
* ((|self|)) and ((|to_units|)) are incompatible.
|
204
|
+
|
205
|
+
---convert2(val, to_units)
|
206
|
+
Like ((<convert>)), but (1) accpets any Numeric-like objects, and (2)
|
207
|
+
does not raise an exception even if the two units are incompatible --
|
208
|
+
in this case, simply returns ((|val|)) (warned).
|
209
|
+
|
210
|
+
ARGUMENTS
|
211
|
+
* val [a Numeric-like class, for which (('*')) and (('+')) are defined]:
|
212
|
+
the value to convert
|
213
|
+
* to_units [Units]: the units converted into
|
214
|
+
|
215
|
+
RETURN VALUE
|
216
|
+
* an object with the same class as ((|val|)).
|
217
|
+
|
218
|
+
---factor_and_offset(to_units)
|
219
|
+
Returns the factor and offset to convert from ((|self|)) to ((|to_units|)).
|
220
|
+
The conversion is done as (('scale_factor * operand + add_offset')).
|
221
|
+
|
222
|
+
ARGUMENTS
|
223
|
+
* to_units [Units]: the units to be converted into
|
224
|
+
|
225
|
+
RETURN VALUE
|
226
|
+
* [ scale_factor, add_offset ] (a 2-element Array, where both are Numeric)
|
227
|
+
|
228
|
+
EXAMPLE
|
229
|
+
scale_factor, add_offset = from_units.factor_and_offset(to_units)
|
230
|
+
to = scale_factor * from + add_offset
|
231
|
+
|
232
|
+
=end
|
data/Rakefile
CHANGED
@@ -1,39 +1,2 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
NAME = 'numru-units'
|
4
|
-
VER = '1.7.0'
|
5
|
-
|
6
|
-
PKG_FILES = FileList[
|
7
|
-
'**',
|
8
|
-
'lib/**/*',
|
9
|
-
'doc/**/*',
|
10
|
-
'src/**/*'
|
11
|
-
]
|
12
|
-
|
13
|
-
spec = Gem::Specification.new do |s|
|
14
|
-
s.name = NAME
|
15
|
-
s.version = VER
|
16
|
-
s.authors = ["Eizi Toyoda","Takeshi Horinouchi"]
|
17
|
-
s.email = ['eriko@gfd-dennou.org']
|
18
|
-
s.homepage = 'http://www.gfd-dennou.org/arch/ruby/products/numru-units/'
|
19
|
-
s.licenses = ["Takeshi Horinouchi", "GFD Dennou Club"]
|
20
|
-
s.platform = Gem::Platform::RUBY
|
21
|
-
s.summary = %q{Class to handle units of physical quantities}
|
22
|
-
s.description = %q{This is a class to handle units of physical quantities. It covers most functionality of UNIDATA's UDUNITS Library, however, with a more sophisticated handling of string expressions. See the documentation for more infomation.}
|
23
|
-
|
24
|
-
s.files = PKG_FILES.to_a
|
25
|
-
s.require_paths = ['lib']
|
26
|
-
#s.test_files = Dir.glob("test/*")
|
27
|
-
#s.has_rdoc = true
|
28
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.6")
|
29
|
-
#s.add_runtime_dependency(%q<narray>, [">= 0"])
|
30
|
-
#s.add_runtime_dependency(%q<narray_miss>, [">= 0"])
|
31
|
-
#s.extra_rdoc_files = ['README']
|
32
|
-
|
33
|
-
#s.extensions << "install.rb"
|
34
|
-
end
|
35
|
-
|
36
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
37
|
-
pkg.gem_spec = spec
|
38
|
-
pkg.need_tar = true
|
39
|
-
end
|
data/install.rb
CHANGED
@@ -1,27 +1,8 @@
|
|
1
1
|
require 'rbconfig'
|
2
2
|
require 'find'
|
3
|
-
include
|
3
|
+
include RbConfig
|
4
4
|
|
5
|
-
|
6
|
-
if $rb_18
|
7
|
-
require 'fileutils'
|
8
|
-
else
|
9
|
-
require 'ftools'
|
10
|
-
end
|
11
|
-
|
12
|
-
=begin
|
13
|
-
$version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
14
|
-
$libdir = File.join(CONFIG["libdir"], "ruby", $version)
|
15
|
-
# $archdir = File.join($libdir, CONFIG["arch"])
|
16
|
-
$site_libdir = $:.find {|x| x =~ /site_ruby$/}
|
17
|
-
if !$site_libdir
|
18
|
-
$site_libdir = File.join($libdir, "site_ruby")
|
19
|
-
elsif Regexp.compile($site_libdir) !~ Regexp.quote($version)
|
20
|
-
$site_libdir = File.join($site_libdir, $version)
|
21
|
-
end
|
22
|
-
|
23
|
-
default_destdir = $site_libdir
|
24
|
-
=end
|
5
|
+
require 'fileutils'
|
25
6
|
|
26
7
|
default_destdir = CONFIG["sitelibdir"]
|
27
8
|
|
@@ -40,20 +21,12 @@ def install_rb(srcdir, destdir)
|
|
40
21
|
for f in dir
|
41
22
|
next if f == "."
|
42
23
|
next if f == "CVS"
|
43
|
-
|
44
|
-
FileUtils.makedirs(File.join(destdir, f))
|
45
|
-
else
|
46
|
-
File::makedirs(File.join(destdir, f))
|
47
|
-
end
|
24
|
+
FileUtils.makedirs(File.join(destdir, f))
|
48
25
|
end
|
49
26
|
for f in path
|
50
27
|
next if (/\~$/ =~ f)
|
51
28
|
next if (/^\./ =~ File.basename(f))
|
52
|
-
|
53
|
-
FileUtils.install(File.join("lib", f), File.join(destdir, f), {:mode => 0644, :verbose => true})
|
54
|
-
else
|
55
|
-
File::install(File.join("lib", f), File.join(destdir, f), 0644, true)
|
56
|
-
end
|
29
|
+
FileUtils.install(File.join("lib", f), File.join(destdir, f), {:mode => 0644, :verbose => true})
|
57
30
|
end
|
58
31
|
end
|
59
32
|
|
data/lib/numru/units.rb
CHANGED
@@ -1,3505 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# This file is automatically generated by racc 1.4.5
|
4
|
-
# from racc grammer file "units.racc".
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# tmp.rb: generated by racc (runtime embedded)
|
8
|
-
#
|
9
|
-
###### racc/parser.rb begin
|
10
|
-
unless $".index 'racc/parser.rb'
|
11
|
-
$".push 'racc/parser.rb'
|
12
|
-
|
13
|
-
#
|
14
|
-
# $Id: units.rb,v 1.19 2011-08-03 09:16:07 horinout Exp $
|
15
|
-
#
|
16
|
-
# Copyright (c) 1999-2005 Minero Aoki
|
17
|
-
#
|
18
|
-
# This program is free software.
|
19
|
-
# You can distribute/modify this program under the same terms of ruby.
|
20
|
-
#
|
21
|
-
# As a special exception, when this code is copied by Racc
|
22
|
-
# into a Racc output file, you may use that output file
|
23
|
-
# without restriction.
|
24
|
-
#
|
25
|
-
|
26
|
-
unless defined?(NotImplementedError)
|
27
|
-
NotImplementedError = NotImplementError
|
28
|
-
end
|
29
|
-
|
30
|
-
module Racc
|
31
|
-
class ParseError < StandardError; end
|
32
|
-
end
|
33
|
-
unless defined?(::ParseError)
|
34
|
-
ParseError = Racc::ParseError
|
35
|
-
end
|
36
|
-
|
37
|
-
module Racc
|
38
|
-
|
39
|
-
unless defined?(Racc_No_Extentions)
|
40
|
-
Racc_No_Extentions = false
|
41
|
-
end
|
42
|
-
|
43
|
-
class Parser
|
44
|
-
|
45
|
-
Racc_Runtime_Version = '1.4.5'
|
46
|
-
Racc_Runtime_Revision = '$Revision: 1.19 $'.split[1]
|
47
|
-
|
48
|
-
Racc_Runtime_Core_Version_R = '1.4.5'
|
49
|
-
Racc_Runtime_Core_Revision_R = '$Revision: 1.19 $'.split[1]
|
50
|
-
begin
|
51
|
-
require 'racc/cparse'
|
52
|
-
# Racc_Runtime_Core_Version_C = (defined in extention)
|
53
|
-
Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
|
54
|
-
unless new.respond_to?(:_racc_do_parse_c, true)
|
55
|
-
raise LoadError, 'old cparse.so'
|
56
|
-
end
|
57
|
-
if Racc_No_Extentions
|
58
|
-
raise LoadError, 'selecting ruby version of racc runtime core'
|
59
|
-
end
|
60
|
-
|
61
|
-
Racc_Main_Parsing_Routine = :_racc_do_parse_c
|
62
|
-
Racc_YY_Parse_Method = :_racc_yyparse_c
|
63
|
-
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C
|
64
|
-
Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C
|
65
|
-
Racc_Runtime_Type = 'c'
|
66
|
-
rescue LoadError
|
67
|
-
Racc_Main_Parsing_Routine = :_racc_do_parse_rb
|
68
|
-
Racc_YY_Parse_Method = :_racc_yyparse_rb
|
69
|
-
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
|
70
|
-
Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R
|
71
|
-
Racc_Runtime_Type = 'ruby'
|
72
|
-
end
|
73
|
-
|
74
|
-
def Parser.racc_runtime_type
|
75
|
-
Racc_Runtime_Type
|
76
|
-
end
|
77
|
-
|
78
|
-
private
|
79
|
-
|
80
|
-
def _racc_setup
|
81
|
-
@yydebug = false unless self.class::Racc_debug_parser
|
82
|
-
@yydebug = false unless defined?(@yydebug)
|
83
|
-
if @yydebug
|
84
|
-
@racc_debug_out = $stderr unless defined?(@racc_debug_out)
|
85
|
-
@racc_debug_out ||= $stderr
|
86
|
-
end
|
87
|
-
arg = self.class::Racc_arg
|
88
|
-
arg[13] = true if arg.size < 14
|
89
|
-
arg
|
90
|
-
end
|
91
|
-
|
92
|
-
def _racc_init_sysvars
|
93
|
-
@racc_state = [0]
|
94
|
-
@racc_tstack = []
|
95
|
-
@racc_vstack = []
|
96
|
-
|
97
|
-
@racc_t = nil
|
98
|
-
@racc_val = nil
|
99
|
-
|
100
|
-
@racc_read_next = true
|
101
|
-
|
102
|
-
@racc_user_yyerror = false
|
103
|
-
@racc_error_status = 0
|
104
|
-
end
|
105
|
-
|
106
|
-
###
|
107
|
-
### do_parse
|
108
|
-
###
|
109
|
-
|
110
|
-
def do_parse
|
111
|
-
__send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
|
112
|
-
end
|
113
|
-
|
114
|
-
def next_token
|
115
|
-
raise NotImplementedError, "#{self.class}\#next_token is not defined"
|
116
|
-
end
|
117
|
-
|
118
|
-
def _racc_do_parse_rb(arg, in_debug)
|
119
|
-
action_table, action_check, action_default, action_pointer,
|
120
|
-
goto_table, goto_check, goto_default, goto_pointer,
|
121
|
-
nt_base, reduce_table, token_table, shift_n,
|
122
|
-
reduce_n, use_result, * = arg
|
123
|
-
|
124
|
-
_racc_init_sysvars
|
125
|
-
tok = act = i = nil
|
126
|
-
nerr = 0
|
127
|
-
|
128
|
-
catch(:racc_end_parse) {
|
129
|
-
while true
|
130
|
-
if i = action_pointer[@racc_state[-1]]
|
131
|
-
if @racc_read_next
|
132
|
-
if @racc_t != 0 # not EOF
|
133
|
-
tok, @racc_val = next_token()
|
134
|
-
unless tok # EOF
|
135
|
-
@racc_t = 0
|
136
|
-
else
|
137
|
-
@racc_t = (token_table[tok] or 1) # error token
|
138
|
-
end
|
139
|
-
racc_read_token(@racc_t, tok, @racc_val) if @yydebug
|
140
|
-
@racc_read_next = false
|
141
|
-
end
|
142
|
-
end
|
143
|
-
i += @racc_t
|
144
|
-
unless i >= 0 and
|
145
|
-
act = action_table[i] and
|
146
|
-
action_check[i] == @racc_state[-1]
|
147
|
-
act = action_default[@racc_state[-1]]
|
148
|
-
end
|
149
|
-
else
|
150
|
-
act = action_default[@racc_state[-1]]
|
151
|
-
end
|
152
|
-
while act = _racc_evalact(act, arg)
|
153
|
-
;
|
154
|
-
end
|
155
|
-
end
|
156
|
-
}
|
157
|
-
end
|
158
|
-
|
159
|
-
###
|
160
|
-
### yyparse
|
161
|
-
###
|
162
|
-
|
163
|
-
def yyparse(recv, mid)
|
164
|
-
__send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true)
|
165
|
-
end
|
166
|
-
|
167
|
-
def _racc_yyparse_rb(recv, mid, arg, c_debug)
|
168
|
-
action_table, action_check, action_default, action_pointer,
|
169
|
-
goto_table, goto_check, goto_default, goto_pointer,
|
170
|
-
nt_base, reduce_table, token_table, shift_n,
|
171
|
-
reduce_n, use_result, * = arg
|
172
|
-
|
173
|
-
_racc_init_sysvars
|
174
|
-
tok = nil
|
175
|
-
act = nil
|
176
|
-
i = nil
|
177
|
-
nerr = 0
|
178
|
-
|
179
|
-
catch(:racc_end_parse) {
|
180
|
-
until i = action_pointer[@racc_state[-1]]
|
181
|
-
while act = _racc_evalact(action_default[@racc_state[-1]], arg)
|
182
|
-
;
|
183
|
-
end
|
184
|
-
end
|
185
|
-
recv.__send__(mid) do |tok, val|
|
186
|
-
unless tok
|
187
|
-
@racc_t = 0
|
188
|
-
else
|
189
|
-
@racc_t = (token_table[tok] or 1) # error token
|
190
|
-
end
|
191
|
-
@racc_val = val
|
192
|
-
@racc_read_next = false
|
193
|
-
|
194
|
-
i += @racc_t
|
195
|
-
unless i >= 0 and
|
196
|
-
act = action_table[i] and
|
197
|
-
action_check[i] == @racc_state[-1]
|
198
|
-
act = action_default[@racc_state[-1]]
|
199
|
-
end
|
200
|
-
while act = _racc_evalact(act, arg)
|
201
|
-
;
|
202
|
-
end
|
203
|
-
|
204
|
-
while not (i = action_pointer[@racc_state[-1]]) or
|
205
|
-
not @racc_read_next or
|
206
|
-
@racc_t == 0 # $
|
207
|
-
unless i and i += @racc_t and
|
208
|
-
i >= 0 and
|
209
|
-
act = action_table[i] and
|
210
|
-
action_check[i] == @racc_state[-1]
|
211
|
-
act = action_default[@racc_state[-1]]
|
212
|
-
end
|
213
|
-
while act = _racc_evalact(act, arg)
|
214
|
-
;
|
215
|
-
end
|
216
|
-
end
|
217
|
-
end
|
218
|
-
}
|
219
|
-
end
|
220
|
-
|
221
|
-
###
|
222
|
-
### common
|
223
|
-
###
|
224
|
-
|
225
|
-
def _racc_evalact(act, arg)
|
226
|
-
action_table, action_check, action_default, action_pointer,
|
227
|
-
goto_table, goto_check, goto_default, goto_pointer,
|
228
|
-
nt_base, reduce_table, token_table, shift_n,
|
229
|
-
reduce_n, use_result, * = arg
|
230
|
-
nerr = 0 # tmp
|
231
|
-
|
232
|
-
if act > 0 and act < shift_n
|
233
|
-
#
|
234
|
-
# shift
|
235
|
-
#
|
236
|
-
if @racc_error_status > 0
|
237
|
-
@racc_error_status -= 1 unless @racc_t == 1 # error token
|
238
|
-
end
|
239
|
-
@racc_vstack.push @racc_val
|
240
|
-
@racc_state.push act
|
241
|
-
@racc_read_next = true
|
242
|
-
if @yydebug
|
243
|
-
@racc_tstack.push @racc_t
|
244
|
-
racc_shift @racc_t, @racc_tstack, @racc_vstack
|
245
|
-
end
|
246
|
-
|
247
|
-
elsif act < 0 and act > -reduce_n
|
248
|
-
#
|
249
|
-
# reduce
|
250
|
-
#
|
251
|
-
code = catch(:racc_jump) {
|
252
|
-
@racc_state.push _racc_do_reduce(arg, act)
|
253
|
-
false
|
254
|
-
}
|
255
|
-
if code
|
256
|
-
case code
|
257
|
-
when 1 # yyerror
|
258
|
-
@racc_user_yyerror = true # user_yyerror
|
259
|
-
return -reduce_n
|
260
|
-
when 2 # yyaccept
|
261
|
-
return shift_n
|
262
|
-
else
|
263
|
-
raise '[Racc Bug] unknown jump code'
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
elsif act == shift_n
|
268
|
-
#
|
269
|
-
# accept
|
270
|
-
#
|
271
|
-
racc_accept if @yydebug
|
272
|
-
throw :racc_end_parse, @racc_vstack[0]
|
273
|
-
|
274
|
-
elsif act == -reduce_n
|
275
|
-
#
|
276
|
-
# error
|
277
|
-
#
|
278
|
-
case @racc_error_status
|
279
|
-
when 0
|
280
|
-
unless arg[21] # user_yyerror
|
281
|
-
nerr += 1
|
282
|
-
on_error @racc_t, @racc_val, @racc_vstack
|
283
|
-
end
|
284
|
-
when 3
|
285
|
-
if @racc_t == 0 # is $
|
286
|
-
throw :racc_end_parse, nil
|
287
|
-
end
|
288
|
-
@racc_read_next = true
|
289
|
-
end
|
290
|
-
@racc_user_yyerror = false
|
291
|
-
@racc_error_status = 3
|
292
|
-
while true
|
293
|
-
if i = action_pointer[@racc_state[-1]]
|
294
|
-
i += 1 # error token
|
295
|
-
if i >= 0 and
|
296
|
-
(act = action_table[i]) and
|
297
|
-
action_check[i] == @racc_state[-1]
|
298
|
-
break
|
299
|
-
end
|
300
|
-
end
|
301
|
-
throw :racc_end_parse, nil if @racc_state.size <= 1
|
302
|
-
@racc_state.pop
|
303
|
-
@racc_vstack.pop
|
304
|
-
if @yydebug
|
305
|
-
@racc_tstack.pop
|
306
|
-
racc_e_pop @racc_state, @racc_tstack, @racc_vstack
|
307
|
-
end
|
308
|
-
end
|
309
|
-
return act
|
310
|
-
|
311
|
-
else
|
312
|
-
raise "[Racc Bug] unknown action #{act.inspect}"
|
313
|
-
end
|
314
|
-
|
315
|
-
racc_next_state(@racc_state[-1], @racc_state) if @yydebug
|
316
|
-
|
317
|
-
nil
|
318
|
-
end
|
319
|
-
|
320
|
-
def _racc_do_reduce(arg, act)
|
321
|
-
action_table, action_check, action_default, action_pointer,
|
322
|
-
goto_table, goto_check, goto_default, goto_pointer,
|
323
|
-
nt_base, reduce_table, token_table, shift_n,
|
324
|
-
reduce_n, use_result, * = arg
|
325
|
-
state = @racc_state
|
326
|
-
vstack = @racc_vstack
|
327
|
-
tstack = @racc_tstack
|
328
|
-
|
329
|
-
i = act * -3
|
330
|
-
len = reduce_table[i]
|
331
|
-
reduce_to = reduce_table[i+1]
|
332
|
-
method_id = reduce_table[i+2]
|
333
|
-
void_array = []
|
334
|
-
|
335
|
-
tmp_t = tstack[-len, len] if @yydebug
|
336
|
-
tmp_v = vstack[-len, len]
|
337
|
-
tstack[-len, len] = void_array if @yydebug
|
338
|
-
vstack[-len, len] = void_array
|
339
|
-
state[-len, len] = void_array
|
340
|
-
|
341
|
-
# tstack must be updated AFTER method call
|
342
|
-
if use_result
|
343
|
-
vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
|
344
|
-
else
|
345
|
-
vstack.push __send__(method_id, tmp_v, vstack)
|
346
|
-
end
|
347
|
-
tstack.push reduce_to
|
348
|
-
|
349
|
-
racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
|
350
|
-
|
351
|
-
k1 = reduce_to - nt_base
|
352
|
-
if i = goto_pointer[k1]
|
353
|
-
i += state[-1]
|
354
|
-
if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
|
355
|
-
return curstate
|
356
|
-
end
|
357
|
-
end
|
358
|
-
goto_default[k1]
|
359
|
-
end
|
360
|
-
|
361
|
-
def on_error(t, val, vstack)
|
362
|
-
raise ParseError, sprintf("\nparse error on value %s (%s)",
|
363
|
-
val.inspect, token_to_str(t) || '?')
|
364
|
-
end
|
365
|
-
|
366
|
-
def yyerror
|
367
|
-
throw :racc_jump, 1
|
368
|
-
end
|
369
|
-
|
370
|
-
def yyaccept
|
371
|
-
throw :racc_jump, 2
|
372
|
-
end
|
373
|
-
|
374
|
-
def yyerrok
|
375
|
-
@racc_error_status = 0
|
376
|
-
end
|
377
|
-
|
378
|
-
#
|
379
|
-
# for debugging output
|
380
|
-
#
|
381
|
-
|
382
|
-
def racc_read_token(t, tok, val)
|
383
|
-
@racc_debug_out.print 'read '
|
384
|
-
@racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
|
385
|
-
@racc_debug_out.puts val.inspect
|
386
|
-
@racc_debug_out.puts
|
387
|
-
end
|
388
|
-
|
389
|
-
def racc_shift(tok, tstack, vstack)
|
390
|
-
@racc_debug_out.puts "shift #{racc_token2str tok}"
|
391
|
-
racc_print_stacks tstack, vstack
|
392
|
-
@racc_debug_out.puts
|
393
|
-
end
|
394
|
-
|
395
|
-
def racc_reduce(toks, sim, tstack, vstack)
|
396
|
-
out = @racc_debug_out
|
397
|
-
out.print 'reduce '
|
398
|
-
if toks.empty?
|
399
|
-
out.print ' <none>'
|
400
|
-
else
|
401
|
-
toks.each {|t| out.print ' ', racc_token2str(t) }
|
402
|
-
end
|
403
|
-
out.puts " --> #{racc_token2str(sim)}"
|
404
|
-
|
405
|
-
racc_print_stacks tstack, vstack
|
406
|
-
@racc_debug_out.puts
|
407
|
-
end
|
408
|
-
|
409
|
-
def racc_accept
|
410
|
-
@racc_debug_out.puts 'accept'
|
411
|
-
@racc_debug_out.puts
|
412
|
-
end
|
413
|
-
|
414
|
-
def racc_e_pop(state, tstack, vstack)
|
415
|
-
@racc_debug_out.puts 'error recovering mode: pop token'
|
416
|
-
racc_print_states state
|
417
|
-
racc_print_stacks tstack, vstack
|
418
|
-
@racc_debug_out.puts
|
419
|
-
end
|
420
|
-
|
421
|
-
def racc_next_state(curstate, state)
|
422
|
-
@racc_debug_out.puts "goto #{curstate}"
|
423
|
-
racc_print_states state
|
424
|
-
@racc_debug_out.puts
|
425
|
-
end
|
426
|
-
|
427
|
-
def racc_print_stacks(t, v)
|
428
|
-
out = @racc_debug_out
|
429
|
-
out.print ' ['
|
430
|
-
t.each_index do |i|
|
431
|
-
out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
|
432
|
-
end
|
433
|
-
out.puts ' ]'
|
434
|
-
end
|
435
|
-
|
436
|
-
def racc_print_states(s)
|
437
|
-
out = @racc_debug_out
|
438
|
-
out.print ' ['
|
439
|
-
s.each {|st| out.print ' ', st }
|
440
|
-
out.puts ' ]'
|
441
|
-
end
|
442
|
-
|
443
|
-
def racc_token2str(tok)
|
444
|
-
self.class::Racc_token_to_s_table[tok] or
|
445
|
-
raise "[Racc Bug] can't convert token #{tok} to string"
|
446
|
-
end
|
447
|
-
|
448
|
-
def token_to_str(t)
|
449
|
-
self.class::Racc_token_to_s_table[t]
|
450
|
-
end
|
451
|
-
|
452
|
-
end
|
453
|
-
|
454
|
-
end
|
455
|
-
end
|
456
|
-
###### racc/parser.rb end
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
require 'date'
|
461
|
-
|
462
|
-
|
463
|
-
module NumRu
|
464
|
-
class Units < Racc::Parser
|
465
|
-
|
466
|
-
|
467
|
-
=begin
|
468
|
-
= class Node
|
469
|
-
Node is a parent class for classes of parse tree node.
|
470
|
-
This is not expected to be instanciated directly.
|
471
|
-
=end
|
472
|
-
|
473
|
-
class Node
|
474
|
-
|
475
|
-
def initialize(*args)
|
476
|
-
raise "#{self.class} is virtual."
|
477
|
-
end
|
478
|
-
|
479
|
-
def to_s(*args)
|
480
|
-
raise "#{self.class}#to_s is virtual."
|
481
|
-
end
|
482
|
-
|
483
|
-
=begin
|
484
|
-
--- pow other
|
485
|
-
simply constructs a PowNode object.
|
486
|
-
No reduction is performed.
|
487
|
-
=end
|
488
|
-
|
489
|
-
def pow(other)
|
490
|
-
PowNode.new(self, other)
|
491
|
-
end
|
492
|
-
|
493
|
-
=begin
|
494
|
-
--- mul other
|
495
|
-
simply constructs a MulNode object.
|
496
|
-
No reduction is performed.
|
497
|
-
=end
|
498
|
-
|
499
|
-
def mul(other)
|
500
|
-
other = NumberNode.new(other) if Numeric === other
|
501
|
-
MulNode.new(self, other)
|
502
|
-
end
|
503
|
-
|
504
|
-
=begin
|
505
|
-
--- divide other
|
506
|
-
simply constructs a MulNode object.
|
507
|
-
No reduction is performed.
|
508
|
-
=end
|
509
|
-
|
510
|
-
def divide(other)
|
511
|
-
MulNode.new(self, PowNode.new(other, NumberNode.new(-1)))
|
512
|
-
end
|
513
|
-
|
514
|
-
=begin
|
515
|
-
--- shift other
|
516
|
-
simply constructs a ShiftNode object.
|
517
|
-
No reduction is performed.
|
518
|
-
=end
|
519
|
-
|
520
|
-
def shift(other)
|
521
|
-
ShiftNode.new(self, other)
|
522
|
-
end
|
523
|
-
|
524
|
-
=begin
|
525
|
-
--- pow_eval other
|
526
|
-
similar to ((<pow other>)), but reduces PowNode[PowNode[...]] into
|
527
|
-
single PowNode[...], so overriden at PowNode class.
|
528
|
-
=end
|
529
|
-
|
530
|
-
def pow_eval(other)
|
531
|
-
pow(other)
|
532
|
-
end
|
533
|
-
|
534
|
-
=begin
|
535
|
-
--- inspect
|
536
|
-
=end
|
537
|
-
|
538
|
-
def inspect2; "#{self.class}[#{to_s}]"; end
|
539
|
-
|
540
|
-
def inspect; inspect2.gsub(/Units::/, '').gsub(/NumRu::/, '').gsub(/Node\[/, '['); end
|
541
|
-
|
542
|
-
=begin
|
543
|
-
--- trim
|
544
|
-
in most subclasses, "trim" is redirected into "trim2".
|
545
|
-
=end
|
546
|
-
|
547
|
-
def trim
|
548
|
-
trim2
|
549
|
-
end
|
550
|
-
|
551
|
-
=begin
|
552
|
-
--- flatten
|
553
|
-
in most subclasses, "flatten" is redirected into "flatten2".
|
554
|
-
=end
|
555
|
-
|
556
|
-
def flatten
|
557
|
-
flatten2
|
558
|
-
end
|
559
|
-
|
560
|
-
=begin
|
561
|
-
--- sort
|
562
|
-
=end
|
563
|
-
|
564
|
-
def sort
|
565
|
-
raise "#{self.class}#sort is virtual: call after flatten"
|
566
|
-
end
|
567
|
-
|
568
|
-
=begin
|
569
|
-
--- reduce1
|
570
|
-
--- reduce2
|
571
|
-
--- reduce3
|
572
|
-
--- reduce4
|
573
|
-
--- reduce5
|
574
|
-
=end
|
575
|
-
|
576
|
-
def reduce1
|
577
|
-
self
|
578
|
-
end
|
579
|
-
|
580
|
-
def reduce2
|
581
|
-
trim
|
582
|
-
end
|
583
|
-
|
584
|
-
def reduce3
|
585
|
-
trim.flatten
|
586
|
-
end
|
587
|
-
|
588
|
-
def reduce4
|
589
|
-
# unalias(Hash.new).trim.flatten.sort
|
590
|
-
foldnumber(nil).trim.flatten.sort
|
591
|
-
end
|
592
|
-
|
593
|
-
def reduce5
|
594
|
-
expand(Hash.new).trim.flatten.sort
|
595
|
-
end
|
596
|
-
|
597
|
-
=begin
|
598
|
-
--- ref
|
599
|
-
to be overriden at ShiftNode
|
600
|
-
--- deref
|
601
|
-
to be overriden at ShiftNode
|
602
|
-
=end
|
603
|
-
|
604
|
-
def ref
|
605
|
-
NumberNode::ZERO
|
606
|
-
end
|
607
|
-
|
608
|
-
def deref
|
609
|
-
self
|
610
|
-
end
|
611
|
-
|
612
|
-
end
|
613
|
-
|
614
|
-
class ErrorNode < Node
|
615
|
-
|
616
|
-
def initialize(string)
|
617
|
-
@a = string
|
618
|
-
end
|
619
|
-
|
620
|
-
def to_s; @a; end
|
621
|
-
|
622
|
-
end
|
623
|
-
|
624
|
-
class ContainerNode < Node
|
625
|
-
|
626
|
-
def trim2
|
627
|
-
x = []
|
628
|
-
for child in self
|
629
|
-
x.push child.trim2
|
630
|
-
end
|
631
|
-
self.class.new(*x)
|
632
|
-
end
|
633
|
-
|
634
|
-
def inspect2
|
635
|
-
a = []
|
636
|
-
for child in self
|
637
|
-
a.push child.inspect2
|
638
|
-
end
|
639
|
-
"#{self.class}[#{a.join(', ')}]"
|
640
|
-
end
|
641
|
-
|
642
|
-
end
|
643
|
-
|
644
|
-
module BinaryNode
|
645
|
-
|
646
|
-
def each
|
647
|
-
yield @lhs
|
648
|
-
yield @rhs
|
649
|
-
end
|
650
|
-
|
651
|
-
def expand(stopper)
|
652
|
-
self.class.new(@lhs.expand(stopper), @rhs.expand(stopper))
|
653
|
-
end
|
654
|
-
|
655
|
-
def unalias(stopper)
|
656
|
-
self.class.new(@lhs.unalias(stopper), @rhs.unalias(stopper))
|
657
|
-
end
|
658
|
-
|
659
|
-
def foldnumber(stopper)
|
660
|
-
self.class.new(@lhs.foldnumber(stopper), @rhs.foldnumber(stopper))
|
661
|
-
end
|
662
|
-
|
663
|
-
end
|
664
|
-
|
665
|
-
class TerminalNode < Node
|
666
|
-
|
667
|
-
def trim2; self; end
|
668
|
-
def flatten2; self; end
|
669
|
-
|
670
|
-
def expand(stopper); self; end
|
671
|
-
alias :unalias :expand
|
672
|
-
alias :foldnumber :expand
|
673
|
-
|
674
|
-
def sort; self; end
|
675
|
-
|
676
|
-
end
|
677
|
-
class NameNode < TerminalNode
|
678
|
-
|
679
|
-
def initialize(string)
|
680
|
-
@a = string
|
681
|
-
end
|
682
|
-
|
683
|
-
def to_s; @a; end
|
684
|
-
|
685
|
-
alias :name :to_s
|
686
|
-
|
687
|
-
def power; NumberNode::UNITY; end
|
688
|
-
|
689
|
-
def mul_eval(another)
|
690
|
-
raise "internal error (#{name}, #{another.name})" if name != another.name
|
691
|
-
PowNode.new(self, self.power.add_eval(another.power))
|
692
|
-
end
|
693
|
-
|
694
|
-
def expand(stopper)
|
695
|
-
raise "circular dependency for #{@a}" if stopper[@a]
|
696
|
-
return self if basic?
|
697
|
-
return CACHE[@a] if CACHE.include?(@a)
|
698
|
-
CACHE[@a] = expand2(stopper)
|
699
|
-
end
|
700
|
-
|
701
|
-
def expand2(stopper)
|
702
|
-
newstopper = stopper.dup
|
703
|
-
newstopper[@a] = true
|
704
|
-
if UDEFS.include?(@a) then
|
705
|
-
Units.new(UDEFS[@a]).ptree.expand(newstopper)
|
706
|
-
else
|
707
|
-
p, n = UALIASES[@a]
|
708
|
-
u = Units.new(UDEFS[n] || n).ptree.expand(newstopper)
|
709
|
-
MulNode.new(u, PowNode.new(NumberNode.new(10), NumberNode.new(p)))
|
710
|
-
end
|
711
|
-
end
|
712
|
-
|
713
|
-
def unalias(stopper)
|
714
|
-
raise "circular dependency for #{@a}" if stopper[@a]
|
715
|
-
return self unless UALIASES.include?(@a)
|
716
|
-
p, n = UALIASES[@a]
|
717
|
-
u = NameNode.new(n)
|
718
|
-
q = PowNode.new(NumberNode.new(10), NumberNode.new(p))
|
719
|
-
MulNode.new(u, q)
|
720
|
-
end
|
721
|
-
|
722
|
-
def foldnumber(stopper)
|
723
|
-
return self unless UPLURALS.include?(@a)
|
724
|
-
n = UPLURALS[@a]
|
725
|
-
NameNode.new(n)
|
726
|
-
end
|
727
|
-
|
728
|
-
def basic?
|
729
|
-
not (UDEFS.include?(@a) or UALIASES.include?(@a))
|
730
|
-
end
|
731
|
-
|
732
|
-
CACHE = {}
|
733
|
-
|
734
|
-
def factor
|
735
|
-
1
|
736
|
-
end
|
737
|
-
|
738
|
-
end
|
739
|
-
|
740
|
-
class NameNode
|
741
|
-
UDEFS = {
|
742
|
-
"%" => "1e-2", "Au" => "astronomical_unit", "Bq" => "s-1",
|
743
|
-
"C" => "A.s", "Celsius" => "K @ 273.15", "F" => "C/V",
|
744
|
-
"Fahrenheit" => "degree_F", "G" => "gauss", "Gal" => "cm s-2",
|
745
|
-
"Gy" => "J.kg-1", "H" => "Wb.A-1", "Hg" => "mercury",
|
746
|
-
"Hz" => "1/s", "J" => "N.m", "Julian_year" => "365.25 day",
|
747
|
-
"L" => "litre", "N" => "kg.m.s-2", "P" => "poise", "Pa" => "N.m-2",
|
748
|
-
"Pascal" => "Pa", "S" => "A/V", "St" => "stokes", "Sv" => "J.kg-1",
|
749
|
-
"T" => "Wb.m-2", "V" => "J/C", "W" => "J/s", "Wb" => "V.s",
|
750
|
-
"a" => "are", "ac" => "acre", "acre" => "10 chain2",
|
751
|
-
"ampere" => "A", "angstrom" => "1.0e-10 m",
|
752
|
-
"angular_degree" => "degree", "angular_minute" => "minute_angle",
|
753
|
-
"angular_second" => "second_angle", "are" => "100 m2",
|
754
|
-
"astronomical_unit" => "1.49597870e11 m",
|
755
|
-
"astronomical_units" => "1.49597870e11 m", "atm" => "atmosphere",
|
756
|
-
"atmosphere" => "101325 Pa", "bar" => "1e6 dyn.cm-2",
|
757
|
-
"cal" => "calorie", "calorie" => "4.18605 J",
|
758
|
-
"celsius" => "K @ 273.15", "centigrade" => "K @ 273.15",
|
759
|
-
"century" => "100 year", "chain" => "22 yard",
|
760
|
-
"common_year" => "365 day",
|
761
|
-
"conventional_mercury" => "gravity 13595.10 kg/m3", "coulomb" => "C",
|
762
|
-
"d" => "24 hour", "day" => "24 hour", "degC" => "K @ 273.15",
|
763
|
-
"degF" => "degree_F", "degK" => "K", "deg_C" => "K @ 273.15",
|
764
|
-
"deg_F" => "degree_F", "deg_K" => "K", "degree" => "pi.rad/180",
|
765
|
-
"degreeC" => "K @ 273.15", "degreeF" => "degree_F",
|
766
|
-
"degreeK" => "K", "degree_C" => "K @ 273.15",
|
767
|
-
"degree_E" => "degree", "degree_F" => "degree_R @ 459.67",
|
768
|
-
"degree_N" => "degree", "degree_R" => "K / 1.8",
|
769
|
-
"degree_S" => "degree", "degree_W" => "degree",
|
770
|
-
"degree_c" => "K @ 273.15", "degree_east" => "degree_E",
|
771
|
-
"degree_f" => "degree_R @ 459.67", "degree_north" => "degree_N",
|
772
|
-
"degree_south" => "degree_S", "degree_west" => "degree_W",
|
773
|
-
"degrees_east" => "degree_E", "degrees_north" => "degree_N",
|
774
|
-
"degrees_south" => "degree_S", "degrees_west" => "degree_W",
|
775
|
-
"dyn" => "g.cm.s-2", "dyne" => "g.cm.s-2", "erg" => "dyn cm",
|
776
|
-
"fahrenheit" => "degree_F", "farad" => "coulomb/volt",
|
777
|
-
"feet" => "foot", "fermi" => "1.0e-15 m", "foot" => "12 inch",
|
778
|
-
"force" => "9.80665 m.s-2", "ft" => "foot", "g" => "kg/1000",
|
779
|
-
"gal" => "cm s-2", "gauss" => "T / 10000", "gram" => "kg/1000",
|
780
|
-
"gravity" => "9.806650 meter/second2", "h" => "60 min",
|
781
|
-
"hectare" => "100 are", "hertz" => "Hz", "hg" => "mercury",
|
782
|
-
"horse_power" => "75 m kilogram-force / s", "hour" => "60 min",
|
783
|
-
"hr" => "60 min", "in" => "inch", "inch" => "2.54 cm",
|
784
|
-
"joule" => "J", "kelvin" => "K", "kgf" => "kilogram-force",
|
785
|
-
"kilogram" => "kg", "knot" => "nautical_mile / hour",
|
786
|
-
"kph" => "km / hour", "lb" => "pound",
|
787
|
-
"light_speed" => "299792458 m/s", "light_year" => "9.46e15 m",
|
788
|
-
"light_years" => "9.46e15 m", "litre" => "1.0e-3 m3",
|
789
|
-
"lm" => "cd.sr", "lx" => "lm.m-2", "ly" => "light_year",
|
790
|
-
"mb" => "bar / 1000", "mercury" => "conventional_mercury",
|
791
|
-
"meter" => "metre", "metre" => "m", "mgal" => "cm s-2 / 1000",
|
792
|
-
"micron" => "1.0e-6 m", "mile" => "1760 yard",
|
793
|
-
"millibar" => "bar / 1000", "min" => "60 s", "minute" => "60 s",
|
794
|
-
"minute_angle" => "pi.rad/180/60", "mole" => "mol",
|
795
|
-
"mon" => "month", "month" => "6 pentad", "mph" => "mile / hour",
|
796
|
-
"nautical_mile" => "1852 m", "nautical_miles" => "1852 m",
|
797
|
-
"newton" => "N", "ohm" => "V/A", "ounce" => "pound / 16",
|
798
|
-
"oz" => "ounce", "parsec" => "3.0857e16 m", "pascal" => "Pa",
|
799
|
-
"pc" => "parsec", "percent" => "1e-2", "permil" => "1e-3",
|
800
|
-
"pi" => "3.141592653589793238462", "poise" => "dyn s / cm2",
|
801
|
-
"pound" => "453.6 g", "psi" => "pound-force / inch2",
|
802
|
-
"radian" => "rad", "second" => "s",
|
803
|
-
"second_angle" => "pi.rad/180/60/60", "steradian" => "sr",
|
804
|
-
"stokes" => "cm2 / s", "t" => "ton", "tesla" => "Wb.m-2",
|
805
|
-
"ton" => "1000 kg", "tonne" => "ton", "torr" => "133.322 Pa",
|
806
|
-
"volt" => "V", "watt" => "W", "weber" => "Wb", "yard" => "6 feet",
|
807
|
-
"yd" => "yard", "year" => "12 month", "yr" => "year",
|
808
|
-
}
|
809
|
-
UALIASES = {
|
810
|
-
"Celsiuses" => [0, "Celsius"], "E%" => [18, "%"], "EA" => [18, "A"],
|
811
|
-
"EAu" => [18, "Au"], "EBq" => [18, "Bq"], "EC" => [18, "C"],
|
812
|
-
"EF" => [18, "F"], "EG" => [18, "G"], "EGal" => [18, "Gal"],
|
813
|
-
"EGy" => [18, "Gy"], "EH" => [18, "H"], "EHg" => [18, "Hg"],
|
814
|
-
"EHz" => [18, "Hz"], "EJ" => [18, "J"], "EK" => [18, "K"],
|
815
|
-
"EL" => [18, "L"], "EN" => [18, "N"], "EP" => [18, "P"],
|
816
|
-
"EPa" => [18, "Pa"], "ES" => [18, "S"], "ESt" => [18, "St"],
|
817
|
-
"ESv" => [18, "Sv"], "ET" => [18, "T"], "EV" => [18, "V"],
|
818
|
-
"EW" => [18, "W"], "EWb" => [18, "Wb"], "Ea" => [18, "a"],
|
819
|
-
"Eac" => [18, "ac"], "Eatm" => [18, "atm"], "Ebar" => [18, "bar"],
|
820
|
-
"Ecal" => [18, "cal"],
|
821
|
-
"Econventional_mercury" => [18, "conventional_mercury"],
|
822
|
-
"Ed" => [18, "d"], "EdegC" => [18, "degC"], "EdegF" => [18, "degF"],
|
823
|
-
"Edeg_C" => [18, "deg_C"], "Edeg_F" => [18, "deg_F"],
|
824
|
-
"EdegreeC" => [18, "degreeC"], "EdegreeF" => [18, "degreeF"],
|
825
|
-
"Edegree_C" => [18, "degree_C"], "Edegree_E" => [18, "degree_E"],
|
826
|
-
"Edegree_F" => [18, "degree_F"], "Edegree_N" => [18, "degree_N"],
|
827
|
-
"Edegree_R" => [18, "degree_R"], "Edegree_S" => [18, "degree_S"],
|
828
|
-
"Edegree_W" => [18, "degree_W"], "Edegree_c" => [18, "degree_c"],
|
829
|
-
"Edegree_east" => [18, "degree_east"],
|
830
|
-
"Edegree_f" => [18, "degree_f"],
|
831
|
-
"Edegree_north" => [18, "degree_north"],
|
832
|
-
"Edegree_south" => [18, "degree_south"],
|
833
|
-
"Edegree_west" => [18, "degree_west"],
|
834
|
-
"Edegrees_east" => [18, "degrees_east"],
|
835
|
-
"Edegrees_north" => [18, "degrees_north"],
|
836
|
-
"Edegrees_south" => [18, "degrees_south"],
|
837
|
-
"Edegrees_west" => [18, "degrees_west"], "Edyn" => [18, "dyn"],
|
838
|
-
"Eerg" => [18, "erg"], "Eforce" => [18, "force"], "Eg" => [18, "g"],
|
839
|
-
"Egravity" => [18, "gravity"], "Eh" => [18, "h"],
|
840
|
-
"Ehg" => [18, "hg"], "Ehr" => [18, "hr"], "Ein" => [18, "in"],
|
841
|
-
"Ekg" => [18, "kg"], "Ekgf" => [18, "kgf"], "Ekph" => [18, "kph"],
|
842
|
-
"Elb" => [18, "lb"], "Elm" => [18, "lm"], "Elx" => [18, "lx"],
|
843
|
-
"Ely" => [18, "ly"], "Em" => [18, "m"], "Emb" => [18, "mb"],
|
844
|
-
"Emercury" => [18, "mercury"], "Emgal" => [18, "mgal"],
|
845
|
-
"Emin" => [18, "min"], "Emol" => [18, "mol"], "Emon" => [18, "mon"],
|
846
|
-
"Emph" => [18, "mph"], "Eohm" => [18, "ohm"], "Eoz" => [18, "oz"],
|
847
|
-
"Epc" => [18, "pc"], "Epercent" => [18, "percent"],
|
848
|
-
"Epermil" => [18, "permil"], "Epsi" => [18, "psi"],
|
849
|
-
"Erad" => [18, "rad"], "Es" => [18, "s"], "Esr" => [18, "sr"],
|
850
|
-
"Et" => [18, "t"], "Eyr" => [18, "yr"],
|
851
|
-
"Fahrenheits" => [0, "Fahrenheit"], "G%" => [9, "%"],
|
852
|
-
"GA" => [9, "A"], "GAu" => [9, "Au"], "GBq" => [9, "Bq"],
|
853
|
-
"GC" => [9, "C"], "GF" => [9, "F"], "GG" => [9, "G"],
|
854
|
-
"GGal" => [9, "Gal"], "GGy" => [9, "Gy"], "GH" => [9, "H"],
|
855
|
-
"GHg" => [9, "Hg"], "GHz" => [9, "Hz"], "GJ" => [9, "J"],
|
856
|
-
"GK" => [9, "K"], "GL" => [9, "L"], "GN" => [9, "N"],
|
857
|
-
"GP" => [9, "P"], "GPa" => [9, "Pa"], "GS" => [9, "S"],
|
858
|
-
"GSt" => [9, "St"], "GSv" => [9, "Sv"], "GT" => [9, "T"],
|
859
|
-
"GV" => [9, "V"], "GW" => [9, "W"], "GWb" => [9, "Wb"],
|
860
|
-
"Ga" => [9, "a"], "Gac" => [9, "ac"], "Gatm" => [9, "atm"],
|
861
|
-
"Gbar" => [9, "bar"], "Gcal" => [9, "cal"],
|
862
|
-
"Gconventional_mercury" => [9, "conventional_mercury"],
|
863
|
-
"Gd" => [9, "d"], "GdegC" => [9, "degC"], "GdegF" => [9, "degF"],
|
864
|
-
"Gdeg_C" => [9, "deg_C"], "Gdeg_F" => [9, "deg_F"],
|
865
|
-
"GdegreeC" => [9, "degreeC"], "GdegreeF" => [9, "degreeF"],
|
866
|
-
"Gdegree_C" => [9, "degree_C"], "Gdegree_E" => [9, "degree_E"],
|
867
|
-
"Gdegree_F" => [9, "degree_F"], "Gdegree_N" => [9, "degree_N"],
|
868
|
-
"Gdegree_R" => [9, "degree_R"], "Gdegree_S" => [9, "degree_S"],
|
869
|
-
"Gdegree_W" => [9, "degree_W"], "Gdegree_c" => [9, "degree_c"],
|
870
|
-
"Gdegree_east" => [9, "degree_east"], "Gdegree_f" => [9, "degree_f"],
|
871
|
-
"Gdegree_north" => [9, "degree_north"],
|
872
|
-
"Gdegree_south" => [9, "degree_south"],
|
873
|
-
"Gdegree_west" => [9, "degree_west"],
|
874
|
-
"Gdegrees_east" => [9, "degrees_east"],
|
875
|
-
"Gdegrees_north" => [9, "degrees_north"],
|
876
|
-
"Gdegrees_south" => [9, "degrees_south"],
|
877
|
-
"Gdegrees_west" => [9, "degrees_west"], "Gdyn" => [9, "dyn"],
|
878
|
-
"Gerg" => [9, "erg"], "Gforce" => [9, "force"], "Gg" => [9, "g"],
|
879
|
-
"Ggravity" => [9, "gravity"], "Gh" => [9, "h"], "Ghg" => [9, "hg"],
|
880
|
-
"Ghr" => [9, "hr"], "Gin" => [9, "in"], "Gkg" => [9, "kg"],
|
881
|
-
"Gkgf" => [9, "kgf"], "Gkph" => [9, "kph"], "Glb" => [9, "lb"],
|
882
|
-
"Glm" => [9, "lm"], "Glx" => [9, "lx"], "Gly" => [9, "ly"],
|
883
|
-
"Gm" => [9, "m"], "Gmb" => [9, "mb"], "Gmercury" => [9, "mercury"],
|
884
|
-
"Gmgal" => [9, "mgal"], "Gmin" => [9, "min"], "Gmol" => [9, "mol"],
|
885
|
-
"Gmon" => [9, "mon"], "Gmph" => [9, "mph"], "Gohm" => [9, "ohm"],
|
886
|
-
"Goz" => [9, "oz"], "Gpc" => [9, "pc"],
|
887
|
-
"Gpercent" => [9, "percent"], "Gpermil" => [9, "permil"],
|
888
|
-
"Gpsi" => [9, "psi"], "Grad" => [9, "rad"], "Gs" => [9, "s"],
|
889
|
-
"Gsr" => [9, "sr"], "Gt" => [9, "t"], "Gyr" => [9, "yr"],
|
890
|
-
"Julians_year" => [0, "Julian_year"], "M%" => [6, "%"],
|
891
|
-
"MA" => [6, "A"], "MAu" => [6, "Au"], "MBq" => [6, "Bq"],
|
892
|
-
"MC" => [6, "C"], "MF" => [6, "F"], "MG" => [6, "G"],
|
893
|
-
"MGal" => [6, "Gal"], "MGy" => [6, "Gy"], "MH" => [6, "H"],
|
894
|
-
"MHg" => [6, "Hg"], "MHz" => [6, "Hz"], "MJ" => [6, "J"],
|
895
|
-
"MK" => [6, "K"], "ML" => [6, "L"], "MN" => [6, "N"],
|
896
|
-
"MP" => [6, "P"], "MPa" => [6, "Pa"], "MS" => [6, "S"],
|
897
|
-
"MSt" => [6, "St"], "MSv" => [6, "Sv"], "MT" => [6, "T"],
|
898
|
-
"MV" => [6, "V"], "MW" => [6, "W"], "MWb" => [6, "Wb"],
|
899
|
-
"Ma" => [6, "a"], "Mac" => [6, "ac"], "Matm" => [6, "atm"],
|
900
|
-
"Mbar" => [6, "bar"], "Mcal" => [6, "cal"],
|
901
|
-
"Mconventional_mercury" => [6, "conventional_mercury"],
|
902
|
-
"Md" => [6, "d"], "MdegC" => [6, "degC"], "MdegF" => [6, "degF"],
|
903
|
-
"Mdeg_C" => [6, "deg_C"], "Mdeg_F" => [6, "deg_F"],
|
904
|
-
"MdegreeC" => [6, "degreeC"], "MdegreeF" => [6, "degreeF"],
|
905
|
-
"Mdegree_C" => [6, "degree_C"], "Mdegree_E" => [6, "degree_E"],
|
906
|
-
"Mdegree_F" => [6, "degree_F"], "Mdegree_N" => [6, "degree_N"],
|
907
|
-
"Mdegree_R" => [6, "degree_R"], "Mdegree_S" => [6, "degree_S"],
|
908
|
-
"Mdegree_W" => [6, "degree_W"], "Mdegree_c" => [6, "degree_c"],
|
909
|
-
"Mdegree_east" => [6, "degree_east"], "Mdegree_f" => [6, "degree_f"],
|
910
|
-
"Mdegree_north" => [6, "degree_north"],
|
911
|
-
"Mdegree_south" => [6, "degree_south"],
|
912
|
-
"Mdegree_west" => [6, "degree_west"],
|
913
|
-
"Mdegrees_east" => [6, "degrees_east"],
|
914
|
-
"Mdegrees_north" => [6, "degrees_north"],
|
915
|
-
"Mdegrees_south" => [6, "degrees_south"],
|
916
|
-
"Mdegrees_west" => [6, "degrees_west"], "Mdyn" => [6, "dyn"],
|
917
|
-
"Merg" => [6, "erg"], "Mforce" => [6, "force"], "Mg" => [6, "g"],
|
918
|
-
"Mgravity" => [6, "gravity"], "Mh" => [6, "h"], "Mhg" => [6, "hg"],
|
919
|
-
"Mhr" => [6, "hr"], "Min" => [6, "in"], "Mkg" => [6, "kg"],
|
920
|
-
"Mkgf" => [6, "kgf"], "Mkph" => [6, "kph"], "Mlb" => [6, "lb"],
|
921
|
-
"Mlm" => [6, "lm"], "Mlx" => [6, "lx"], "Mly" => [6, "ly"],
|
922
|
-
"Mm" => [6, "m"], "Mmb" => [6, "mb"], "Mmercury" => [6, "mercury"],
|
923
|
-
"Mmgal" => [6, "mgal"], "Mmin" => [6, "min"], "Mmol" => [6, "mol"],
|
924
|
-
"Mmon" => [6, "mon"], "Mmph" => [6, "mph"], "Mohm" => [6, "ohm"],
|
925
|
-
"Moz" => [6, "oz"], "Mpc" => [6, "pc"],
|
926
|
-
"Mpercent" => [6, "percent"], "Mpermil" => [6, "permil"],
|
927
|
-
"Mpsi" => [6, "psi"], "Mrad" => [6, "rad"], "Ms" => [6, "s"],
|
928
|
-
"Msr" => [6, "sr"], "Mt" => [6, "t"], "Myr" => [6, "yr"],
|
929
|
-
"P%" => [15, "%"], "PA" => [15, "A"], "PAu" => [15, "Au"],
|
930
|
-
"PBq" => [15, "Bq"], "PC" => [15, "C"], "PF" => [15, "F"],
|
931
|
-
"PG" => [15, "G"], "PGal" => [15, "Gal"], "PGy" => [15, "Gy"],
|
932
|
-
"PH" => [15, "H"], "PHg" => [15, "Hg"], "PHz" => [15, "Hz"],
|
933
|
-
"PJ" => [15, "J"], "PK" => [15, "K"], "PL" => [15, "L"],
|
934
|
-
"PN" => [15, "N"], "PP" => [15, "P"], "PPa" => [15, "Pa"],
|
935
|
-
"PS" => [15, "S"], "PSt" => [15, "St"], "PSv" => [15, "Sv"],
|
936
|
-
"PT" => [15, "T"], "PV" => [15, "V"], "PW" => [15, "W"],
|
937
|
-
"PWb" => [15, "Wb"], "Pa" => [15, "a"], "Pac" => [15, "ac"],
|
938
|
-
"Pascals" => [0, "Pascal"], "Patm" => [15, "atm"],
|
939
|
-
"Pbar" => [15, "bar"], "Pcal" => [15, "cal"],
|
940
|
-
"Pconventional_mercury" => [15, "conventional_mercury"],
|
941
|
-
"Pd" => [15, "d"], "PdegC" => [15, "degC"], "PdegF" => [15, "degF"],
|
942
|
-
"Pdeg_C" => [15, "deg_C"], "Pdeg_F" => [15, "deg_F"],
|
943
|
-
"PdegreeC" => [15, "degreeC"], "PdegreeF" => [15, "degreeF"],
|
944
|
-
"Pdegree_C" => [15, "degree_C"], "Pdegree_E" => [15, "degree_E"],
|
945
|
-
"Pdegree_F" => [15, "degree_F"], "Pdegree_N" => [15, "degree_N"],
|
946
|
-
"Pdegree_R" => [15, "degree_R"], "Pdegree_S" => [15, "degree_S"],
|
947
|
-
"Pdegree_W" => [15, "degree_W"], "Pdegree_c" => [15, "degree_c"],
|
948
|
-
"Pdegree_east" => [15, "degree_east"],
|
949
|
-
"Pdegree_f" => [15, "degree_f"],
|
950
|
-
"Pdegree_north" => [15, "degree_north"],
|
951
|
-
"Pdegree_south" => [15, "degree_south"],
|
952
|
-
"Pdegree_west" => [15, "degree_west"],
|
953
|
-
"Pdegrees_east" => [15, "degrees_east"],
|
954
|
-
"Pdegrees_north" => [15, "degrees_north"],
|
955
|
-
"Pdegrees_south" => [15, "degrees_south"],
|
956
|
-
"Pdegrees_west" => [15, "degrees_west"], "Pdyn" => [15, "dyn"],
|
957
|
-
"Perg" => [15, "erg"], "Pforce" => [15, "force"], "Pg" => [15, "g"],
|
958
|
-
"Pgravity" => [15, "gravity"], "Ph" => [15, "h"],
|
959
|
-
"Phg" => [15, "hg"], "Phr" => [15, "hr"], "Pin" => [15, "in"],
|
960
|
-
"Pkg" => [15, "kg"], "Pkgf" => [15, "kgf"], "Pkph" => [15, "kph"],
|
961
|
-
"Plb" => [15, "lb"], "Plm" => [15, "lm"], "Plx" => [15, "lx"],
|
962
|
-
"Ply" => [15, "ly"], "Pm" => [15, "m"], "Pmb" => [15, "mb"],
|
963
|
-
"Pmercury" => [15, "mercury"], "Pmgal" => [15, "mgal"],
|
964
|
-
"Pmin" => [15, "min"], "Pmol" => [15, "mol"], "Pmon" => [15, "mon"],
|
965
|
-
"Pmph" => [15, "mph"], "Pohm" => [15, "ohm"], "Poz" => [15, "oz"],
|
966
|
-
"Ppc" => [15, "pc"], "Ppercent" => [15, "percent"],
|
967
|
-
"Ppermil" => [15, "permil"], "Ppsi" => [15, "psi"],
|
968
|
-
"Prad" => [15, "rad"], "Ps" => [15, "s"], "Psr" => [15, "sr"],
|
969
|
-
"Pt" => [15, "t"], "Pyr" => [15, "yr"], "T%" => [12, "%"],
|
970
|
-
"TA" => [12, "A"], "TAu" => [12, "Au"], "TBq" => [12, "Bq"],
|
971
|
-
"TC" => [12, "C"], "TF" => [12, "F"], "TG" => [12, "G"],
|
972
|
-
"TGal" => [12, "Gal"], "TGy" => [12, "Gy"], "TH" => [12, "H"],
|
973
|
-
"THg" => [12, "Hg"], "THz" => [12, "Hz"], "TJ" => [12, "J"],
|
974
|
-
"TK" => [12, "K"], "TL" => [12, "L"], "TN" => [12, "N"],
|
975
|
-
"TP" => [12, "P"], "TPa" => [12, "Pa"], "TS" => [12, "S"],
|
976
|
-
"TSt" => [12, "St"], "TSv" => [12, "Sv"], "TT" => [12, "T"],
|
977
|
-
"TV" => [12, "V"], "TW" => [12, "W"], "TWb" => [12, "Wb"],
|
978
|
-
"Ta" => [12, "a"], "Tac" => [12, "ac"], "Tatm" => [12, "atm"],
|
979
|
-
"Tbar" => [12, "bar"], "Tcal" => [12, "cal"],
|
980
|
-
"Tconventional_mercury" => [12, "conventional_mercury"],
|
981
|
-
"Td" => [12, "d"], "TdegC" => [12, "degC"], "TdegF" => [12, "degF"],
|
982
|
-
"Tdeg_C" => [12, "deg_C"], "Tdeg_F" => [12, "deg_F"],
|
983
|
-
"TdegreeC" => [12, "degreeC"], "TdegreeF" => [12, "degreeF"],
|
984
|
-
"Tdegree_C" => [12, "degree_C"], "Tdegree_E" => [12, "degree_E"],
|
985
|
-
"Tdegree_F" => [12, "degree_F"], "Tdegree_N" => [12, "degree_N"],
|
986
|
-
"Tdegree_R" => [12, "degree_R"], "Tdegree_S" => [12, "degree_S"],
|
987
|
-
"Tdegree_W" => [12, "degree_W"], "Tdegree_c" => [12, "degree_c"],
|
988
|
-
"Tdegree_east" => [12, "degree_east"],
|
989
|
-
"Tdegree_f" => [12, "degree_f"],
|
990
|
-
"Tdegree_north" => [12, "degree_north"],
|
991
|
-
"Tdegree_south" => [12, "degree_south"],
|
992
|
-
"Tdegree_west" => [12, "degree_west"],
|
993
|
-
"Tdegrees_east" => [12, "degrees_east"],
|
994
|
-
"Tdegrees_north" => [12, "degrees_north"],
|
995
|
-
"Tdegrees_south" => [12, "degrees_south"],
|
996
|
-
"Tdegrees_west" => [12, "degrees_west"], "Tdyn" => [12, "dyn"],
|
997
|
-
"Terg" => [12, "erg"], "Tforce" => [12, "force"], "Tg" => [12, "g"],
|
998
|
-
"Tgravity" => [12, "gravity"], "Th" => [12, "h"],
|
999
|
-
"Thg" => [12, "hg"], "Thr" => [12, "hr"], "Tin" => [12, "in"],
|
1000
|
-
"Tkg" => [12, "kg"], "Tkgf" => [12, "kgf"], "Tkph" => [12, "kph"],
|
1001
|
-
"Tlb" => [12, "lb"], "Tlm" => [12, "lm"], "Tlx" => [12, "lx"],
|
1002
|
-
"Tly" => [12, "ly"], "Tm" => [12, "m"], "Tmb" => [12, "mb"],
|
1003
|
-
"Tmercury" => [12, "mercury"], "Tmgal" => [12, "mgal"],
|
1004
|
-
"Tmin" => [12, "min"], "Tmol" => [12, "mol"], "Tmon" => [12, "mon"],
|
1005
|
-
"Tmph" => [12, "mph"], "Tohm" => [12, "ohm"], "Toz" => [12, "oz"],
|
1006
|
-
"Tpc" => [12, "pc"], "Tpercent" => [12, "percent"],
|
1007
|
-
"Tpermil" => [12, "permil"], "Tpsi" => [12, "psi"],
|
1008
|
-
"Trad" => [12, "rad"], "Ts" => [12, "s"], "Tsr" => [12, "sr"],
|
1009
|
-
"Tt" => [12, "t"], "Tyr" => [12, "yr"], "a%" => [-18, "%"],
|
1010
|
-
"aA" => [-18, "A"], "aAu" => [-18, "Au"], "aBq" => [-18, "Bq"],
|
1011
|
-
"aC" => [-18, "C"], "aF" => [-18, "F"], "aG" => [-18, "G"],
|
1012
|
-
"aGal" => [-18, "Gal"], "aGy" => [-18, "Gy"], "aH" => [-18, "H"],
|
1013
|
-
"aHg" => [-18, "Hg"], "aHz" => [-18, "Hz"], "aJ" => [-18, "J"],
|
1014
|
-
"aK" => [-18, "K"], "aL" => [-18, "L"], "aN" => [-18, "N"],
|
1015
|
-
"aP" => [-18, "P"], "aPa" => [-18, "Pa"], "aS" => [-18, "S"],
|
1016
|
-
"aSt" => [-18, "St"], "aSv" => [-18, "Sv"], "aT" => [-18, "T"],
|
1017
|
-
"aV" => [-18, "V"], "aW" => [-18, "W"], "aWb" => [-18, "Wb"],
|
1018
|
-
"aa" => [-18, "a"], "aac" => [-18, "ac"], "aatm" => [-18, "atm"],
|
1019
|
-
"abar" => [-18, "bar"], "acal" => [-18, "cal"],
|
1020
|
-
"aconventional_mercury" => [-18, "conventional_mercury"],
|
1021
|
-
"acres" => [0, "acre"], "ad" => [-18, "d"],
|
1022
|
-
"adegC" => [-18, "degC"], "adegF" => [-18, "degF"],
|
1023
|
-
"adeg_C" => [-18, "deg_C"], "adeg_F" => [-18, "deg_F"],
|
1024
|
-
"adegreeC" => [-18, "degreeC"], "adegreeF" => [-18, "degreeF"],
|
1025
|
-
"adegree_C" => [-18, "degree_C"], "adegree_E" => [-18, "degree_E"],
|
1026
|
-
"adegree_F" => [-18, "degree_F"], "adegree_N" => [-18, "degree_N"],
|
1027
|
-
"adegree_R" => [-18, "degree_R"], "adegree_S" => [-18, "degree_S"],
|
1028
|
-
"adegree_W" => [-18, "degree_W"], "adegree_c" => [-18, "degree_c"],
|
1029
|
-
"adegree_east" => [-18, "degree_east"],
|
1030
|
-
"adegree_f" => [-18, "degree_f"],
|
1031
|
-
"adegree_north" => [-18, "degree_north"],
|
1032
|
-
"adegree_south" => [-18, "degree_south"],
|
1033
|
-
"adegree_west" => [-18, "degree_west"],
|
1034
|
-
"adegrees_east" => [-18, "degrees_east"],
|
1035
|
-
"adegrees_north" => [-18, "degrees_north"],
|
1036
|
-
"adegrees_south" => [-18, "degrees_south"],
|
1037
|
-
"adegrees_west" => [-18, "degrees_west"], "adyn" => [-18, "dyn"],
|
1038
|
-
"aerg" => [-18, "erg"], "aforce" => [-18, "force"],
|
1039
|
-
"ag" => [-18, "g"], "agravity" => [-18, "gravity"],
|
1040
|
-
"ah" => [-18, "h"], "ahg" => [-18, "hg"], "ahr" => [-18, "hr"],
|
1041
|
-
"ain" => [-18, "in"], "akg" => [-18, "kg"], "akgf" => [-18, "kgf"],
|
1042
|
-
"akph" => [-18, "kph"], "alb" => [-18, "lb"], "alm" => [-18, "lm"],
|
1043
|
-
"alx" => [-18, "lx"], "aly" => [-18, "ly"], "am" => [-18, "m"],
|
1044
|
-
"amb" => [-18, "mb"], "amercury" => [-18, "mercury"],
|
1045
|
-
"amgal" => [-18, "mgal"], "amin" => [-18, "min"],
|
1046
|
-
"amol" => [-18, "mol"], "amon" => [-18, "mon"],
|
1047
|
-
"amperes" => [0, "ampere"], "amph" => [-18, "mph"],
|
1048
|
-
"angstroms" => [0, "angstrom"],
|
1049
|
-
"angulars_degree" => [0, "angular_degree"],
|
1050
|
-
"angulars_minute" => [0, "angular_minute"],
|
1051
|
-
"angulars_second" => [0, "angular_second"], "aohm" => [-18, "ohm"],
|
1052
|
-
"aoz" => [-18, "oz"], "apc" => [-18, "pc"],
|
1053
|
-
"apercent" => [-18, "percent"], "apermil" => [-18, "permil"],
|
1054
|
-
"apsi" => [-18, "psi"], "arad" => [-18, "rad"],
|
1055
|
-
"ares" => [0, "are"], "as" => [-18, "s"], "asr" => [-18, "sr"],
|
1056
|
-
"at" => [-18, "t"], "atmospheres" => [0, "atmosphere"],
|
1057
|
-
"attoCelsius" => [-18, "Celsius"],
|
1058
|
-
"attoFahrenheit" => [-18, "Fahrenheit"],
|
1059
|
-
"attoJulian_year" => [-18, "Julian_year"],
|
1060
|
-
"attoPascal" => [-18, "Pascal"], "attoacre" => [-18, "acre"],
|
1061
|
-
"attoampere" => [-18, "ampere"], "attoangstrom" => [-18, "angstrom"],
|
1062
|
-
"attoangular_degree" => [-18, "angular_degree"],
|
1063
|
-
"attoangular_minute" => [-18, "angular_minute"],
|
1064
|
-
"attoangular_second" => [-18, "angular_second"],
|
1065
|
-
"attoare" => [-18, "are"], "attoatmosphere" => [-18, "atmosphere"],
|
1066
|
-
"attocalorie" => [-18, "calorie"], "attocelsius" => [-18, "celsius"],
|
1067
|
-
"attocentigrade" => [-18, "centigrade"],
|
1068
|
-
"attocentury" => [-18, "century"], "attochain" => [-18, "chain"],
|
1069
|
-
"attocommon_year" => [-18, "common_year"],
|
1070
|
-
"attocoulomb" => [-18, "coulomb"], "attoday" => [-18, "day"],
|
1071
|
-
"attodegK" => [-18, "degK"], "attodeg_K" => [-18, "deg_K"],
|
1072
|
-
"attodegree" => [-18, "degree"], "attodegreeK" => [-18, "degreeK"],
|
1073
|
-
"attodyne" => [-18, "dyne"], "attoerg" => [-18, "erg"],
|
1074
|
-
"attofahrenheit" => [-18, "fahrenheit"],
|
1075
|
-
"attofarad" => [-18, "farad"], "attofermi" => [-18, "fermi"],
|
1076
|
-
"attogal" => [-18, "gal"], "attogauss" => [-18, "gauss"],
|
1077
|
-
"attogram" => [-18, "gram"], "attohectare" => [-18, "hectare"],
|
1078
|
-
"attohertz" => [-18, "hertz"], "attohour" => [-18, "hour"],
|
1079
|
-
"attoinch" => [-18, "inch"], "attojoule" => [-18, "joule"],
|
1080
|
-
"attokelvin" => [-18, "kelvin"], "attokilogram" => [-18, "kilogram"],
|
1081
|
-
"attoknot" => [-18, "knot"], "attolitre" => [-18, "litre"],
|
1082
|
-
"attometer" => [-18, "meter"], "attometre" => [-18, "metre"],
|
1083
|
-
"attomicron" => [-18, "micron"], "attomile" => [-18, "mile"],
|
1084
|
-
"attomillibar" => [-18, "millibar"], "attominute" => [-18, "minute"],
|
1085
|
-
"attominute_angle" => [-18, "minute_angle"],
|
1086
|
-
"attomole" => [-18, "mole"], "attomonth" => [-18, "month"],
|
1087
|
-
"attonewton" => [-18, "newton"], "attoounce" => [-18, "ounce"],
|
1088
|
-
"attoparsec" => [-18, "parsec"], "attopascal" => [-18, "pascal"],
|
1089
|
-
"attopentad" => [-18, "pentad"], "attopoise" => [-18, "poise"],
|
1090
|
-
"attopound" => [-18, "pound"], "attoradian" => [-18, "radian"],
|
1091
|
-
"attosecond" => [-18, "second"],
|
1092
|
-
"attosecond_angle" => [-18, "second_angle"],
|
1093
|
-
"attosteradian" => [-18, "steradian"],
|
1094
|
-
"attostokes" => [-18, "stokes"], "attotesla" => [-18, "tesla"],
|
1095
|
-
"attoton" => [-18, "ton"], "attotonne" => [-18, "tonne"],
|
1096
|
-
"attotorr" => [-18, "torr"], "attovolt" => [-18, "volt"],
|
1097
|
-
"attowatt" => [-18, "watt"], "attoweber" => [-18, "weber"],
|
1098
|
-
"attoyard" => [-18, "yard"], "attoyd" => [-18, "yd"],
|
1099
|
-
"attoyear" => [-18, "year"], "ayr" => [-18, "yr"],
|
1100
|
-
"c%" => [-2, "%"], "cA" => [-2, "A"], "cAu" => [-2, "Au"],
|
1101
|
-
"cBq" => [-2, "Bq"], "cC" => [-2, "C"], "cF" => [-2, "F"],
|
1102
|
-
"cG" => [-2, "G"], "cGal" => [-2, "Gal"], "cGy" => [-2, "Gy"],
|
1103
|
-
"cH" => [-2, "H"], "cHg" => [-2, "Hg"], "cHz" => [-2, "Hz"],
|
1104
|
-
"cJ" => [-2, "J"], "cK" => [-2, "K"], "cL" => [-2, "L"],
|
1105
|
-
"cN" => [-2, "N"], "cP" => [-2, "P"], "cPa" => [-2, "Pa"],
|
1106
|
-
"cS" => [-2, "S"], "cSt" => [-2, "St"], "cSv" => [-2, "Sv"],
|
1107
|
-
"cT" => [-2, "T"], "cV" => [-2, "V"], "cW" => [-2, "W"],
|
1108
|
-
"cWb" => [-2, "Wb"], "ca" => [-2, "a"], "cac" => [-2, "ac"],
|
1109
|
-
"calories" => [0, "calorie"], "catm" => [-2, "atm"],
|
1110
|
-
"cbar" => [-2, "bar"], "ccal" => [-2, "cal"],
|
1111
|
-
"cconventional_mercury" => [-2, "conventional_mercury"],
|
1112
|
-
"cd" => [-2, "d"], "cdegC" => [-2, "degC"], "cdegF" => [-2, "degF"],
|
1113
|
-
"cdeg_C" => [-2, "deg_C"], "cdeg_F" => [-2, "deg_F"],
|
1114
|
-
"cdegreeC" => [-2, "degreeC"], "cdegreeF" => [-2, "degreeF"],
|
1115
|
-
"cdegree_C" => [-2, "degree_C"], "cdegree_E" => [-2, "degree_E"],
|
1116
|
-
"cdegree_F" => [-2, "degree_F"], "cdegree_N" => [-2, "degree_N"],
|
1117
|
-
"cdegree_R" => [-2, "degree_R"], "cdegree_S" => [-2, "degree_S"],
|
1118
|
-
"cdegree_W" => [-2, "degree_W"], "cdegree_c" => [-2, "degree_c"],
|
1119
|
-
"cdegree_east" => [-2, "degree_east"],
|
1120
|
-
"cdegree_f" => [-2, "degree_f"],
|
1121
|
-
"cdegree_north" => [-2, "degree_north"],
|
1122
|
-
"cdegree_south" => [-2, "degree_south"],
|
1123
|
-
"cdegree_west" => [-2, "degree_west"],
|
1124
|
-
"cdegrees_east" => [-2, "degrees_east"],
|
1125
|
-
"cdegrees_north" => [-2, "degrees_north"],
|
1126
|
-
"cdegrees_south" => [-2, "degrees_south"],
|
1127
|
-
"cdegrees_west" => [-2, "degrees_west"], "cdyn" => [-2, "dyn"],
|
1128
|
-
"celsiuses" => [0, "celsius"], "centiCelsius" => [-2, "Celsius"],
|
1129
|
-
"centiFahrenheit" => [-2, "Fahrenheit"],
|
1130
|
-
"centiJulian_year" => [-2, "Julian_year"],
|
1131
|
-
"centiPascal" => [-2, "Pascal"], "centiacre" => [-2, "acre"],
|
1132
|
-
"centiampere" => [-2, "ampere"], "centiangstrom" => [-2, "angstrom"],
|
1133
|
-
"centiangular_degree" => [-2, "angular_degree"],
|
1134
|
-
"centiangular_minute" => [-2, "angular_minute"],
|
1135
|
-
"centiangular_second" => [-2, "angular_second"],
|
1136
|
-
"centiare" => [-2, "are"], "centiatmosphere" => [-2, "atmosphere"],
|
1137
|
-
"centicalorie" => [-2, "calorie"], "centicelsius" => [-2, "celsius"],
|
1138
|
-
"centicentigrade" => [-2, "centigrade"],
|
1139
|
-
"centicentury" => [-2, "century"], "centichain" => [-2, "chain"],
|
1140
|
-
"centicommon_year" => [-2, "common_year"],
|
1141
|
-
"centicoulomb" => [-2, "coulomb"], "centiday" => [-2, "day"],
|
1142
|
-
"centidegK" => [-2, "degK"], "centideg_K" => [-2, "deg_K"],
|
1143
|
-
"centidegree" => [-2, "degree"], "centidegreeK" => [-2, "degreeK"],
|
1144
|
-
"centidyne" => [-2, "dyne"], "centierg" => [-2, "erg"],
|
1145
|
-
"centifahrenheit" => [-2, "fahrenheit"],
|
1146
|
-
"centifarad" => [-2, "farad"], "centifermi" => [-2, "fermi"],
|
1147
|
-
"centigal" => [-2, "gal"], "centigauss" => [-2, "gauss"],
|
1148
|
-
"centigrades" => [0, "centigrade"], "centigram" => [-2, "gram"],
|
1149
|
-
"centihectare" => [-2, "hectare"], "centihertz" => [-2, "hertz"],
|
1150
|
-
"centihour" => [-2, "hour"], "centiinch" => [-2, "inch"],
|
1151
|
-
"centijoule" => [-2, "joule"], "centikelvin" => [-2, "kelvin"],
|
1152
|
-
"centikilogram" => [-2, "kilogram"], "centiknot" => [-2, "knot"],
|
1153
|
-
"centilitre" => [-2, "litre"], "centimeter" => [-2, "meter"],
|
1154
|
-
"centimetre" => [-2, "metre"], "centimicron" => [-2, "micron"],
|
1155
|
-
"centimile" => [-2, "mile"], "centimillibar" => [-2, "millibar"],
|
1156
|
-
"centiminute" => [-2, "minute"],
|
1157
|
-
"centiminute_angle" => [-2, "minute_angle"],
|
1158
|
-
"centimole" => [-2, "mole"], "centimonth" => [-2, "month"],
|
1159
|
-
"centinewton" => [-2, "newton"], "centiounce" => [-2, "ounce"],
|
1160
|
-
"centiparsec" => [-2, "parsec"], "centipascal" => [-2, "pascal"],
|
1161
|
-
"centipentad" => [-2, "pentad"], "centipoise" => [-2, "poise"],
|
1162
|
-
"centipound" => [-2, "pound"], "centiradian" => [-2, "radian"],
|
1163
|
-
"centisecond" => [-2, "second"],
|
1164
|
-
"centisecond_angle" => [-2, "second_angle"],
|
1165
|
-
"centisteradian" => [-2, "steradian"],
|
1166
|
-
"centistokes" => [-2, "stokes"], "centitesla" => [-2, "tesla"],
|
1167
|
-
"centiton" => [-2, "ton"], "centitonne" => [-2, "tonne"],
|
1168
|
-
"centitorr" => [-2, "torr"], "centivolt" => [-2, "volt"],
|
1169
|
-
"centiwatt" => [-2, "watt"], "centiweber" => [-2, "weber"],
|
1170
|
-
"centiyard" => [-2, "yard"], "centiyd" => [-2, "yd"],
|
1171
|
-
"centiyear" => [-2, "year"], "centuries" => [0, "century"],
|
1172
|
-
"cerg" => [-2, "erg"], "cforce" => [-2, "force"], "cg" => [-2, "g"],
|
1173
|
-
"cgravity" => [-2, "gravity"], "ch" => [-2, "h"],
|
1174
|
-
"chains" => [0, "chain"], "chg" => [-2, "hg"], "chr" => [-2, "hr"],
|
1175
|
-
"cin" => [-2, "in"], "ckg" => [-2, "kg"], "ckgf" => [-2, "kgf"],
|
1176
|
-
"ckph" => [-2, "kph"], "clb" => [-2, "lb"], "clm" => [-2, "lm"],
|
1177
|
-
"clx" => [-2, "lx"], "cly" => [-2, "ly"], "cm" => [-2, "m"],
|
1178
|
-
"cmb" => [-2, "mb"], "cmercury" => [-2, "mercury"],
|
1179
|
-
"cmgal" => [-2, "mgal"], "cmin" => [-2, "min"],
|
1180
|
-
"cmol" => [-2, "mol"], "cmon" => [-2, "mon"], "cmph" => [-2, "mph"],
|
1181
|
-
"cohm" => [-2, "ohm"], "commons_year" => [0, "common_year"],
|
1182
|
-
"coulombs" => [0, "coulomb"], "coz" => [-2, "oz"],
|
1183
|
-
"cpc" => [-2, "pc"], "cpercent" => [-2, "percent"],
|
1184
|
-
"cpermil" => [-2, "permil"], "cpsi" => [-2, "psi"],
|
1185
|
-
"crad" => [-2, "rad"], "cs" => [-2, "s"], "csr" => [-2, "sr"],
|
1186
|
-
"ct" => [-2, "t"], "cyr" => [-2, "yr"], "d%" => [-1, "%"],
|
1187
|
-
"dA" => [-1, "A"], "dAu" => [-1, "Au"], "dBq" => [-1, "Bq"],
|
1188
|
-
"dC" => [-1, "C"], "dF" => [-1, "F"], "dG" => [-1, "G"],
|
1189
|
-
"dGal" => [-1, "Gal"], "dGy" => [-1, "Gy"], "dH" => [-1, "H"],
|
1190
|
-
"dHg" => [-1, "Hg"], "dHz" => [-1, "Hz"], "dJ" => [-1, "J"],
|
1191
|
-
"dK" => [-1, "K"], "dL" => [-1, "L"], "dN" => [-1, "N"],
|
1192
|
-
"dP" => [-1, "P"], "dPa" => [-1, "Pa"], "dS" => [-1, "S"],
|
1193
|
-
"dSt" => [-1, "St"], "dSv" => [-1, "Sv"], "dT" => [-1, "T"],
|
1194
|
-
"dV" => [-1, "V"], "dW" => [-1, "W"], "dWb" => [-1, "Wb"],
|
1195
|
-
"da" => [-1, "a"], "da%" => [1, "%"], "daA" => [1, "A"],
|
1196
|
-
"daAu" => [1, "Au"], "daBq" => [1, "Bq"], "daC" => [1, "C"],
|
1197
|
-
"daF" => [1, "F"], "daG" => [1, "G"], "daGal" => [1, "Gal"],
|
1198
|
-
"daGy" => [1, "Gy"], "daH" => [1, "H"], "daHg" => [1, "Hg"],
|
1199
|
-
"daHz" => [1, "Hz"], "daJ" => [1, "J"], "daK" => [1, "K"],
|
1200
|
-
"daL" => [1, "L"], "daN" => [1, "N"], "daP" => [1, "P"],
|
1201
|
-
"daPa" => [1, "Pa"], "daS" => [1, "S"], "daSt" => [1, "St"],
|
1202
|
-
"daSv" => [1, "Sv"], "daT" => [1, "T"], "daV" => [1, "V"],
|
1203
|
-
"daW" => [1, "W"], "daWb" => [1, "Wb"], "daa" => [1, "a"],
|
1204
|
-
"daac" => [1, "ac"], "daatm" => [1, "atm"], "dabar" => [1, "bar"],
|
1205
|
-
"dac" => [-1, "ac"], "dacal" => [1, "cal"],
|
1206
|
-
"daconventional_mercury" => [1, "conventional_mercury"],
|
1207
|
-
"dad" => [1, "d"], "dadegC" => [1, "degC"], "dadegF" => [1, "degF"],
|
1208
|
-
"dadeg_C" => [1, "deg_C"], "dadeg_F" => [1, "deg_F"],
|
1209
|
-
"dadegreeC" => [1, "degreeC"], "dadegreeF" => [1, "degreeF"],
|
1210
|
-
"dadegree_C" => [1, "degree_C"], "dadegree_E" => [1, "degree_E"],
|
1211
|
-
"dadegree_F" => [1, "degree_F"], "dadegree_N" => [1, "degree_N"],
|
1212
|
-
"dadegree_R" => [1, "degree_R"], "dadegree_S" => [1, "degree_S"],
|
1213
|
-
"dadegree_W" => [1, "degree_W"], "dadegree_c" => [1, "degree_c"],
|
1214
|
-
"dadegree_east" => [1, "degree_east"],
|
1215
|
-
"dadegree_f" => [1, "degree_f"],
|
1216
|
-
"dadegree_north" => [1, "degree_north"],
|
1217
|
-
"dadegree_south" => [1, "degree_south"],
|
1218
|
-
"dadegree_west" => [1, "degree_west"],
|
1219
|
-
"dadegrees_east" => [1, "degrees_east"],
|
1220
|
-
"dadegrees_north" => [1, "degrees_north"],
|
1221
|
-
"dadegrees_south" => [1, "degrees_south"],
|
1222
|
-
"dadegrees_west" => [1, "degrees_west"], "dadyn" => [1, "dyn"],
|
1223
|
-
"daerg" => [1, "erg"], "daforce" => [1, "force"], "dag" => [1, "g"],
|
1224
|
-
"dagravity" => [1, "gravity"], "dah" => [1, "h"],
|
1225
|
-
"dahg" => [1, "hg"], "dahr" => [1, "hr"], "dain" => [1, "in"],
|
1226
|
-
"dakg" => [1, "kg"], "dakgf" => [1, "kgf"], "dakph" => [1, "kph"],
|
1227
|
-
"dalb" => [1, "lb"], "dalm" => [1, "lm"], "dalx" => [1, "lx"],
|
1228
|
-
"daly" => [1, "ly"], "dam" => [1, "m"], "damb" => [1, "mb"],
|
1229
|
-
"damercury" => [1, "mercury"], "damgal" => [1, "mgal"],
|
1230
|
-
"damin" => [1, "min"], "damol" => [1, "mol"], "damon" => [1, "mon"],
|
1231
|
-
"damph" => [1, "mph"], "daohm" => [1, "ohm"], "daoz" => [1, "oz"],
|
1232
|
-
"dapc" => [1, "pc"], "dapercent" => [1, "percent"],
|
1233
|
-
"dapermil" => [1, "permil"], "dapsi" => [1, "psi"],
|
1234
|
-
"darad" => [1, "rad"], "das" => [1, "s"], "dasr" => [1, "sr"],
|
1235
|
-
"dat" => [1, "t"], "datm" => [-1, "atm"], "dayr" => [1, "yr"],
|
1236
|
-
"days" => [0, "day"], "dbar" => [-1, "bar"], "dcal" => [-1, "cal"],
|
1237
|
-
"dconventional_mercury" => [-1, "conventional_mercury"],
|
1238
|
-
"dd" => [-1, "d"], "ddegC" => [-1, "degC"], "ddegF" => [-1, "degF"],
|
1239
|
-
"ddeg_C" => [-1, "deg_C"], "ddeg_F" => [-1, "deg_F"],
|
1240
|
-
"ddegreeC" => [-1, "degreeC"], "ddegreeF" => [-1, "degreeF"],
|
1241
|
-
"ddegree_C" => [-1, "degree_C"], "ddegree_E" => [-1, "degree_E"],
|
1242
|
-
"ddegree_F" => [-1, "degree_F"], "ddegree_N" => [-1, "degree_N"],
|
1243
|
-
"ddegree_R" => [-1, "degree_R"], "ddegree_S" => [-1, "degree_S"],
|
1244
|
-
"ddegree_W" => [-1, "degree_W"], "ddegree_c" => [-1, "degree_c"],
|
1245
|
-
"ddegree_east" => [-1, "degree_east"],
|
1246
|
-
"ddegree_f" => [-1, "degree_f"],
|
1247
|
-
"ddegree_north" => [-1, "degree_north"],
|
1248
|
-
"ddegree_south" => [-1, "degree_south"],
|
1249
|
-
"ddegree_west" => [-1, "degree_west"],
|
1250
|
-
"ddegrees_east" => [-1, "degrees_east"],
|
1251
|
-
"ddegrees_north" => [-1, "degrees_north"],
|
1252
|
-
"ddegrees_south" => [-1, "degrees_south"],
|
1253
|
-
"ddegrees_west" => [-1, "degrees_west"], "ddyn" => [-1, "dyn"],
|
1254
|
-
"decaCelsius" => [1, "Celsius"],
|
1255
|
-
"decaFahrenheit" => [1, "Fahrenheit"],
|
1256
|
-
"decaJulian_year" => [1, "Julian_year"],
|
1257
|
-
"decaPascal" => [1, "Pascal"], "decaacre" => [1, "acre"],
|
1258
|
-
"decaampere" => [1, "ampere"], "decaangstrom" => [1, "angstrom"],
|
1259
|
-
"decaangular_degree" => [1, "angular_degree"],
|
1260
|
-
"decaangular_minute" => [1, "angular_minute"],
|
1261
|
-
"decaangular_second" => [1, "angular_second"],
|
1262
|
-
"decaare" => [1, "are"], "decaatmosphere" => [1, "atmosphere"],
|
1263
|
-
"decacalorie" => [1, "calorie"], "decacelsius" => [1, "celsius"],
|
1264
|
-
"decacentigrade" => [1, "centigrade"],
|
1265
|
-
"decacentury" => [1, "century"], "decachain" => [1, "chain"],
|
1266
|
-
"decacommon_year" => [1, "common_year"],
|
1267
|
-
"decacoulomb" => [1, "coulomb"], "decaday" => [1, "day"],
|
1268
|
-
"decadegK" => [1, "degK"], "decadeg_K" => [1, "deg_K"],
|
1269
|
-
"decadegree" => [1, "degree"], "decadegreeK" => [1, "degreeK"],
|
1270
|
-
"decadyne" => [1, "dyne"], "decaerg" => [1, "erg"],
|
1271
|
-
"decafahrenheit" => [1, "fahrenheit"], "decafarad" => [1, "farad"],
|
1272
|
-
"decafermi" => [1, "fermi"], "decagal" => [1, "gal"],
|
1273
|
-
"decagauss" => [1, "gauss"], "decagram" => [1, "gram"],
|
1274
|
-
"decahectare" => [1, "hectare"], "decahertz" => [1, "hertz"],
|
1275
|
-
"decahour" => [1, "hour"], "decainch" => [1, "inch"],
|
1276
|
-
"decajoule" => [1, "joule"], "decakelvin" => [1, "kelvin"],
|
1277
|
-
"decakilogram" => [1, "kilogram"], "decaknot" => [1, "knot"],
|
1278
|
-
"decalitre" => [1, "litre"], "decameter" => [1, "meter"],
|
1279
|
-
"decametre" => [1, "metre"], "decamicron" => [1, "micron"],
|
1280
|
-
"decamile" => [1, "mile"], "decamillibar" => [1, "millibar"],
|
1281
|
-
"decaminute" => [1, "minute"],
|
1282
|
-
"decaminute_angle" => [1, "minute_angle"], "decamole" => [1, "mole"],
|
1283
|
-
"decamonth" => [1, "month"], "decanewton" => [1, "newton"],
|
1284
|
-
"decaounce" => [1, "ounce"], "decaparsec" => [1, "parsec"],
|
1285
|
-
"decapascal" => [1, "pascal"], "decapentad" => [1, "pentad"],
|
1286
|
-
"decapoise" => [1, "poise"], "decapound" => [1, "pound"],
|
1287
|
-
"decaradian" => [1, "radian"], "decasecond" => [1, "second"],
|
1288
|
-
"decasecond_angle" => [1, "second_angle"],
|
1289
|
-
"decasteradian" => [1, "steradian"], "decastokes" => [1, "stokes"],
|
1290
|
-
"decatesla" => [1, "tesla"], "decaton" => [1, "ton"],
|
1291
|
-
"decatonne" => [1, "tonne"], "decatorr" => [1, "torr"],
|
1292
|
-
"decavolt" => [1, "volt"], "decawatt" => [1, "watt"],
|
1293
|
-
"decaweber" => [1, "weber"], "decayard" => [1, "yard"],
|
1294
|
-
"decayd" => [1, "yd"], "decayear" => [1, "year"],
|
1295
|
-
"deciCelsius" => [-1, "Celsius"],
|
1296
|
-
"deciFahrenheit" => [-1, "Fahrenheit"],
|
1297
|
-
"deciJulian_year" => [-1, "Julian_year"],
|
1298
|
-
"deciPascal" => [-1, "Pascal"], "deciacre" => [-1, "acre"],
|
1299
|
-
"deciampere" => [-1, "ampere"], "deciangstrom" => [-1, "angstrom"],
|
1300
|
-
"deciangular_degree" => [-1, "angular_degree"],
|
1301
|
-
"deciangular_minute" => [-1, "angular_minute"],
|
1302
|
-
"deciangular_second" => [-1, "angular_second"],
|
1303
|
-
"deciare" => [-1, "are"], "deciatmosphere" => [-1, "atmosphere"],
|
1304
|
-
"decicalorie" => [-1, "calorie"], "decicelsius" => [-1, "celsius"],
|
1305
|
-
"decicentigrade" => [-1, "centigrade"],
|
1306
|
-
"decicentury" => [-1, "century"], "decichain" => [-1, "chain"],
|
1307
|
-
"decicommon_year" => [-1, "common_year"],
|
1308
|
-
"decicoulomb" => [-1, "coulomb"], "deciday" => [-1, "day"],
|
1309
|
-
"decidegK" => [-1, "degK"], "decideg_K" => [-1, "deg_K"],
|
1310
|
-
"decidegree" => [-1, "degree"], "decidegreeK" => [-1, "degreeK"],
|
1311
|
-
"decidyne" => [-1, "dyne"], "decierg" => [-1, "erg"],
|
1312
|
-
"decifahrenheit" => [-1, "fahrenheit"], "decifarad" => [-1, "farad"],
|
1313
|
-
"decifermi" => [-1, "fermi"], "decigal" => [-1, "gal"],
|
1314
|
-
"decigauss" => [-1, "gauss"], "decigram" => [-1, "gram"],
|
1315
|
-
"decihectare" => [-1, "hectare"], "decihertz" => [-1, "hertz"],
|
1316
|
-
"decihour" => [-1, "hour"], "deciinch" => [-1, "inch"],
|
1317
|
-
"decijoule" => [-1, "joule"], "decikelvin" => [-1, "kelvin"],
|
1318
|
-
"decikilogram" => [-1, "kilogram"], "deciknot" => [-1, "knot"],
|
1319
|
-
"decilitre" => [-1, "litre"], "decimeter" => [-1, "meter"],
|
1320
|
-
"decimetre" => [-1, "metre"], "decimicron" => [-1, "micron"],
|
1321
|
-
"decimile" => [-1, "mile"], "decimillibar" => [-1, "millibar"],
|
1322
|
-
"deciminute" => [-1, "minute"],
|
1323
|
-
"deciminute_angle" => [-1, "minute_angle"],
|
1324
|
-
"decimole" => [-1, "mole"], "decimonth" => [-1, "month"],
|
1325
|
-
"decinewton" => [-1, "newton"], "deciounce" => [-1, "ounce"],
|
1326
|
-
"deciparsec" => [-1, "parsec"], "decipascal" => [-1, "pascal"],
|
1327
|
-
"decipentad" => [-1, "pentad"], "decipoise" => [-1, "poise"],
|
1328
|
-
"decipound" => [-1, "pound"], "deciradian" => [-1, "radian"],
|
1329
|
-
"decisecond" => [-1, "second"],
|
1330
|
-
"decisecond_angle" => [-1, "second_angle"],
|
1331
|
-
"decisteradian" => [-1, "steradian"], "decistokes" => [-1, "stokes"],
|
1332
|
-
"decitesla" => [-1, "tesla"], "deciton" => [-1, "ton"],
|
1333
|
-
"decitonne" => [-1, "tonne"], "decitorr" => [-1, "torr"],
|
1334
|
-
"decivolt" => [-1, "volt"], "deciwatt" => [-1, "watt"],
|
1335
|
-
"deciweber" => [-1, "weber"], "deciyard" => [-1, "yard"],
|
1336
|
-
"deciyd" => [-1, "yd"], "deciyear" => [-1, "year"],
|
1337
|
-
"degKs" => [0, "degK"], "degreeKs" => [0, "degreeK"],
|
1338
|
-
"degrees" => [0, "degree"], "degs_K" => [0, "deg_K"],
|
1339
|
-
"derg" => [-1, "erg"], "dforce" => [-1, "force"], "dg" => [-1, "g"],
|
1340
|
-
"dgravity" => [-1, "gravity"], "dh" => [-1, "h"],
|
1341
|
-
"dhg" => [-1, "hg"], "dhr" => [-1, "hr"], "din" => [-1, "in"],
|
1342
|
-
"dkg" => [-1, "kg"], "dkgf" => [-1, "kgf"], "dkph" => [-1, "kph"],
|
1343
|
-
"dlb" => [-1, "lb"], "dlm" => [-1, "lm"], "dlx" => [-1, "lx"],
|
1344
|
-
"dly" => [-1, "ly"], "dm" => [-1, "m"], "dmb" => [-1, "mb"],
|
1345
|
-
"dmercury" => [-1, "mercury"], "dmgal" => [-1, "mgal"],
|
1346
|
-
"dmin" => [-1, "min"], "dmol" => [-1, "mol"], "dmon" => [-1, "mon"],
|
1347
|
-
"dmph" => [-1, "mph"], "dohm" => [-1, "ohm"], "doz" => [-1, "oz"],
|
1348
|
-
"dpc" => [-1, "pc"], "dpercent" => [-1, "percent"],
|
1349
|
-
"dpermil" => [-1, "permil"], "dpsi" => [-1, "psi"],
|
1350
|
-
"drad" => [-1, "rad"], "ds" => [-1, "s"], "dsr" => [-1, "sr"],
|
1351
|
-
"dt" => [-1, "t"], "dynes" => [0, "dyne"], "dyr" => [-1, "yr"],
|
1352
|
-
"ergs" => [0, "erg"], "exaCelsius" => [18, "Celsius"],
|
1353
|
-
"exaFahrenheit" => [18, "Fahrenheit"],
|
1354
|
-
"exaJulian_year" => [18, "Julian_year"],
|
1355
|
-
"exaPascal" => [18, "Pascal"], "exaacre" => [18, "acre"],
|
1356
|
-
"exaampere" => [18, "ampere"], "exaangstrom" => [18, "angstrom"],
|
1357
|
-
"exaangular_degree" => [18, "angular_degree"],
|
1358
|
-
"exaangular_minute" => [18, "angular_minute"],
|
1359
|
-
"exaangular_second" => [18, "angular_second"],
|
1360
|
-
"exaare" => [18, "are"], "exaatmosphere" => [18, "atmosphere"],
|
1361
|
-
"exacalorie" => [18, "calorie"], "exacelsius" => [18, "celsius"],
|
1362
|
-
"exacentigrade" => [18, "centigrade"],
|
1363
|
-
"exacentury" => [18, "century"], "exachain" => [18, "chain"],
|
1364
|
-
"exacommon_year" => [18, "common_year"],
|
1365
|
-
"exacoulomb" => [18, "coulomb"], "exaday" => [18, "day"],
|
1366
|
-
"exadegK" => [18, "degK"], "exadeg_K" => [18, "deg_K"],
|
1367
|
-
"exadegree" => [18, "degree"], "exadegreeK" => [18, "degreeK"],
|
1368
|
-
"exadyne" => [18, "dyne"], "exaerg" => [18, "erg"],
|
1369
|
-
"exafahrenheit" => [18, "fahrenheit"], "exafarad" => [18, "farad"],
|
1370
|
-
"exafermi" => [18, "fermi"], "exagal" => [18, "gal"],
|
1371
|
-
"exagauss" => [18, "gauss"], "exagram" => [18, "gram"],
|
1372
|
-
"exahectare" => [18, "hectare"], "exahertz" => [18, "hertz"],
|
1373
|
-
"exahour" => [18, "hour"], "exainch" => [18, "inch"],
|
1374
|
-
"exajoule" => [18, "joule"], "exakelvin" => [18, "kelvin"],
|
1375
|
-
"exakilogram" => [18, "kilogram"], "exaknot" => [18, "knot"],
|
1376
|
-
"exalitre" => [18, "litre"], "exameter" => [18, "meter"],
|
1377
|
-
"exametre" => [18, "metre"], "examicron" => [18, "micron"],
|
1378
|
-
"examile" => [18, "mile"], "examillibar" => [18, "millibar"],
|
1379
|
-
"examinute" => [18, "minute"],
|
1380
|
-
"examinute_angle" => [18, "minute_angle"], "examole" => [18, "mole"],
|
1381
|
-
"examonth" => [18, "month"], "exanewton" => [18, "newton"],
|
1382
|
-
"exaounce" => [18, "ounce"], "exaparsec" => [18, "parsec"],
|
1383
|
-
"exapascal" => [18, "pascal"], "exapentad" => [18, "pentad"],
|
1384
|
-
"exapoise" => [18, "poise"], "exapound" => [18, "pound"],
|
1385
|
-
"exaradian" => [18, "radian"], "exasecond" => [18, "second"],
|
1386
|
-
"exasecond_angle" => [18, "second_angle"],
|
1387
|
-
"exasteradian" => [18, "steradian"], "exastokes" => [18, "stokes"],
|
1388
|
-
"exatesla" => [18, "tesla"], "exaton" => [18, "ton"],
|
1389
|
-
"exatonne" => [18, "tonne"], "exatorr" => [18, "torr"],
|
1390
|
-
"exavolt" => [18, "volt"], "exawatt" => [18, "watt"],
|
1391
|
-
"exaweber" => [18, "weber"], "exayard" => [18, "yard"],
|
1392
|
-
"exayd" => [18, "yd"], "exayear" => [18, "year"],
|
1393
|
-
"f%" => [-15, "%"], "fA" => [-15, "A"], "fAu" => [-15, "Au"],
|
1394
|
-
"fBq" => [-15, "Bq"], "fC" => [-15, "C"], "fF" => [-15, "F"],
|
1395
|
-
"fG" => [-15, "G"], "fGal" => [-15, "Gal"], "fGy" => [-15, "Gy"],
|
1396
|
-
"fH" => [-15, "H"], "fHg" => [-15, "Hg"], "fHz" => [-15, "Hz"],
|
1397
|
-
"fJ" => [-15, "J"], "fK" => [-15, "K"], "fL" => [-15, "L"],
|
1398
|
-
"fN" => [-15, "N"], "fP" => [-15, "P"], "fPa" => [-15, "Pa"],
|
1399
|
-
"fS" => [-15, "S"], "fSt" => [-15, "St"], "fSv" => [-15, "Sv"],
|
1400
|
-
"fT" => [-15, "T"], "fV" => [-15, "V"], "fW" => [-15, "W"],
|
1401
|
-
"fWb" => [-15, "Wb"], "fa" => [-15, "a"], "fac" => [-15, "ac"],
|
1402
|
-
"fahrenheits" => [0, "fahrenheit"], "farads" => [0, "farad"],
|
1403
|
-
"fatm" => [-15, "atm"], "fbar" => [-15, "bar"],
|
1404
|
-
"fcal" => [-15, "cal"],
|
1405
|
-
"fconventional_mercury" => [-15, "conventional_mercury"],
|
1406
|
-
"fd" => [-15, "d"], "fdegC" => [-15, "degC"],
|
1407
|
-
"fdegF" => [-15, "degF"], "fdeg_C" => [-15, "deg_C"],
|
1408
|
-
"fdeg_F" => [-15, "deg_F"], "fdegreeC" => [-15, "degreeC"],
|
1409
|
-
"fdegreeF" => [-15, "degreeF"], "fdegree_C" => [-15, "degree_C"],
|
1410
|
-
"fdegree_E" => [-15, "degree_E"], "fdegree_F" => [-15, "degree_F"],
|
1411
|
-
"fdegree_N" => [-15, "degree_N"], "fdegree_R" => [-15, "degree_R"],
|
1412
|
-
"fdegree_S" => [-15, "degree_S"], "fdegree_W" => [-15, "degree_W"],
|
1413
|
-
"fdegree_c" => [-15, "degree_c"],
|
1414
|
-
"fdegree_east" => [-15, "degree_east"],
|
1415
|
-
"fdegree_f" => [-15, "degree_f"],
|
1416
|
-
"fdegree_north" => [-15, "degree_north"],
|
1417
|
-
"fdegree_south" => [-15, "degree_south"],
|
1418
|
-
"fdegree_west" => [-15, "degree_west"],
|
1419
|
-
"fdegrees_east" => [-15, "degrees_east"],
|
1420
|
-
"fdegrees_north" => [-15, "degrees_north"],
|
1421
|
-
"fdegrees_south" => [-15, "degrees_south"],
|
1422
|
-
"fdegrees_west" => [-15, "degrees_west"], "fdyn" => [-15, "dyn"],
|
1423
|
-
"femtoCelsius" => [-15, "Celsius"],
|
1424
|
-
"femtoFahrenheit" => [-15, "Fahrenheit"],
|
1425
|
-
"femtoJulian_year" => [-15, "Julian_year"],
|
1426
|
-
"femtoPascal" => [-15, "Pascal"], "femtoacre" => [-15, "acre"],
|
1427
|
-
"femtoampere" => [-15, "ampere"],
|
1428
|
-
"femtoangstrom" => [-15, "angstrom"],
|
1429
|
-
"femtoangular_degree" => [-15, "angular_degree"],
|
1430
|
-
"femtoangular_minute" => [-15, "angular_minute"],
|
1431
|
-
"femtoangular_second" => [-15, "angular_second"],
|
1432
|
-
"femtoare" => [-15, "are"], "femtoatmosphere" => [-15, "atmosphere"],
|
1433
|
-
"femtocalorie" => [-15, "calorie"],
|
1434
|
-
"femtocelsius" => [-15, "celsius"],
|
1435
|
-
"femtocentigrade" => [-15, "centigrade"],
|
1436
|
-
"femtocentury" => [-15, "century"], "femtochain" => [-15, "chain"],
|
1437
|
-
"femtocommon_year" => [-15, "common_year"],
|
1438
|
-
"femtocoulomb" => [-15, "coulomb"], "femtoday" => [-15, "day"],
|
1439
|
-
"femtodegK" => [-15, "degK"], "femtodeg_K" => [-15, "deg_K"],
|
1440
|
-
"femtodegree" => [-15, "degree"], "femtodegreeK" => [-15, "degreeK"],
|
1441
|
-
"femtodyne" => [-15, "dyne"], "femtoerg" => [-15, "erg"],
|
1442
|
-
"femtofahrenheit" => [-15, "fahrenheit"],
|
1443
|
-
"femtofarad" => [-15, "farad"], "femtofermi" => [-15, "fermi"],
|
1444
|
-
"femtogal" => [-15, "gal"], "femtogauss" => [-15, "gauss"],
|
1445
|
-
"femtogram" => [-15, "gram"], "femtohectare" => [-15, "hectare"],
|
1446
|
-
"femtohertz" => [-15, "hertz"], "femtohour" => [-15, "hour"],
|
1447
|
-
"femtoinch" => [-15, "inch"], "femtojoule" => [-15, "joule"],
|
1448
|
-
"femtokelvin" => [-15, "kelvin"],
|
1449
|
-
"femtokilogram" => [-15, "kilogram"], "femtoknot" => [-15, "knot"],
|
1450
|
-
"femtolitre" => [-15, "litre"], "femtometer" => [-15, "meter"],
|
1451
|
-
"femtometre" => [-15, "metre"], "femtomicron" => [-15, "micron"],
|
1452
|
-
"femtomile" => [-15, "mile"], "femtomillibar" => [-15, "millibar"],
|
1453
|
-
"femtominute" => [-15, "minute"],
|
1454
|
-
"femtominute_angle" => [-15, "minute_angle"],
|
1455
|
-
"femtomole" => [-15, "mole"], "femtomonth" => [-15, "month"],
|
1456
|
-
"femtonewton" => [-15, "newton"], "femtoounce" => [-15, "ounce"],
|
1457
|
-
"femtoparsec" => [-15, "parsec"], "femtopascal" => [-15, "pascal"],
|
1458
|
-
"femtopentad" => [-15, "pentad"], "femtopoise" => [-15, "poise"],
|
1459
|
-
"femtopound" => [-15, "pound"], "femtoradian" => [-15, "radian"],
|
1460
|
-
"femtosecond" => [-15, "second"],
|
1461
|
-
"femtosecond_angle" => [-15, "second_angle"],
|
1462
|
-
"femtosteradian" => [-15, "steradian"],
|
1463
|
-
"femtostokes" => [-15, "stokes"], "femtotesla" => [-15, "tesla"],
|
1464
|
-
"femtoton" => [-15, "ton"], "femtotonne" => [-15, "tonne"],
|
1465
|
-
"femtotorr" => [-15, "torr"], "femtovolt" => [-15, "volt"],
|
1466
|
-
"femtowatt" => [-15, "watt"], "femtoweber" => [-15, "weber"],
|
1467
|
-
"femtoyard" => [-15, "yard"], "femtoyd" => [-15, "yd"],
|
1468
|
-
"femtoyear" => [-15, "year"], "ferg" => [-15, "erg"],
|
1469
|
-
"fermis" => [0, "fermi"], "fforce" => [-15, "force"],
|
1470
|
-
"fg" => [-15, "g"], "fgravity" => [-15, "gravity"],
|
1471
|
-
"fh" => [-15, "h"], "fhg" => [-15, "hg"], "fhr" => [-15, "hr"],
|
1472
|
-
"fin" => [-15, "in"], "fkg" => [-15, "kg"], "fkgf" => [-15, "kgf"],
|
1473
|
-
"fkph" => [-15, "kph"], "flb" => [-15, "lb"], "flm" => [-15, "lm"],
|
1474
|
-
"flx" => [-15, "lx"], "fly" => [-15, "ly"], "fm" => [-15, "m"],
|
1475
|
-
"fmb" => [-15, "mb"], "fmercury" => [-15, "mercury"],
|
1476
|
-
"fmgal" => [-15, "mgal"], "fmin" => [-15, "min"],
|
1477
|
-
"fmol" => [-15, "mol"], "fmon" => [-15, "mon"],
|
1478
|
-
"fmph" => [-15, "mph"], "fohm" => [-15, "ohm"],
|
1479
|
-
"foz" => [-15, "oz"], "fpc" => [-15, "pc"],
|
1480
|
-
"fpercent" => [-15, "percent"], "fpermil" => [-15, "permil"],
|
1481
|
-
"fpsi" => [-15, "psi"], "frad" => [-15, "rad"], "fs" => [-15, "s"],
|
1482
|
-
"fsr" => [-15, "sr"], "ft" => [-15, "t"], "fyr" => [-15, "yr"],
|
1483
|
-
"gals" => [0, "gal"], "gausses" => [0, "gauss"],
|
1484
|
-
"gigaCelsius" => [9, "Celsius"],
|
1485
|
-
"gigaFahrenheit" => [9, "Fahrenheit"],
|
1486
|
-
"gigaJulian_year" => [9, "Julian_year"],
|
1487
|
-
"gigaPascal" => [9, "Pascal"], "gigaacre" => [9, "acre"],
|
1488
|
-
"gigaampere" => [9, "ampere"], "gigaangstrom" => [9, "angstrom"],
|
1489
|
-
"gigaangular_degree" => [9, "angular_degree"],
|
1490
|
-
"gigaangular_minute" => [9, "angular_minute"],
|
1491
|
-
"gigaangular_second" => [9, "angular_second"],
|
1492
|
-
"gigaare" => [9, "are"], "gigaatmosphere" => [9, "atmosphere"],
|
1493
|
-
"gigacalorie" => [9, "calorie"], "gigacelsius" => [9, "celsius"],
|
1494
|
-
"gigacentigrade" => [9, "centigrade"],
|
1495
|
-
"gigacentury" => [9, "century"], "gigachain" => [9, "chain"],
|
1496
|
-
"gigacommon_year" => [9, "common_year"],
|
1497
|
-
"gigacoulomb" => [9, "coulomb"], "gigaday" => [9, "day"],
|
1498
|
-
"gigadegK" => [9, "degK"], "gigadeg_K" => [9, "deg_K"],
|
1499
|
-
"gigadegree" => [9, "degree"], "gigadegreeK" => [9, "degreeK"],
|
1500
|
-
"gigadyne" => [9, "dyne"], "gigaerg" => [9, "erg"],
|
1501
|
-
"gigafahrenheit" => [9, "fahrenheit"], "gigafarad" => [9, "farad"],
|
1502
|
-
"gigafermi" => [9, "fermi"], "gigagal" => [9, "gal"],
|
1503
|
-
"gigagauss" => [9, "gauss"], "gigagram" => [9, "gram"],
|
1504
|
-
"gigahectare" => [9, "hectare"], "gigahertz" => [9, "hertz"],
|
1505
|
-
"gigahour" => [9, "hour"], "gigainch" => [9, "inch"],
|
1506
|
-
"gigajoule" => [9, "joule"], "gigakelvin" => [9, "kelvin"],
|
1507
|
-
"gigakilogram" => [9, "kilogram"], "gigaknot" => [9, "knot"],
|
1508
|
-
"gigalitre" => [9, "litre"], "gigameter" => [9, "meter"],
|
1509
|
-
"gigametre" => [9, "metre"], "gigamicron" => [9, "micron"],
|
1510
|
-
"gigamile" => [9, "mile"], "gigamillibar" => [9, "millibar"],
|
1511
|
-
"gigaminute" => [9, "minute"],
|
1512
|
-
"gigaminute_angle" => [9, "minute_angle"], "gigamole" => [9, "mole"],
|
1513
|
-
"gigamonth" => [9, "month"], "giganewton" => [9, "newton"],
|
1514
|
-
"gigaounce" => [9, "ounce"], "gigaparsec" => [9, "parsec"],
|
1515
|
-
"gigapascal" => [9, "pascal"], "gigapentad" => [9, "pentad"],
|
1516
|
-
"gigapoise" => [9, "poise"], "gigapound" => [9, "pound"],
|
1517
|
-
"gigaradian" => [9, "radian"], "gigasecond" => [9, "second"],
|
1518
|
-
"gigasecond_angle" => [9, "second_angle"],
|
1519
|
-
"gigasteradian" => [9, "steradian"], "gigastokes" => [9, "stokes"],
|
1520
|
-
"gigatesla" => [9, "tesla"], "gigaton" => [9, "ton"],
|
1521
|
-
"gigatonne" => [9, "tonne"], "gigatorr" => [9, "torr"],
|
1522
|
-
"gigavolt" => [9, "volt"], "gigawatt" => [9, "watt"],
|
1523
|
-
"gigaweber" => [9, "weber"], "gigayard" => [9, "yard"],
|
1524
|
-
"gigayd" => [9, "yd"], "gigayear" => [9, "year"],
|
1525
|
-
"grams" => [0, "gram"], "h%" => [2, "%"], "hA" => [2, "A"],
|
1526
|
-
"hAu" => [2, "Au"], "hBq" => [2, "Bq"], "hC" => [2, "C"],
|
1527
|
-
"hF" => [2, "F"], "hG" => [2, "G"], "hGal" => [2, "Gal"],
|
1528
|
-
"hGy" => [2, "Gy"], "hH" => [2, "H"], "hHg" => [2, "Hg"],
|
1529
|
-
"hHz" => [2, "Hz"], "hJ" => [2, "J"], "hK" => [2, "K"],
|
1530
|
-
"hL" => [2, "L"], "hN" => [2, "N"], "hP" => [2, "P"],
|
1531
|
-
"hPa" => [2, "Pa"], "hS" => [2, "S"], "hSt" => [2, "St"],
|
1532
|
-
"hSv" => [2, "Sv"], "hT" => [2, "T"], "hV" => [2, "V"],
|
1533
|
-
"hW" => [2, "W"], "hWb" => [2, "Wb"], "ha" => [2, "a"],
|
1534
|
-
"hac" => [2, "ac"], "hatm" => [2, "atm"], "hbar" => [2, "bar"],
|
1535
|
-
"hcal" => [2, "cal"],
|
1536
|
-
"hconventional_mercury" => [2, "conventional_mercury"],
|
1537
|
-
"hd" => [2, "d"], "hdegC" => [2, "degC"], "hdegF" => [2, "degF"],
|
1538
|
-
"hdeg_C" => [2, "deg_C"], "hdeg_F" => [2, "deg_F"],
|
1539
|
-
"hdegreeC" => [2, "degreeC"], "hdegreeF" => [2, "degreeF"],
|
1540
|
-
"hdegree_C" => [2, "degree_C"], "hdegree_E" => [2, "degree_E"],
|
1541
|
-
"hdegree_F" => [2, "degree_F"], "hdegree_N" => [2, "degree_N"],
|
1542
|
-
"hdegree_R" => [2, "degree_R"], "hdegree_S" => [2, "degree_S"],
|
1543
|
-
"hdegree_W" => [2, "degree_W"], "hdegree_c" => [2, "degree_c"],
|
1544
|
-
"hdegree_east" => [2, "degree_east"], "hdegree_f" => [2, "degree_f"],
|
1545
|
-
"hdegree_north" => [2, "degree_north"],
|
1546
|
-
"hdegree_south" => [2, "degree_south"],
|
1547
|
-
"hdegree_west" => [2, "degree_west"],
|
1548
|
-
"hdegrees_east" => [2, "degrees_east"],
|
1549
|
-
"hdegrees_north" => [2, "degrees_north"],
|
1550
|
-
"hdegrees_south" => [2, "degrees_south"],
|
1551
|
-
"hdegrees_west" => [2, "degrees_west"], "hdyn" => [2, "dyn"],
|
1552
|
-
"hectares" => [0, "hectare"], "hectoCelsius" => [2, "Celsius"],
|
1553
|
-
"hectoFahrenheit" => [2, "Fahrenheit"],
|
1554
|
-
"hectoJulian_year" => [2, "Julian_year"],
|
1555
|
-
"hectoPascal" => [2, "Pascal"], "hectoacre" => [2, "acre"],
|
1556
|
-
"hectoampere" => [2, "ampere"], "hectoangstrom" => [2, "angstrom"],
|
1557
|
-
"hectoangular_degree" => [2, "angular_degree"],
|
1558
|
-
"hectoangular_minute" => [2, "angular_minute"],
|
1559
|
-
"hectoangular_second" => [2, "angular_second"],
|
1560
|
-
"hectoare" => [2, "are"], "hectoatmosphere" => [2, "atmosphere"],
|
1561
|
-
"hectocalorie" => [2, "calorie"], "hectocelsius" => [2, "celsius"],
|
1562
|
-
"hectocentigrade" => [2, "centigrade"],
|
1563
|
-
"hectocentury" => [2, "century"], "hectochain" => [2, "chain"],
|
1564
|
-
"hectocommon_year" => [2, "common_year"],
|
1565
|
-
"hectocoulomb" => [2, "coulomb"], "hectoday" => [2, "day"],
|
1566
|
-
"hectodegK" => [2, "degK"], "hectodeg_K" => [2, "deg_K"],
|
1567
|
-
"hectodegree" => [2, "degree"], "hectodegreeK" => [2, "degreeK"],
|
1568
|
-
"hectodyne" => [2, "dyne"], "hectoerg" => [2, "erg"],
|
1569
|
-
"hectofahrenheit" => [2, "fahrenheit"], "hectofarad" => [2, "farad"],
|
1570
|
-
"hectofermi" => [2, "fermi"], "hectogal" => [2, "gal"],
|
1571
|
-
"hectogauss" => [2, "gauss"], "hectogram" => [2, "gram"],
|
1572
|
-
"hectohectare" => [2, "hectare"], "hectohertz" => [2, "hertz"],
|
1573
|
-
"hectohour" => [2, "hour"], "hectoinch" => [2, "inch"],
|
1574
|
-
"hectojoule" => [2, "joule"], "hectokelvin" => [2, "kelvin"],
|
1575
|
-
"hectokilogram" => [2, "kilogram"], "hectoknot" => [2, "knot"],
|
1576
|
-
"hectolitre" => [2, "litre"], "hectometer" => [2, "meter"],
|
1577
|
-
"hectometre" => [2, "metre"], "hectomicron" => [2, "micron"],
|
1578
|
-
"hectomile" => [2, "mile"], "hectomillibar" => [2, "millibar"],
|
1579
|
-
"hectominute" => [2, "minute"],
|
1580
|
-
"hectominute_angle" => [2, "minute_angle"],
|
1581
|
-
"hectomole" => [2, "mole"], "hectomonth" => [2, "month"],
|
1582
|
-
"hectonewton" => [2, "newton"], "hectoounce" => [2, "ounce"],
|
1583
|
-
"hectoparsec" => [2, "parsec"], "hectopascal" => [2, "pascal"],
|
1584
|
-
"hectopentad" => [2, "pentad"], "hectopoise" => [2, "poise"],
|
1585
|
-
"hectopound" => [2, "pound"], "hectoradian" => [2, "radian"],
|
1586
|
-
"hectosecond" => [2, "second"],
|
1587
|
-
"hectosecond_angle" => [2, "second_angle"],
|
1588
|
-
"hectosteradian" => [2, "steradian"], "hectostokes" => [2, "stokes"],
|
1589
|
-
"hectotesla" => [2, "tesla"], "hectoton" => [2, "ton"],
|
1590
|
-
"hectotonne" => [2, "tonne"], "hectotorr" => [2, "torr"],
|
1591
|
-
"hectovolt" => [2, "volt"], "hectowatt" => [2, "watt"],
|
1592
|
-
"hectoweber" => [2, "weber"], "hectoyard" => [2, "yard"],
|
1593
|
-
"hectoyd" => [2, "yd"], "hectoyear" => [2, "year"],
|
1594
|
-
"herg" => [2, "erg"], "hertzes" => [0, "hertz"],
|
1595
|
-
"hforce" => [2, "force"], "hg" => [2, "g"],
|
1596
|
-
"hgravity" => [2, "gravity"], "hh" => [2, "h"], "hhg" => [2, "hg"],
|
1597
|
-
"hhr" => [2, "hr"], "hin" => [2, "in"], "hkg" => [2, "kg"],
|
1598
|
-
"hkgf" => [2, "kgf"], "hkph" => [2, "kph"], "hlb" => [2, "lb"],
|
1599
|
-
"hlm" => [2, "lm"], "hlx" => [2, "lx"], "hly" => [2, "ly"],
|
1600
|
-
"hm" => [2, "m"], "hmb" => [2, "mb"], "hmercury" => [2, "mercury"],
|
1601
|
-
"hmgal" => [2, "mgal"], "hmin" => [2, "min"], "hmol" => [2, "mol"],
|
1602
|
-
"hmon" => [2, "mon"], "hmph" => [2, "mph"], "hohm" => [2, "ohm"],
|
1603
|
-
"hours" => [0, "hour"], "hoz" => [2, "oz"], "hpc" => [2, "pc"],
|
1604
|
-
"hpercent" => [2, "percent"], "hpermil" => [2, "permil"],
|
1605
|
-
"hpsi" => [2, "psi"], "hrad" => [2, "rad"], "hs" => [2, "s"],
|
1606
|
-
"hsr" => [2, "sr"], "ht" => [2, "t"], "hyr" => [2, "yr"],
|
1607
|
-
"inchs" => [0, "inch"], "joules" => [0, "joule"], "k%" => [3, "%"],
|
1608
|
-
"kA" => [3, "A"], "kAu" => [3, "Au"], "kBq" => [3, "Bq"],
|
1609
|
-
"kC" => [3, "C"], "kF" => [3, "F"], "kG" => [3, "G"],
|
1610
|
-
"kGal" => [3, "Gal"], "kGy" => [3, "Gy"], "kH" => [3, "H"],
|
1611
|
-
"kHg" => [3, "Hg"], "kHz" => [3, "Hz"], "kJ" => [3, "J"],
|
1612
|
-
"kK" => [3, "K"], "kL" => [3, "L"], "kN" => [3, "N"],
|
1613
|
-
"kP" => [3, "P"], "kPa" => [3, "Pa"], "kS" => [3, "S"],
|
1614
|
-
"kSt" => [3, "St"], "kSv" => [3, "Sv"], "kT" => [3, "T"],
|
1615
|
-
"kV" => [3, "V"], "kW" => [3, "W"], "kWb" => [3, "Wb"],
|
1616
|
-
"ka" => [3, "a"], "kac" => [3, "ac"], "katm" => [3, "atm"],
|
1617
|
-
"kbar" => [3, "bar"], "kcal" => [3, "cal"],
|
1618
|
-
"kconventional_mercury" => [3, "conventional_mercury"],
|
1619
|
-
"kd" => [3, "d"], "kdegC" => [3, "degC"], "kdegF" => [3, "degF"],
|
1620
|
-
"kdeg_C" => [3, "deg_C"], "kdeg_F" => [3, "deg_F"],
|
1621
|
-
"kdegreeC" => [3, "degreeC"], "kdegreeF" => [3, "degreeF"],
|
1622
|
-
"kdegree_C" => [3, "degree_C"], "kdegree_E" => [3, "degree_E"],
|
1623
|
-
"kdegree_F" => [3, "degree_F"], "kdegree_N" => [3, "degree_N"],
|
1624
|
-
"kdegree_R" => [3, "degree_R"], "kdegree_S" => [3, "degree_S"],
|
1625
|
-
"kdegree_W" => [3, "degree_W"], "kdegree_c" => [3, "degree_c"],
|
1626
|
-
"kdegree_east" => [3, "degree_east"], "kdegree_f" => [3, "degree_f"],
|
1627
|
-
"kdegree_north" => [3, "degree_north"],
|
1628
|
-
"kdegree_south" => [3, "degree_south"],
|
1629
|
-
"kdegree_west" => [3, "degree_west"],
|
1630
|
-
"kdegrees_east" => [3, "degrees_east"],
|
1631
|
-
"kdegrees_north" => [3, "degrees_north"],
|
1632
|
-
"kdegrees_south" => [3, "degrees_south"],
|
1633
|
-
"kdegrees_west" => [3, "degrees_west"], "kdyn" => [3, "dyn"],
|
1634
|
-
"kelvins" => [0, "kelvin"], "kerg" => [3, "erg"],
|
1635
|
-
"kforce" => [3, "force"], "kgravity" => [3, "gravity"],
|
1636
|
-
"kh" => [3, "h"], "khg" => [3, "hg"], "khr" => [3, "hr"],
|
1637
|
-
"kiloCelsius" => [3, "Celsius"],
|
1638
|
-
"kiloFahrenheit" => [3, "Fahrenheit"],
|
1639
|
-
"kiloJulian_year" => [3, "Julian_year"],
|
1640
|
-
"kiloPascal" => [3, "Pascal"], "kiloacre" => [3, "acre"],
|
1641
|
-
"kiloampere" => [3, "ampere"], "kiloangstrom" => [3, "angstrom"],
|
1642
|
-
"kiloangular_degree" => [3, "angular_degree"],
|
1643
|
-
"kiloangular_minute" => [3, "angular_minute"],
|
1644
|
-
"kiloangular_second" => [3, "angular_second"],
|
1645
|
-
"kiloare" => [3, "are"], "kiloatmosphere" => [3, "atmosphere"],
|
1646
|
-
"kilocalorie" => [3, "calorie"], "kilocelsius" => [3, "celsius"],
|
1647
|
-
"kilocentigrade" => [3, "centigrade"],
|
1648
|
-
"kilocentury" => [3, "century"], "kilochain" => [3, "chain"],
|
1649
|
-
"kilocommon_year" => [3, "common_year"],
|
1650
|
-
"kilocoulomb" => [3, "coulomb"], "kiloday" => [3, "day"],
|
1651
|
-
"kilodegK" => [3, "degK"], "kilodeg_K" => [3, "deg_K"],
|
1652
|
-
"kilodegree" => [3, "degree"], "kilodegreeK" => [3, "degreeK"],
|
1653
|
-
"kilodyne" => [3, "dyne"], "kiloerg" => [3, "erg"],
|
1654
|
-
"kilofahrenheit" => [3, "fahrenheit"], "kilofarad" => [3, "farad"],
|
1655
|
-
"kilofermi" => [3, "fermi"], "kilogal" => [3, "gal"],
|
1656
|
-
"kilogauss" => [3, "gauss"], "kilogram" => [3, "gram"],
|
1657
|
-
"kilograms" => [0, "kilogram"], "kilohectare" => [3, "hectare"],
|
1658
|
-
"kilohertz" => [3, "hertz"], "kilohour" => [3, "hour"],
|
1659
|
-
"kiloinch" => [3, "inch"], "kilojoule" => [3, "joule"],
|
1660
|
-
"kilokelvin" => [3, "kelvin"], "kilokilogram" => [3, "kilogram"],
|
1661
|
-
"kiloknot" => [3, "knot"], "kilolitre" => [3, "litre"],
|
1662
|
-
"kilometer" => [3, "meter"], "kilometre" => [3, "metre"],
|
1663
|
-
"kilomicron" => [3, "micron"], "kilomile" => [3, "mile"],
|
1664
|
-
"kilomillibar" => [3, "millibar"], "kilominute" => [3, "minute"],
|
1665
|
-
"kilominute_angle" => [3, "minute_angle"], "kilomole" => [3, "mole"],
|
1666
|
-
"kilomonth" => [3, "month"], "kilonewton" => [3, "newton"],
|
1667
|
-
"kiloounce" => [3, "ounce"], "kiloparsec" => [3, "parsec"],
|
1668
|
-
"kilopascal" => [3, "pascal"], "kilopentad" => [3, "pentad"],
|
1669
|
-
"kilopoise" => [3, "poise"], "kilopound" => [3, "pound"],
|
1670
|
-
"kiloradian" => [3, "radian"], "kilosecond" => [3, "second"],
|
1671
|
-
"kilosecond_angle" => [3, "second_angle"],
|
1672
|
-
"kilosteradian" => [3, "steradian"], "kilostokes" => [3, "stokes"],
|
1673
|
-
"kilotesla" => [3, "tesla"], "kiloton" => [3, "ton"],
|
1674
|
-
"kilotonne" => [3, "tonne"], "kilotorr" => [3, "torr"],
|
1675
|
-
"kilovolt" => [3, "volt"], "kilowatt" => [3, "watt"],
|
1676
|
-
"kiloweber" => [3, "weber"], "kiloyard" => [3, "yard"],
|
1677
|
-
"kiloyd" => [3, "yd"], "kiloyear" => [3, "year"],
|
1678
|
-
"kin" => [3, "in"], "kkg" => [3, "kg"], "kkgf" => [3, "kgf"],
|
1679
|
-
"kkph" => [3, "kph"], "klb" => [3, "lb"], "klm" => [3, "lm"],
|
1680
|
-
"klx" => [3, "lx"], "kly" => [3, "ly"], "km" => [3, "m"],
|
1681
|
-
"kmb" => [3, "mb"], "kmercury" => [3, "mercury"],
|
1682
|
-
"kmgal" => [3, "mgal"], "kmin" => [3, "min"], "kmol" => [3, "mol"],
|
1683
|
-
"kmon" => [3, "mon"], "kmph" => [3, "mph"], "knots" => [0, "knot"],
|
1684
|
-
"kohm" => [3, "ohm"], "koz" => [3, "oz"], "kpc" => [3, "pc"],
|
1685
|
-
"kpercent" => [3, "percent"], "kpermil" => [3, "permil"],
|
1686
|
-
"kpsi" => [3, "psi"], "krad" => [3, "rad"], "ks" => [3, "s"],
|
1687
|
-
"ksr" => [3, "sr"], "kt" => [3, "t"], "kyr" => [3, "yr"],
|
1688
|
-
"litres" => [0, "litre"], "m%" => [-3, "%"], "mA" => [-3, "A"],
|
1689
|
-
"mAu" => [-3, "Au"], "mBq" => [-3, "Bq"], "mC" => [-3, "C"],
|
1690
|
-
"mF" => [-3, "F"], "mG" => [-3, "G"], "mGal" => [-3, "Gal"],
|
1691
|
-
"mGy" => [-3, "Gy"], "mH" => [-3, "H"], "mHg" => [-3, "Hg"],
|
1692
|
-
"mHz" => [-3, "Hz"], "mJ" => [-3, "J"], "mK" => [-3, "K"],
|
1693
|
-
"mL" => [-3, "L"], "mN" => [-3, "N"], "mP" => [-3, "P"],
|
1694
|
-
"mPa" => [-3, "Pa"], "mS" => [-3, "S"], "mSt" => [-3, "St"],
|
1695
|
-
"mSv" => [-3, "Sv"], "mT" => [-3, "T"], "mV" => [-3, "V"],
|
1696
|
-
"mW" => [-3, "W"], "mWb" => [-3, "Wb"], "ma" => [-3, "a"],
|
1697
|
-
"mac" => [-3, "ac"], "matm" => [-3, "atm"], "mbar" => [-3, "bar"],
|
1698
|
-
"mcal" => [-3, "cal"],
|
1699
|
-
"mconventional_mercury" => [-3, "conventional_mercury"],
|
1700
|
-
"md" => [-3, "d"], "mdegC" => [-3, "degC"], "mdegF" => [-3, "degF"],
|
1701
|
-
"mdeg_C" => [-3, "deg_C"], "mdeg_F" => [-3, "deg_F"],
|
1702
|
-
"mdegreeC" => [-3, "degreeC"], "mdegreeF" => [-3, "degreeF"],
|
1703
|
-
"mdegree_C" => [-3, "degree_C"], "mdegree_E" => [-3, "degree_E"],
|
1704
|
-
"mdegree_F" => [-3, "degree_F"], "mdegree_N" => [-3, "degree_N"],
|
1705
|
-
"mdegree_R" => [-3, "degree_R"], "mdegree_S" => [-3, "degree_S"],
|
1706
|
-
"mdegree_W" => [-3, "degree_W"], "mdegree_c" => [-3, "degree_c"],
|
1707
|
-
"mdegree_east" => [-3, "degree_east"],
|
1708
|
-
"mdegree_f" => [-3, "degree_f"],
|
1709
|
-
"mdegree_north" => [-3, "degree_north"],
|
1710
|
-
"mdegree_south" => [-3, "degree_south"],
|
1711
|
-
"mdegree_west" => [-3, "degree_west"],
|
1712
|
-
"mdegrees_east" => [-3, "degrees_east"],
|
1713
|
-
"mdegrees_north" => [-3, "degrees_north"],
|
1714
|
-
"mdegrees_south" => [-3, "degrees_south"],
|
1715
|
-
"mdegrees_west" => [-3, "degrees_west"], "mdyn" => [-3, "dyn"],
|
1716
|
-
"megaCelsius" => [6, "Celsius"],
|
1717
|
-
"megaFahrenheit" => [6, "Fahrenheit"],
|
1718
|
-
"megaJulian_year" => [6, "Julian_year"],
|
1719
|
-
"megaPascal" => [6, "Pascal"], "megaacre" => [6, "acre"],
|
1720
|
-
"megaampere" => [6, "ampere"], "megaangstrom" => [6, "angstrom"],
|
1721
|
-
"megaangular_degree" => [6, "angular_degree"],
|
1722
|
-
"megaangular_minute" => [6, "angular_minute"],
|
1723
|
-
"megaangular_second" => [6, "angular_second"],
|
1724
|
-
"megaare" => [6, "are"], "megaatmosphere" => [6, "atmosphere"],
|
1725
|
-
"megacalorie" => [6, "calorie"], "megacelsius" => [6, "celsius"],
|
1726
|
-
"megacentigrade" => [6, "centigrade"],
|
1727
|
-
"megacentury" => [6, "century"], "megachain" => [6, "chain"],
|
1728
|
-
"megacommon_year" => [6, "common_year"],
|
1729
|
-
"megacoulomb" => [6, "coulomb"], "megaday" => [6, "day"],
|
1730
|
-
"megadegK" => [6, "degK"], "megadeg_K" => [6, "deg_K"],
|
1731
|
-
"megadegree" => [6, "degree"], "megadegreeK" => [6, "degreeK"],
|
1732
|
-
"megadyne" => [6, "dyne"], "megaerg" => [6, "erg"],
|
1733
|
-
"megafahrenheit" => [6, "fahrenheit"], "megafarad" => [6, "farad"],
|
1734
|
-
"megafermi" => [6, "fermi"], "megagal" => [6, "gal"],
|
1735
|
-
"megagauss" => [6, "gauss"], "megagram" => [6, "gram"],
|
1736
|
-
"megahectare" => [6, "hectare"], "megahertz" => [6, "hertz"],
|
1737
|
-
"megahour" => [6, "hour"], "megainch" => [6, "inch"],
|
1738
|
-
"megajoule" => [6, "joule"], "megakelvin" => [6, "kelvin"],
|
1739
|
-
"megakilogram" => [6, "kilogram"], "megaknot" => [6, "knot"],
|
1740
|
-
"megalitre" => [6, "litre"], "megameter" => [6, "meter"],
|
1741
|
-
"megametre" => [6, "metre"], "megamicron" => [6, "micron"],
|
1742
|
-
"megamile" => [6, "mile"], "megamillibar" => [6, "millibar"],
|
1743
|
-
"megaminute" => [6, "minute"],
|
1744
|
-
"megaminute_angle" => [6, "minute_angle"], "megamole" => [6, "mole"],
|
1745
|
-
"megamonth" => [6, "month"], "meganewton" => [6, "newton"],
|
1746
|
-
"megaounce" => [6, "ounce"], "megaparsec" => [6, "parsec"],
|
1747
|
-
"megapascal" => [6, "pascal"], "megapentad" => [6, "pentad"],
|
1748
|
-
"megapoise" => [6, "poise"], "megapound" => [6, "pound"],
|
1749
|
-
"megaradian" => [6, "radian"], "megasecond" => [6, "second"],
|
1750
|
-
"megasecond_angle" => [6, "second_angle"],
|
1751
|
-
"megasteradian" => [6, "steradian"], "megastokes" => [6, "stokes"],
|
1752
|
-
"megatesla" => [6, "tesla"], "megaton" => [6, "ton"],
|
1753
|
-
"megatonne" => [6, "tonne"], "megatorr" => [6, "torr"],
|
1754
|
-
"megavolt" => [6, "volt"], "megawatt" => [6, "watt"],
|
1755
|
-
"megaweber" => [6, "weber"], "megayard" => [6, "yard"],
|
1756
|
-
"megayd" => [6, "yd"], "megayear" => [6, "year"],
|
1757
|
-
"merg" => [-3, "erg"], "meters" => [0, "meter"],
|
1758
|
-
"metres" => [0, "metre"], "mforce" => [-3, "force"],
|
1759
|
-
"mg" => [-3, "g"], "mgravity" => [-3, "gravity"], "mh" => [-3, "h"],
|
1760
|
-
"mhg" => [-3, "hg"], "mhr" => [-3, "hr"],
|
1761
|
-
"microCelsius" => [-6, "Celsius"],
|
1762
|
-
"microFahrenheit" => [-6, "Fahrenheit"],
|
1763
|
-
"microJulian_year" => [-6, "Julian_year"],
|
1764
|
-
"microPascal" => [-6, "Pascal"], "microacre" => [-6, "acre"],
|
1765
|
-
"microampere" => [-6, "ampere"], "microangstrom" => [-6, "angstrom"],
|
1766
|
-
"microangular_degree" => [-6, "angular_degree"],
|
1767
|
-
"microangular_minute" => [-6, "angular_minute"],
|
1768
|
-
"microangular_second" => [-6, "angular_second"],
|
1769
|
-
"microare" => [-6, "are"], "microatmosphere" => [-6, "atmosphere"],
|
1770
|
-
"microcalorie" => [-6, "calorie"], "microcelsius" => [-6, "celsius"],
|
1771
|
-
"microcentigrade" => [-6, "centigrade"],
|
1772
|
-
"microcentury" => [-6, "century"], "microchain" => [-6, "chain"],
|
1773
|
-
"microcommon_year" => [-6, "common_year"],
|
1774
|
-
"microcoulomb" => [-6, "coulomb"], "microday" => [-6, "day"],
|
1775
|
-
"microdegK" => [-6, "degK"], "microdeg_K" => [-6, "deg_K"],
|
1776
|
-
"microdegree" => [-6, "degree"], "microdegreeK" => [-6, "degreeK"],
|
1777
|
-
"microdyne" => [-6, "dyne"], "microerg" => [-6, "erg"],
|
1778
|
-
"microfahrenheit" => [-6, "fahrenheit"],
|
1779
|
-
"microfarad" => [-6, "farad"], "microfermi" => [-6, "fermi"],
|
1780
|
-
"microgal" => [-6, "gal"], "microgauss" => [-6, "gauss"],
|
1781
|
-
"microgram" => [-6, "gram"], "microhectare" => [-6, "hectare"],
|
1782
|
-
"microhertz" => [-6, "hertz"], "microhour" => [-6, "hour"],
|
1783
|
-
"microinch" => [-6, "inch"], "microjoule" => [-6, "joule"],
|
1784
|
-
"microkelvin" => [-6, "kelvin"], "microkilogram" => [-6, "kilogram"],
|
1785
|
-
"microknot" => [-6, "knot"], "microlitre" => [-6, "litre"],
|
1786
|
-
"micrometer" => [-6, "meter"], "micrometre" => [-6, "metre"],
|
1787
|
-
"micromicron" => [-6, "micron"], "micromile" => [-6, "mile"],
|
1788
|
-
"micromillibar" => [-6, "millibar"], "microminute" => [-6, "minute"],
|
1789
|
-
"microminute_angle" => [-6, "minute_angle"],
|
1790
|
-
"micromole" => [-6, "mole"], "micromonth" => [-6, "month"],
|
1791
|
-
"micronewton" => [-6, "newton"], "microns" => [0, "micron"],
|
1792
|
-
"microounce" => [-6, "ounce"], "microparsec" => [-6, "parsec"],
|
1793
|
-
"micropascal" => [-6, "pascal"], "micropentad" => [-6, "pentad"],
|
1794
|
-
"micropoise" => [-6, "poise"], "micropound" => [-6, "pound"],
|
1795
|
-
"microradian" => [-6, "radian"], "microsecond" => [-6, "second"],
|
1796
|
-
"microsecond_angle" => [-6, "second_angle"],
|
1797
|
-
"microsteradian" => [-6, "steradian"],
|
1798
|
-
"microstokes" => [-6, "stokes"], "microtesla" => [-6, "tesla"],
|
1799
|
-
"microton" => [-6, "ton"], "microtonne" => [-6, "tonne"],
|
1800
|
-
"microtorr" => [-6, "torr"], "microvolt" => [-6, "volt"],
|
1801
|
-
"microwatt" => [-6, "watt"], "microweber" => [-6, "weber"],
|
1802
|
-
"microyard" => [-6, "yard"], "microyd" => [-6, "yd"],
|
1803
|
-
"microyear" => [-6, "year"], "miles" => [0, "mile"],
|
1804
|
-
"milliCelsius" => [-3, "Celsius"],
|
1805
|
-
"milliFahrenheit" => [-3, "Fahrenheit"],
|
1806
|
-
"milliJulian_year" => [-3, "Julian_year"],
|
1807
|
-
"milliPascal" => [-3, "Pascal"], "milliacre" => [-3, "acre"],
|
1808
|
-
"milliampere" => [-3, "ampere"], "milliangstrom" => [-3, "angstrom"],
|
1809
|
-
"milliangular_degree" => [-3, "angular_degree"],
|
1810
|
-
"milliangular_minute" => [-3, "angular_minute"],
|
1811
|
-
"milliangular_second" => [-3, "angular_second"],
|
1812
|
-
"milliare" => [-3, "are"], "milliatmosphere" => [-3, "atmosphere"],
|
1813
|
-
"millibars" => [0, "millibar"], "millicalorie" => [-3, "calorie"],
|
1814
|
-
"millicelsius" => [-3, "celsius"],
|
1815
|
-
"millicentigrade" => [-3, "centigrade"],
|
1816
|
-
"millicentury" => [-3, "century"], "millichain" => [-3, "chain"],
|
1817
|
-
"millicommon_year" => [-3, "common_year"],
|
1818
|
-
"millicoulomb" => [-3, "coulomb"], "milliday" => [-3, "day"],
|
1819
|
-
"millidegK" => [-3, "degK"], "millideg_K" => [-3, "deg_K"],
|
1820
|
-
"millidegree" => [-3, "degree"], "millidegreeK" => [-3, "degreeK"],
|
1821
|
-
"millidyne" => [-3, "dyne"], "millierg" => [-3, "erg"],
|
1822
|
-
"millifahrenheit" => [-3, "fahrenheit"],
|
1823
|
-
"millifarad" => [-3, "farad"], "millifermi" => [-3, "fermi"],
|
1824
|
-
"milligal" => [-3, "gal"], "milligauss" => [-3, "gauss"],
|
1825
|
-
"milligram" => [-3, "gram"], "millihectare" => [-3, "hectare"],
|
1826
|
-
"millihertz" => [-3, "hertz"], "millihour" => [-3, "hour"],
|
1827
|
-
"milliinch" => [-3, "inch"], "millijoule" => [-3, "joule"],
|
1828
|
-
"millikelvin" => [-3, "kelvin"], "millikilogram" => [-3, "kilogram"],
|
1829
|
-
"milliknot" => [-3, "knot"], "millilitre" => [-3, "litre"],
|
1830
|
-
"millimeter" => [-3, "meter"], "millimetre" => [-3, "metre"],
|
1831
|
-
"millimicron" => [-3, "micron"], "millimile" => [-3, "mile"],
|
1832
|
-
"millimillibar" => [-3, "millibar"], "milliminute" => [-3, "minute"],
|
1833
|
-
"milliminute_angle" => [-3, "minute_angle"],
|
1834
|
-
"millimole" => [-3, "mole"], "millimonth" => [-3, "month"],
|
1835
|
-
"millinewton" => [-3, "newton"], "milliounce" => [-3, "ounce"],
|
1836
|
-
"milliparsec" => [-3, "parsec"], "millipascal" => [-3, "pascal"],
|
1837
|
-
"millipentad" => [-3, "pentad"], "millipoise" => [-3, "poise"],
|
1838
|
-
"millipound" => [-3, "pound"], "milliradian" => [-3, "radian"],
|
1839
|
-
"millisecond" => [-3, "second"],
|
1840
|
-
"millisecond_angle" => [-3, "second_angle"],
|
1841
|
-
"millisteradian" => [-3, "steradian"],
|
1842
|
-
"millistokes" => [-3, "stokes"], "millitesla" => [-3, "tesla"],
|
1843
|
-
"milliton" => [-3, "ton"], "millitonne" => [-3, "tonne"],
|
1844
|
-
"millitorr" => [-3, "torr"], "millivolt" => [-3, "volt"],
|
1845
|
-
"milliwatt" => [-3, "watt"], "milliweber" => [-3, "weber"],
|
1846
|
-
"milliyard" => [-3, "yard"], "milliyd" => [-3, "yd"],
|
1847
|
-
"milliyear" => [-3, "year"], "min" => [-3, "in"],
|
1848
|
-
"minutes" => [0, "minute"], "minutes_angle" => [0, "minute_angle"],
|
1849
|
-
"mkg" => [-3, "kg"], "mkgf" => [-3, "kgf"], "mkph" => [-3, "kph"],
|
1850
|
-
"mlb" => [-3, "lb"], "mlm" => [-3, "lm"], "mlx" => [-3, "lx"],
|
1851
|
-
"mly" => [-3, "ly"], "mm" => [-3, "m"], "mmb" => [-3, "mb"],
|
1852
|
-
"mmercury" => [-3, "mercury"], "mmgal" => [-3, "mgal"],
|
1853
|
-
"mmin" => [-3, "min"], "mmol" => [-3, "mol"], "mmon" => [-3, "mon"],
|
1854
|
-
"mmph" => [-3, "mph"], "mohm" => [-3, "ohm"],
|
1855
|
-
"moles" => [0, "mole"], "months" => [0, "month"],
|
1856
|
-
"moz" => [-3, "oz"], "mpc" => [-3, "pc"],
|
1857
|
-
"mpercent" => [-3, "percent"], "mpermil" => [-3, "permil"],
|
1858
|
-
"mpsi" => [-3, "psi"], "mrad" => [-3, "rad"], "ms" => [-3, "s"],
|
1859
|
-
"msr" => [-3, "sr"], "mt" => [-3, "t"], "myr" => [-3, "yr"],
|
1860
|
-
"n%" => [-9, "%"], "nA" => [-9, "A"], "nAu" => [-9, "Au"],
|
1861
|
-
"nBq" => [-9, "Bq"], "nC" => [-9, "C"], "nF" => [-9, "F"],
|
1862
|
-
"nG" => [-9, "G"], "nGal" => [-9, "Gal"], "nGy" => [-9, "Gy"],
|
1863
|
-
"nH" => [-9, "H"], "nHg" => [-9, "Hg"], "nHz" => [-9, "Hz"],
|
1864
|
-
"nJ" => [-9, "J"], "nK" => [-9, "K"], "nL" => [-9, "L"],
|
1865
|
-
"nN" => [-9, "N"], "nP" => [-9, "P"], "nPa" => [-9, "Pa"],
|
1866
|
-
"nS" => [-9, "S"], "nSt" => [-9, "St"], "nSv" => [-9, "Sv"],
|
1867
|
-
"nT" => [-9, "T"], "nV" => [-9, "V"], "nW" => [-9, "W"],
|
1868
|
-
"nWb" => [-9, "Wb"], "na" => [-9, "a"], "nac" => [-9, "ac"],
|
1869
|
-
"nanoCelsius" => [-9, "Celsius"],
|
1870
|
-
"nanoFahrenheit" => [-9, "Fahrenheit"],
|
1871
|
-
"nanoJulian_year" => [-9, "Julian_year"],
|
1872
|
-
"nanoPascal" => [-9, "Pascal"], "nanoacre" => [-9, "acre"],
|
1873
|
-
"nanoampere" => [-9, "ampere"], "nanoangstrom" => [-9, "angstrom"],
|
1874
|
-
"nanoangular_degree" => [-9, "angular_degree"],
|
1875
|
-
"nanoangular_minute" => [-9, "angular_minute"],
|
1876
|
-
"nanoangular_second" => [-9, "angular_second"],
|
1877
|
-
"nanoare" => [-9, "are"], "nanoatmosphere" => [-9, "atmosphere"],
|
1878
|
-
"nanocalorie" => [-9, "calorie"], "nanocelsius" => [-9, "celsius"],
|
1879
|
-
"nanocentigrade" => [-9, "centigrade"],
|
1880
|
-
"nanocentury" => [-9, "century"], "nanochain" => [-9, "chain"],
|
1881
|
-
"nanocommon_year" => [-9, "common_year"],
|
1882
|
-
"nanocoulomb" => [-9, "coulomb"], "nanoday" => [-9, "day"],
|
1883
|
-
"nanodegK" => [-9, "degK"], "nanodeg_K" => [-9, "deg_K"],
|
1884
|
-
"nanodegree" => [-9, "degree"], "nanodegreeK" => [-9, "degreeK"],
|
1885
|
-
"nanodyne" => [-9, "dyne"], "nanoerg" => [-9, "erg"],
|
1886
|
-
"nanofahrenheit" => [-9, "fahrenheit"], "nanofarad" => [-9, "farad"],
|
1887
|
-
"nanofermi" => [-9, "fermi"], "nanogal" => [-9, "gal"],
|
1888
|
-
"nanogauss" => [-9, "gauss"], "nanogram" => [-9, "gram"],
|
1889
|
-
"nanohectare" => [-9, "hectare"], "nanohertz" => [-9, "hertz"],
|
1890
|
-
"nanohour" => [-9, "hour"], "nanoinch" => [-9, "inch"],
|
1891
|
-
"nanojoule" => [-9, "joule"], "nanokelvin" => [-9, "kelvin"],
|
1892
|
-
"nanokilogram" => [-9, "kilogram"], "nanoknot" => [-9, "knot"],
|
1893
|
-
"nanolitre" => [-9, "litre"], "nanometer" => [-9, "meter"],
|
1894
|
-
"nanometre" => [-9, "metre"], "nanomicron" => [-9, "micron"],
|
1895
|
-
"nanomile" => [-9, "mile"], "nanomillibar" => [-9, "millibar"],
|
1896
|
-
"nanominute" => [-9, "minute"],
|
1897
|
-
"nanominute_angle" => [-9, "minute_angle"],
|
1898
|
-
"nanomole" => [-9, "mole"], "nanomonth" => [-9, "month"],
|
1899
|
-
"nanonewton" => [-9, "newton"], "nanoounce" => [-9, "ounce"],
|
1900
|
-
"nanoparsec" => [-9, "parsec"], "nanopascal" => [-9, "pascal"],
|
1901
|
-
"nanopentad" => [-9, "pentad"], "nanopoise" => [-9, "poise"],
|
1902
|
-
"nanopound" => [-9, "pound"], "nanoradian" => [-9, "radian"],
|
1903
|
-
"nanosecond" => [-9, "second"],
|
1904
|
-
"nanosecond_angle" => [-9, "second_angle"],
|
1905
|
-
"nanosteradian" => [-9, "steradian"], "nanostokes" => [-9, "stokes"],
|
1906
|
-
"nanotesla" => [-9, "tesla"], "nanoton" => [-9, "ton"],
|
1907
|
-
"nanotonne" => [-9, "tonne"], "nanotorr" => [-9, "torr"],
|
1908
|
-
"nanovolt" => [-9, "volt"], "nanowatt" => [-9, "watt"],
|
1909
|
-
"nanoweber" => [-9, "weber"], "nanoyard" => [-9, "yard"],
|
1910
|
-
"nanoyd" => [-9, "yd"], "nanoyear" => [-9, "year"],
|
1911
|
-
"natm" => [-9, "atm"], "nbar" => [-9, "bar"], "ncal" => [-9, "cal"],
|
1912
|
-
"nconventional_mercury" => [-9, "conventional_mercury"],
|
1913
|
-
"nd" => [-9, "d"], "ndegC" => [-9, "degC"], "ndegF" => [-9, "degF"],
|
1914
|
-
"ndeg_C" => [-9, "deg_C"], "ndeg_F" => [-9, "deg_F"],
|
1915
|
-
"ndegreeC" => [-9, "degreeC"], "ndegreeF" => [-9, "degreeF"],
|
1916
|
-
"ndegree_C" => [-9, "degree_C"], "ndegree_E" => [-9, "degree_E"],
|
1917
|
-
"ndegree_F" => [-9, "degree_F"], "ndegree_N" => [-9, "degree_N"],
|
1918
|
-
"ndegree_R" => [-9, "degree_R"], "ndegree_S" => [-9, "degree_S"],
|
1919
|
-
"ndegree_W" => [-9, "degree_W"], "ndegree_c" => [-9, "degree_c"],
|
1920
|
-
"ndegree_east" => [-9, "degree_east"],
|
1921
|
-
"ndegree_f" => [-9, "degree_f"],
|
1922
|
-
"ndegree_north" => [-9, "degree_north"],
|
1923
|
-
"ndegree_south" => [-9, "degree_south"],
|
1924
|
-
"ndegree_west" => [-9, "degree_west"],
|
1925
|
-
"ndegrees_east" => [-9, "degrees_east"],
|
1926
|
-
"ndegrees_north" => [-9, "degrees_north"],
|
1927
|
-
"ndegrees_south" => [-9, "degrees_south"],
|
1928
|
-
"ndegrees_west" => [-9, "degrees_west"], "ndyn" => [-9, "dyn"],
|
1929
|
-
"nerg" => [-9, "erg"], "newtons" => [0, "newton"],
|
1930
|
-
"nforce" => [-9, "force"], "ng" => [-9, "g"],
|
1931
|
-
"ngravity" => [-9, "gravity"], "nh" => [-9, "h"],
|
1932
|
-
"nhg" => [-9, "hg"], "nhr" => [-9, "hr"], "nin" => [-9, "in"],
|
1933
|
-
"nkg" => [-9, "kg"], "nkgf" => [-9, "kgf"], "nkph" => [-9, "kph"],
|
1934
|
-
"nlb" => [-9, "lb"], "nlm" => [-9, "lm"], "nlx" => [-9, "lx"],
|
1935
|
-
"nly" => [-9, "ly"], "nm" => [-9, "m"], "nmb" => [-9, "mb"],
|
1936
|
-
"nmercury" => [-9, "mercury"], "nmgal" => [-9, "mgal"],
|
1937
|
-
"nmin" => [-9, "min"], "nmol" => [-9, "mol"], "nmon" => [-9, "mon"],
|
1938
|
-
"nmph" => [-9, "mph"], "nohm" => [-9, "ohm"], "noz" => [-9, "oz"],
|
1939
|
-
"npc" => [-9, "pc"], "npercent" => [-9, "percent"],
|
1940
|
-
"npermil" => [-9, "permil"], "npsi" => [-9, "psi"],
|
1941
|
-
"nrad" => [-9, "rad"], "ns" => [-9, "s"], "nsr" => [-9, "sr"],
|
1942
|
-
"nt" => [-9, "t"], "nyr" => [-9, "yr"], "ounces" => [0, "ounce"],
|
1943
|
-
"p%" => [-12, "%"], "pA" => [-12, "A"], "pAu" => [-12, "Au"],
|
1944
|
-
"pBq" => [-12, "Bq"], "pC" => [-12, "C"], "pF" => [-12, "F"],
|
1945
|
-
"pG" => [-12, "G"], "pGal" => [-12, "Gal"], "pGy" => [-12, "Gy"],
|
1946
|
-
"pH" => [-12, "H"], "pHg" => [-12, "Hg"], "pHz" => [-12, "Hz"],
|
1947
|
-
"pJ" => [-12, "J"], "pK" => [-12, "K"], "pL" => [-12, "L"],
|
1948
|
-
"pN" => [-12, "N"], "pP" => [-12, "P"], "pPa" => [-12, "Pa"],
|
1949
|
-
"pS" => [-12, "S"], "pSt" => [-12, "St"], "pSv" => [-12, "Sv"],
|
1950
|
-
"pT" => [-12, "T"], "pV" => [-12, "V"], "pW" => [-12, "W"],
|
1951
|
-
"pWb" => [-12, "Wb"], "pa" => [-12, "a"], "pac" => [-12, "ac"],
|
1952
|
-
"parsecs" => [0, "parsec"], "pascals" => [0, "pascal"],
|
1953
|
-
"patm" => [-12, "atm"], "pbar" => [-12, "bar"],
|
1954
|
-
"pcal" => [-12, "cal"],
|
1955
|
-
"pconventional_mercury" => [-12, "conventional_mercury"],
|
1956
|
-
"pd" => [-12, "d"], "pdegC" => [-12, "degC"],
|
1957
|
-
"pdegF" => [-12, "degF"], "pdeg_C" => [-12, "deg_C"],
|
1958
|
-
"pdeg_F" => [-12, "deg_F"], "pdegreeC" => [-12, "degreeC"],
|
1959
|
-
"pdegreeF" => [-12, "degreeF"], "pdegree_C" => [-12, "degree_C"],
|
1960
|
-
"pdegree_E" => [-12, "degree_E"], "pdegree_F" => [-12, "degree_F"],
|
1961
|
-
"pdegree_N" => [-12, "degree_N"], "pdegree_R" => [-12, "degree_R"],
|
1962
|
-
"pdegree_S" => [-12, "degree_S"], "pdegree_W" => [-12, "degree_W"],
|
1963
|
-
"pdegree_c" => [-12, "degree_c"],
|
1964
|
-
"pdegree_east" => [-12, "degree_east"],
|
1965
|
-
"pdegree_f" => [-12, "degree_f"],
|
1966
|
-
"pdegree_north" => [-12, "degree_north"],
|
1967
|
-
"pdegree_south" => [-12, "degree_south"],
|
1968
|
-
"pdegree_west" => [-12, "degree_west"],
|
1969
|
-
"pdegrees_east" => [-12, "degrees_east"],
|
1970
|
-
"pdegrees_north" => [-12, "degrees_north"],
|
1971
|
-
"pdegrees_south" => [-12, "degrees_south"],
|
1972
|
-
"pdegrees_west" => [-12, "degrees_west"], "pdyn" => [-12, "dyn"],
|
1973
|
-
"pentads" => [0, "pentad"], "perg" => [-12, "erg"],
|
1974
|
-
"petaCelsius" => [15, "Celsius"],
|
1975
|
-
"petaFahrenheit" => [15, "Fahrenheit"],
|
1976
|
-
"petaJulian_year" => [15, "Julian_year"],
|
1977
|
-
"petaPascal" => [15, "Pascal"], "petaacre" => [15, "acre"],
|
1978
|
-
"petaampere" => [15, "ampere"], "petaangstrom" => [15, "angstrom"],
|
1979
|
-
"petaangular_degree" => [15, "angular_degree"],
|
1980
|
-
"petaangular_minute" => [15, "angular_minute"],
|
1981
|
-
"petaangular_second" => [15, "angular_second"],
|
1982
|
-
"petaare" => [15, "are"], "petaatmosphere" => [15, "atmosphere"],
|
1983
|
-
"petacalorie" => [15, "calorie"], "petacelsius" => [15, "celsius"],
|
1984
|
-
"petacentigrade" => [15, "centigrade"],
|
1985
|
-
"petacentury" => [15, "century"], "petachain" => [15, "chain"],
|
1986
|
-
"petacommon_year" => [15, "common_year"],
|
1987
|
-
"petacoulomb" => [15, "coulomb"], "petaday" => [15, "day"],
|
1988
|
-
"petadegK" => [15, "degK"], "petadeg_K" => [15, "deg_K"],
|
1989
|
-
"petadegree" => [15, "degree"], "petadegreeK" => [15, "degreeK"],
|
1990
|
-
"petadyne" => [15, "dyne"], "petaerg" => [15, "erg"],
|
1991
|
-
"petafahrenheit" => [15, "fahrenheit"], "petafarad" => [15, "farad"],
|
1992
|
-
"petafermi" => [15, "fermi"], "petagal" => [15, "gal"],
|
1993
|
-
"petagauss" => [15, "gauss"], "petagram" => [15, "gram"],
|
1994
|
-
"petahectare" => [15, "hectare"], "petahertz" => [15, "hertz"],
|
1995
|
-
"petahour" => [15, "hour"], "petainch" => [15, "inch"],
|
1996
|
-
"petajoule" => [15, "joule"], "petakelvin" => [15, "kelvin"],
|
1997
|
-
"petakilogram" => [15, "kilogram"], "petaknot" => [15, "knot"],
|
1998
|
-
"petalitre" => [15, "litre"], "petameter" => [15, "meter"],
|
1999
|
-
"petametre" => [15, "metre"], "petamicron" => [15, "micron"],
|
2000
|
-
"petamile" => [15, "mile"], "petamillibar" => [15, "millibar"],
|
2001
|
-
"petaminute" => [15, "minute"],
|
2002
|
-
"petaminute_angle" => [15, "minute_angle"],
|
2003
|
-
"petamole" => [15, "mole"], "petamonth" => [15, "month"],
|
2004
|
-
"petanewton" => [15, "newton"], "petaounce" => [15, "ounce"],
|
2005
|
-
"petaparsec" => [15, "parsec"], "petapascal" => [15, "pascal"],
|
2006
|
-
"petapentad" => [15, "pentad"], "petapoise" => [15, "poise"],
|
2007
|
-
"petapound" => [15, "pound"], "petaradian" => [15, "radian"],
|
2008
|
-
"petasecond" => [15, "second"],
|
2009
|
-
"petasecond_angle" => [15, "second_angle"],
|
2010
|
-
"petasteradian" => [15, "steradian"], "petastokes" => [15, "stokes"],
|
2011
|
-
"petatesla" => [15, "tesla"], "petaton" => [15, "ton"],
|
2012
|
-
"petatonne" => [15, "tonne"], "petatorr" => [15, "torr"],
|
2013
|
-
"petavolt" => [15, "volt"], "petawatt" => [15, "watt"],
|
2014
|
-
"petaweber" => [15, "weber"], "petayard" => [15, "yard"],
|
2015
|
-
"petayd" => [15, "yd"], "petayear" => [15, "year"],
|
2016
|
-
"pforce" => [-12, "force"], "pg" => [-12, "g"],
|
2017
|
-
"pgravity" => [-12, "gravity"], "ph" => [-12, "h"],
|
2018
|
-
"phg" => [-12, "hg"], "phr" => [-12, "hr"],
|
2019
|
-
"picoCelsius" => [-12, "Celsius"],
|
2020
|
-
"picoFahrenheit" => [-12, "Fahrenheit"],
|
2021
|
-
"picoJulian_year" => [-12, "Julian_year"],
|
2022
|
-
"picoPascal" => [-12, "Pascal"], "picoacre" => [-12, "acre"],
|
2023
|
-
"picoampere" => [-12, "ampere"], "picoangstrom" => [-12, "angstrom"],
|
2024
|
-
"picoangular_degree" => [-12, "angular_degree"],
|
2025
|
-
"picoangular_minute" => [-12, "angular_minute"],
|
2026
|
-
"picoangular_second" => [-12, "angular_second"],
|
2027
|
-
"picoare" => [-12, "are"], "picoatmosphere" => [-12, "atmosphere"],
|
2028
|
-
"picocalorie" => [-12, "calorie"], "picocelsius" => [-12, "celsius"],
|
2029
|
-
"picocentigrade" => [-12, "centigrade"],
|
2030
|
-
"picocentury" => [-12, "century"], "picochain" => [-12, "chain"],
|
2031
|
-
"picocommon_year" => [-12, "common_year"],
|
2032
|
-
"picocoulomb" => [-12, "coulomb"], "picoday" => [-12, "day"],
|
2033
|
-
"picodegK" => [-12, "degK"], "picodeg_K" => [-12, "deg_K"],
|
2034
|
-
"picodegree" => [-12, "degree"], "picodegreeK" => [-12, "degreeK"],
|
2035
|
-
"picodyne" => [-12, "dyne"], "picoerg" => [-12, "erg"],
|
2036
|
-
"picofahrenheit" => [-12, "fahrenheit"],
|
2037
|
-
"picofarad" => [-12, "farad"], "picofermi" => [-12, "fermi"],
|
2038
|
-
"picogal" => [-12, "gal"], "picogauss" => [-12, "gauss"],
|
2039
|
-
"picogram" => [-12, "gram"], "picohectare" => [-12, "hectare"],
|
2040
|
-
"picohertz" => [-12, "hertz"], "picohour" => [-12, "hour"],
|
2041
|
-
"picoinch" => [-12, "inch"], "picojoule" => [-12, "joule"],
|
2042
|
-
"picokelvin" => [-12, "kelvin"], "picokilogram" => [-12, "kilogram"],
|
2043
|
-
"picoknot" => [-12, "knot"], "picolitre" => [-12, "litre"],
|
2044
|
-
"picometer" => [-12, "meter"], "picometre" => [-12, "metre"],
|
2045
|
-
"picomicron" => [-12, "micron"], "picomile" => [-12, "mile"],
|
2046
|
-
"picomillibar" => [-12, "millibar"], "picominute" => [-12, "minute"],
|
2047
|
-
"picominute_angle" => [-12, "minute_angle"],
|
2048
|
-
"picomole" => [-12, "mole"], "picomonth" => [-12, "month"],
|
2049
|
-
"piconewton" => [-12, "newton"], "picoounce" => [-12, "ounce"],
|
2050
|
-
"picoparsec" => [-12, "parsec"], "picopascal" => [-12, "pascal"],
|
2051
|
-
"picopentad" => [-12, "pentad"], "picopoise" => [-12, "poise"],
|
2052
|
-
"picopound" => [-12, "pound"], "picoradian" => [-12, "radian"],
|
2053
|
-
"picosecond" => [-12, "second"],
|
2054
|
-
"picosecond_angle" => [-12, "second_angle"],
|
2055
|
-
"picosteradian" => [-12, "steradian"],
|
2056
|
-
"picostokes" => [-12, "stokes"], "picotesla" => [-12, "tesla"],
|
2057
|
-
"picoton" => [-12, "ton"], "picotonne" => [-12, "tonne"],
|
2058
|
-
"picotorr" => [-12, "torr"], "picovolt" => [-12, "volt"],
|
2059
|
-
"picowatt" => [-12, "watt"], "picoweber" => [-12, "weber"],
|
2060
|
-
"picoyard" => [-12, "yard"], "picoyd" => [-12, "yd"],
|
2061
|
-
"picoyear" => [-12, "year"], "pin" => [-12, "in"],
|
2062
|
-
"pkg" => [-12, "kg"], "pkgf" => [-12, "kgf"],
|
2063
|
-
"pkph" => [-12, "kph"], "plb" => [-12, "lb"], "plm" => [-12, "lm"],
|
2064
|
-
"plx" => [-12, "lx"], "ply" => [-12, "ly"], "pm" => [-12, "m"],
|
2065
|
-
"pmb" => [-12, "mb"], "pmercury" => [-12, "mercury"],
|
2066
|
-
"pmgal" => [-12, "mgal"], "pmin" => [-12, "min"],
|
2067
|
-
"pmol" => [-12, "mol"], "pmon" => [-12, "mon"],
|
2068
|
-
"pmph" => [-12, "mph"], "pohm" => [-12, "ohm"],
|
2069
|
-
"poises" => [0, "poise"], "pounds" => [0, "pound"],
|
2070
|
-
"poz" => [-12, "oz"], "ppc" => [-12, "pc"],
|
2071
|
-
"ppercent" => [-12, "percent"], "ppermil" => [-12, "permil"],
|
2072
|
-
"ppsi" => [-12, "psi"], "prad" => [-12, "rad"], "ps" => [-12, "s"],
|
2073
|
-
"psr" => [-12, "sr"], "pt" => [-12, "t"], "pyr" => [-12, "yr"],
|
2074
|
-
"radians" => [0, "radian"], "seconds" => [0, "second"],
|
2075
|
-
"seconds_angle" => [0, "second_angle"],
|
2076
|
-
"steradians" => [0, "steradian"], "stokeses" => [0, "stokes"],
|
2077
|
-
"telaCelsius" => [12, "Celsius"],
|
2078
|
-
"telaFahrenheit" => [12, "Fahrenheit"],
|
2079
|
-
"telaJulian_year" => [12, "Julian_year"],
|
2080
|
-
"telaPascal" => [12, "Pascal"], "telaacre" => [12, "acre"],
|
2081
|
-
"telaampere" => [12, "ampere"], "telaangstrom" => [12, "angstrom"],
|
2082
|
-
"telaangular_degree" => [12, "angular_degree"],
|
2083
|
-
"telaangular_minute" => [12, "angular_minute"],
|
2084
|
-
"telaangular_second" => [12, "angular_second"],
|
2085
|
-
"telaare" => [12, "are"], "telaatmosphere" => [12, "atmosphere"],
|
2086
|
-
"telacalorie" => [12, "calorie"], "telacelsius" => [12, "celsius"],
|
2087
|
-
"telacentigrade" => [12, "centigrade"],
|
2088
|
-
"telacentury" => [12, "century"], "telachain" => [12, "chain"],
|
2089
|
-
"telacommon_year" => [12, "common_year"],
|
2090
|
-
"telacoulomb" => [12, "coulomb"], "teladay" => [12, "day"],
|
2091
|
-
"teladegK" => [12, "degK"], "teladeg_K" => [12, "deg_K"],
|
2092
|
-
"teladegree" => [12, "degree"], "teladegreeK" => [12, "degreeK"],
|
2093
|
-
"teladyne" => [12, "dyne"], "telaerg" => [12, "erg"],
|
2094
|
-
"telafahrenheit" => [12, "fahrenheit"], "telafarad" => [12, "farad"],
|
2095
|
-
"telafermi" => [12, "fermi"], "telagal" => [12, "gal"],
|
2096
|
-
"telagauss" => [12, "gauss"], "telagram" => [12, "gram"],
|
2097
|
-
"telahectare" => [12, "hectare"], "telahertz" => [12, "hertz"],
|
2098
|
-
"telahour" => [12, "hour"], "telainch" => [12, "inch"],
|
2099
|
-
"telajoule" => [12, "joule"], "telakelvin" => [12, "kelvin"],
|
2100
|
-
"telakilogram" => [12, "kilogram"], "telaknot" => [12, "knot"],
|
2101
|
-
"telalitre" => [12, "litre"], "telameter" => [12, "meter"],
|
2102
|
-
"telametre" => [12, "metre"], "telamicron" => [12, "micron"],
|
2103
|
-
"telamile" => [12, "mile"], "telamillibar" => [12, "millibar"],
|
2104
|
-
"telaminute" => [12, "minute"],
|
2105
|
-
"telaminute_angle" => [12, "minute_angle"],
|
2106
|
-
"telamole" => [12, "mole"], "telamonth" => [12, "month"],
|
2107
|
-
"telanewton" => [12, "newton"], "telaounce" => [12, "ounce"],
|
2108
|
-
"telaparsec" => [12, "parsec"], "telapascal" => [12, "pascal"],
|
2109
|
-
"telapentad" => [12, "pentad"], "telapoise" => [12, "poise"],
|
2110
|
-
"telapound" => [12, "pound"], "telaradian" => [12, "radian"],
|
2111
|
-
"telasecond" => [12, "second"],
|
2112
|
-
"telasecond_angle" => [12, "second_angle"],
|
2113
|
-
"telasteradian" => [12, "steradian"], "telastokes" => [12, "stokes"],
|
2114
|
-
"telatesla" => [12, "tesla"], "telaton" => [12, "ton"],
|
2115
|
-
"telatonne" => [12, "tonne"], "telatorr" => [12, "torr"],
|
2116
|
-
"telavolt" => [12, "volt"], "telawatt" => [12, "watt"],
|
2117
|
-
"telaweber" => [12, "weber"], "telayard" => [12, "yard"],
|
2118
|
-
"telayd" => [12, "yd"], "telayear" => [12, "year"],
|
2119
|
-
"teslas" => [0, "tesla"], "tonnes" => [0, "tonne"],
|
2120
|
-
"tons" => [0, "ton"], "torrs" => [0, "torr"], "u%" => [-6, "%"],
|
2121
|
-
"uA" => [-6, "A"], "uAu" => [-6, "Au"], "uBq" => [-6, "Bq"],
|
2122
|
-
"uC" => [-6, "C"], "uF" => [-6, "F"], "uG" => [-6, "G"],
|
2123
|
-
"uGal" => [-6, "Gal"], "uGy" => [-6, "Gy"], "uH" => [-6, "H"],
|
2124
|
-
"uHg" => [-6, "Hg"], "uHz" => [-6, "Hz"], "uJ" => [-6, "J"],
|
2125
|
-
"uK" => [-6, "K"], "uL" => [-6, "L"], "uN" => [-6, "N"],
|
2126
|
-
"uP" => [-6, "P"], "uPa" => [-6, "Pa"], "uS" => [-6, "S"],
|
2127
|
-
"uSt" => [-6, "St"], "uSv" => [-6, "Sv"], "uT" => [-6, "T"],
|
2128
|
-
"uV" => [-6, "V"], "uW" => [-6, "W"], "uWb" => [-6, "Wb"],
|
2129
|
-
"ua" => [-6, "a"], "uac" => [-6, "ac"], "uatm" => [-6, "atm"],
|
2130
|
-
"ubar" => [-6, "bar"], "ucal" => [-6, "cal"],
|
2131
|
-
"uconventional_mercury" => [-6, "conventional_mercury"],
|
2132
|
-
"ud" => [-6, "d"], "udegC" => [-6, "degC"], "udegF" => [-6, "degF"],
|
2133
|
-
"udeg_C" => [-6, "deg_C"], "udeg_F" => [-6, "deg_F"],
|
2134
|
-
"udegreeC" => [-6, "degreeC"], "udegreeF" => [-6, "degreeF"],
|
2135
|
-
"udegree_C" => [-6, "degree_C"], "udegree_E" => [-6, "degree_E"],
|
2136
|
-
"udegree_F" => [-6, "degree_F"], "udegree_N" => [-6, "degree_N"],
|
2137
|
-
"udegree_R" => [-6, "degree_R"], "udegree_S" => [-6, "degree_S"],
|
2138
|
-
"udegree_W" => [-6, "degree_W"], "udegree_c" => [-6, "degree_c"],
|
2139
|
-
"udegree_east" => [-6, "degree_east"],
|
2140
|
-
"udegree_f" => [-6, "degree_f"],
|
2141
|
-
"udegree_north" => [-6, "degree_north"],
|
2142
|
-
"udegree_south" => [-6, "degree_south"],
|
2143
|
-
"udegree_west" => [-6, "degree_west"],
|
2144
|
-
"udegrees_east" => [-6, "degrees_east"],
|
2145
|
-
"udegrees_north" => [-6, "degrees_north"],
|
2146
|
-
"udegrees_south" => [-6, "degrees_south"],
|
2147
|
-
"udegrees_west" => [-6, "degrees_west"], "udyn" => [-6, "dyn"],
|
2148
|
-
"uerg" => [-6, "erg"], "uforce" => [-6, "force"], "ug" => [-6, "g"],
|
2149
|
-
"ugravity" => [-6, "gravity"], "uh" => [-6, "h"],
|
2150
|
-
"uhg" => [-6, "hg"], "uhr" => [-6, "hr"], "uin" => [-6, "in"],
|
2151
|
-
"ukg" => [-6, "kg"], "ukgf" => [-6, "kgf"], "ukph" => [-6, "kph"],
|
2152
|
-
"ulb" => [-6, "lb"], "ulm" => [-6, "lm"], "ulx" => [-6, "lx"],
|
2153
|
-
"uly" => [-6, "ly"], "um" => [-6, "m"], "umb" => [-6, "mb"],
|
2154
|
-
"umercury" => [-6, "mercury"], "umgal" => [-6, "mgal"],
|
2155
|
-
"umin" => [-6, "min"], "umol" => [-6, "mol"], "umon" => [-6, "mon"],
|
2156
|
-
"umph" => [-6, "mph"], "uohm" => [-6, "ohm"], "uoz" => [-6, "oz"],
|
2157
|
-
"upc" => [-6, "pc"], "upercent" => [-6, "percent"],
|
2158
|
-
"upermil" => [-6, "permil"], "upsi" => [-6, "psi"],
|
2159
|
-
"urad" => [-6, "rad"], "us" => [-6, "s"], "usr" => [-6, "sr"],
|
2160
|
-
"ut" => [-6, "t"], "uyr" => [-6, "yr"], "volts" => [0, "volt"],
|
2161
|
-
"watts" => [0, "watt"], "webers" => [0, "weber"],
|
2162
|
-
"yards" => [0, "yard"], "yds" => [0, "yd"], "years" => [0, "year"],
|
2163
|
-
}
|
2164
|
-
UPLURALS = {
|
2165
|
-
"Celsiuses" => "Celsius", "Fahrenheits" => "Fahrenheit",
|
2166
|
-
"Julians_year" => "Julian_year", "Pascals" => "Pascal",
|
2167
|
-
"acres" => "acre", "amperes" => "ampere", "angstroms" => "angstrom",
|
2168
|
-
"angulars_degree" => "angular_degree",
|
2169
|
-
"angulars_minute" => "angular_minute",
|
2170
|
-
"angulars_second" => "angular_second", "ares" => "are",
|
2171
|
-
"atmospheres" => "atmosphere", "calories" => "calorie",
|
2172
|
-
"celsiuses" => "celsius", "centigrades" => "centigrade",
|
2173
|
-
"centuries" => "century", "chains" => "chain",
|
2174
|
-
"commons_year" => "common_year", "coulombs" => "coulomb",
|
2175
|
-
"days" => "day", "degKs" => "degK", "degreeKs" => "degreeK",
|
2176
|
-
"degrees" => "degree", "degs_K" => "deg_K", "dynes" => "dyne",
|
2177
|
-
"ergs" => "erg", "fahrenheits" => "fahrenheit", "farads" => "farad",
|
2178
|
-
"fermis" => "fermi", "gals" => "gal", "gausses" => "gauss",
|
2179
|
-
"grams" => "gram", "hectares" => "hectare", "hertzes" => "hertz",
|
2180
|
-
"hours" => "hour", "inchs" => "inch", "joules" => "joule",
|
2181
|
-
"kelvins" => "kelvin", "kilograms" => "kilogram", "knots" => "knot",
|
2182
|
-
"litres" => "litre", "meters" => "meter", "metres" => "metre",
|
2183
|
-
"microns" => "micron", "miles" => "mile", "millibars" => "millibar",
|
2184
|
-
"minutes" => "minute", "minutes_angle" => "minute_angle",
|
2185
|
-
"moles" => "mole", "months" => "month", "newtons" => "newton",
|
2186
|
-
"ounces" => "ounce", "parsecs" => "parsec", "pascals" => "pascal",
|
2187
|
-
"pentads" => "pentad", "poises" => "poise", "pounds" => "pound",
|
2188
|
-
"radians" => "radian", "seconds" => "second",
|
2189
|
-
"seconds_angle" => "second_angle", "steradians" => "steradian",
|
2190
|
-
"stokeses" => "stokes", "teslas" => "tesla", "tonnes" => "tonne",
|
2191
|
-
"tons" => "ton", "torrs" => "torr", "volts" => "volt",
|
2192
|
-
"watts" => "watt", "webers" => "weber", "yards" => "yard",
|
2193
|
-
"yds" => "yd", "years" => "year",
|
2194
|
-
}
|
2195
|
-
end
|
2196
|
-
class NumberNode < TerminalNode
|
2197
|
-
|
2198
|
-
def initialize(arg)
|
2199
|
-
raise TypeError unless Numeric === arg
|
2200
|
-
@a = arg
|
2201
|
-
end
|
2202
|
-
|
2203
|
-
UNITY = NumberNode.new(1)
|
2204
|
-
ZERO = NumberNode.new(0)
|
2205
|
-
|
2206
|
-
def to_s
|
2207
|
-
if @a == @a.to_i
|
2208
|
-
sprintf("%d",@a)
|
2209
|
-
else
|
2210
|
-
String(@a)
|
2211
|
-
end
|
2212
|
-
end
|
2213
|
-
|
2214
|
-
attr_reader :a
|
2215
|
-
|
2216
|
-
alias :value :a
|
2217
|
-
alias :factor :a
|
2218
|
-
|
2219
|
-
def == (other)
|
2220
|
-
case other
|
2221
|
-
when NumberNode
|
2222
|
-
@a == other.a
|
2223
|
-
else
|
2224
|
-
false
|
2225
|
-
end
|
2226
|
-
end
|
2227
|
-
|
2228
|
-
def add_eval(another)
|
2229
|
-
raise TypeError unless NumberNode === another
|
2230
|
-
NumberNode.new(@a + another.value)
|
2231
|
-
end
|
2232
|
-
|
2233
|
-
def mul_eval(another)
|
2234
|
-
case another
|
2235
|
-
when NumberNode then NumberNode.new(@a * another.a)
|
2236
|
-
when PowNode
|
2237
|
-
raise TypeError unless NumberNode === another.lhs
|
2238
|
-
raise TypeError unless NumberNode === another.rhs
|
2239
|
-
NumberNode.new(@a * Units::pow_f(another.lhs.value, another.rhs.value))
|
2240
|
-
else raise TypeError
|
2241
|
-
end
|
2242
|
-
end
|
2243
|
-
|
2244
|
-
def name; "1"; end
|
2245
|
-
|
2246
|
-
def power; UNITY; end
|
2247
|
-
|
2248
|
-
end
|
2249
|
-
class XDate
|
2250
|
-
|
2251
|
-
def initialize(year, month, day)
|
2252
|
-
@year, @month, @day = year.to_i, month.to_i, day.to_i
|
2253
|
-
end
|
2254
|
-
|
2255
|
-
attr_reader :year, :month, :day
|
2256
|
-
|
2257
|
-
def to_s
|
2258
|
-
format('%04d-%02d-%02d', @year, @month, @day)
|
2259
|
-
end
|
2260
|
-
|
2261
|
-
alias :inspect :to_s
|
2262
|
-
|
2263
|
-
def to_time
|
2264
|
-
Time.gm(@year, @month, @day)
|
2265
|
-
end
|
2266
|
-
|
2267
|
-
def to_date
|
2268
|
-
Date.new(@year, @month, @day)
|
2269
|
-
end
|
2270
|
-
|
2271
|
-
def -(other)
|
2272
|
-
case other
|
2273
|
-
when XDate
|
2274
|
-
(to_date - other.to_date)
|
2275
|
-
when Time
|
2276
|
-
to_time - other
|
2277
|
-
when Date
|
2278
|
-
(to_date - other.to_date)
|
2279
|
-
else
|
2280
|
-
to_date - other
|
2281
|
-
end
|
2282
|
-
end
|
2283
|
-
|
2284
|
-
def +(other)
|
2285
|
-
t = to_date + other
|
2286
|
-
self.class.new(t.year, t.month, t.mday)
|
2287
|
-
end
|
2288
|
-
|
2289
|
-
end
|
2290
|
-
|
2291
|
-
class TimeNode < TerminalNode
|
2292
|
-
|
2293
|
-
def initialize(date, time, zone)
|
2294
|
-
@date, @time, @zone = date, time, zone
|
2295
|
-
if :now === @date then
|
2296
|
-
now = Time.now.utc
|
2297
|
-
@date = XDate.new(now.year, now.month, now.day)
|
2298
|
-
@time = ((now.hour * 60 + now.min) * 60 + Float(now.sec))
|
2299
|
-
else
|
2300
|
-
qdays = (@time / 86400).floor
|
2301
|
-
if not qdays.zero?
|
2302
|
-
@date += qdays
|
2303
|
-
@time -= (qdays * 86400)
|
2304
|
-
end
|
2305
|
-
end
|
2306
|
-
raise TypeError unless XDate === @date
|
2307
|
-
@time = 0.0 unless @time
|
2308
|
-
raise TypeError unless Float === @time
|
2309
|
-
@zone = 0 unless @zone
|
2310
|
-
raise TypeError unless Integer === @zone
|
2311
|
-
end
|
2312
|
-
|
2313
|
-
attr_reader :date, :time, :zone
|
2314
|
-
|
2315
|
-
def to_s
|
2316
|
-
hr = @time.floor / 3600
|
2317
|
-
mi = (@time.floor / 60) % 60
|
2318
|
-
sc = @time % 60
|
2319
|
-
tzm = @zone.abs
|
2320
|
-
tzh = tzm / 60
|
2321
|
-
tzm %= 60
|
2322
|
-
tzh = -tzh if @zone < 0
|
2323
|
-
format("%sT%02d:%02d:%05.2f %+03d:%02d", \
|
2324
|
-
@date.to_s, hr, mi, sc, tzh, tzm)
|
2325
|
-
end
|
2326
|
-
|
2327
|
-
def self::pentad(d)
|
2328
|
-
(d > 25) ? 5 : ((d - 1) / 5)
|
2329
|
-
end
|
2330
|
-
|
2331
|
-
def add_time(increment)
|
2332
|
-
inc = increment.reduce5
|
2333
|
-
case inc.name
|
2334
|
-
when 's'
|
2335
|
-
t2 = @time + inc.factor
|
2336
|
-
d2 = @date + (t2 / 86400)
|
2337
|
-
t2 = t2 % 86400
|
2338
|
-
self.class.new(d2, t2, @zone)
|
2339
|
-
when 'pentad'
|
2340
|
-
ifac = Integer(inc.factor)
|
2341
|
-
ipen = ifac % 6
|
2342
|
-
imon = ifac / 6
|
2343
|
-
spen = self.class.pentad(@date.day)
|
2344
|
-
smon = @date.month + imon + spen / 6
|
2345
|
-
spen = spen % 6
|
2346
|
-
sday = spen * 5 + (@date.day - 1) % 5 + 1
|
2347
|
-
syear = @date.year + (smon - 1) / 12
|
2348
|
-
smon = (smon - 1) % 12 + 1
|
2349
|
-
sdate = XDate.new(syear, smon, sday)
|
2350
|
-
self.class.new(sdate, @time, @zone)
|
2351
|
-
else
|
2352
|
-
raise "bad time unit '#{inc.name}'"
|
2353
|
-
end
|
2354
|
-
end
|
2355
|
-
|
2356
|
-
def utcsod
|
2357
|
-
@time - @zone * 60
|
2358
|
-
end
|
2359
|
-
|
2360
|
-
def div_time(units)
|
2361
|
-
base = units.ref
|
2362
|
-
inc = units.deref.reduce5
|
2363
|
-
begin
|
2364
|
-
incname = inc.name
|
2365
|
-
rescue Exception
|
2366
|
-
incname = "(undefined)"
|
2367
|
-
end
|
2368
|
-
case incname
|
2369
|
-
when 's'
|
2370
|
-
dif = (@date - base.date) * 86400 + (utcsod - base.utcsod)
|
2371
|
-
dif / inc.factor
|
2372
|
-
when 'pentad'
|
2373
|
-
dif = (@date.year - base.date.year) * 72
|
2374
|
-
dif += (@date.month - base.date.month) * 6
|
2375
|
-
dif += self.class.pentad(@date.day)
|
2376
|
-
dif -= self.class.pentad(base.date.day)
|
2377
|
-
dif = Float(dif) if dif % inc.factor != 0
|
2378
|
-
dif / inc.factor
|
2379
|
-
else
|
2380
|
-
raise "bad time unit '#{incname}'"
|
2381
|
-
end
|
2382
|
-
end
|
2383
|
-
|
2384
|
-
end
|
2385
|
-
class PowNode < ContainerNode
|
2386
|
-
|
2387
|
-
include BinaryNode
|
2388
|
-
|
2389
|
-
def initialize(lhs, rhs)
|
2390
|
-
@lhs, @rhs = lhs, rhs
|
2391
|
-
raise TypeError unless NumberNode === @rhs
|
2392
|
-
end
|
2393
|
-
|
2394
|
-
def to_s
|
2395
|
-
lhs = @lhs.to_s
|
2396
|
-
case lhs
|
2397
|
-
when /\d$/, /[\d\.]/
|
2398
|
-
lhs = "(#{lhs})"
|
2399
|
-
end
|
2400
|
-
rhs = @rhs.to_s
|
2401
|
-
if rhs == '1'
|
2402
|
-
lhs
|
2403
|
-
else
|
2404
|
-
rhs = "^(#{rhs})" if (/\./ =~ rhs)
|
2405
|
-
lhs + rhs
|
2406
|
-
end
|
2407
|
-
end
|
2408
|
-
|
2409
|
-
attr_reader :lhs, :rhs
|
2410
|
-
alias :power :rhs
|
2411
|
-
|
2412
|
-
def pow_eval(other)
|
2413
|
-
case other
|
2414
|
-
when NumberNode
|
2415
|
-
PowNode.new(@lhs, @rhs.mul_eval(other))
|
2416
|
-
else
|
2417
|
-
super(other)
|
2418
|
-
end
|
2419
|
-
end
|
2420
|
-
|
2421
|
-
def flatten2
|
2422
|
-
x = @lhs.flatten2
|
2423
|
-
case x
|
2424
|
-
when NumberNode
|
2425
|
-
a = @lhs.pow_eval(@rhs)
|
2426
|
-
when TerminalNode
|
2427
|
-
a = self
|
2428
|
-
when PowNode
|
2429
|
-
a = PowNode.new(x.lhs, x.rhs.mul_eval(@rhs))
|
2430
|
-
when MulNode, MultiNode
|
2431
|
-
a = MultiNode.new()
|
2432
|
-
for gc in x
|
2433
|
-
a.append(gc.pow_eval(@rhs))
|
2434
|
-
end
|
2435
|
-
else
|
2436
|
-
raise "internal error"
|
2437
|
-
end
|
2438
|
-
return a
|
2439
|
-
end
|
2440
|
-
|
2441
|
-
def name
|
2442
|
-
case @lhs
|
2443
|
-
when NumberNode, NameNode
|
2444
|
-
@lhs.name
|
2445
|
-
else
|
2446
|
-
raise "internal error"
|
2447
|
-
end
|
2448
|
-
end
|
2449
|
-
|
2450
|
-
def value
|
2451
|
-
case @lhs
|
2452
|
-
when NumberNode
|
2453
|
-
Units::pow_f(@lhs.value, @rhs.value)
|
2454
|
-
else
|
2455
|
-
raise(format('%s#value: internal error', self.class.to_s))
|
2456
|
-
end
|
2457
|
-
end
|
2458
|
-
|
2459
|
-
def mul_eval(another)
|
2460
|
-
raise "internal error (#{name}, #{another.name})" if name != another.name
|
2461
|
-
case @lhs
|
2462
|
-
when NumberNode
|
2463
|
-
NumberNode.new(Units::pow_f(@lhs.value, @rhs.value) * another.value)
|
2464
|
-
else
|
2465
|
-
self.class.new(@lhs, @rhs.add_eval(another.power))
|
2466
|
-
end
|
2467
|
-
end
|
2468
|
-
|
2469
|
-
def sort
|
2470
|
-
case @lhs
|
2471
|
-
when NumberNode
|
2472
|
-
NumberNode.new(Units::pow_f(@lhs.value, @rhs.value))
|
2473
|
-
else
|
2474
|
-
self
|
2475
|
-
end
|
2476
|
-
end
|
2477
|
-
|
2478
|
-
def factor
|
2479
|
-
Units::pow_f(@lhs.factor, @rhs.value)
|
2480
|
-
end
|
2481
|
-
|
2482
|
-
end
|
2483
|
-
|
2484
|
-
module Kakezan
|
2485
|
-
|
2486
|
-
def flatten2
|
2487
|
-
r = MultiNode.new()
|
2488
|
-
each do |child|
|
2489
|
-
case child
|
2490
|
-
when MultiNode
|
2491
|
-
r.append child
|
2492
|
-
when MulNode
|
2493
|
-
r.append child.flatten2
|
2494
|
-
when ContainerNode
|
2495
|
-
r.append child.flatten2
|
2496
|
-
else
|
2497
|
-
r.append child
|
2498
|
-
end
|
2499
|
-
end
|
2500
|
-
r
|
2501
|
-
end
|
2502
|
-
|
2503
|
-
def name
|
2504
|
-
n = nil
|
2505
|
-
for c in @children
|
2506
|
-
next if NumberNode === c
|
2507
|
-
na = c.name
|
2508
|
-
if n.nil?
|
2509
|
-
n = na
|
2510
|
-
else
|
2511
|
-
raise "multiple names found" if na != n
|
2512
|
-
end
|
2513
|
-
end
|
2514
|
-
n = "1" if n.nil?
|
2515
|
-
n
|
2516
|
-
end
|
2517
|
-
|
2518
|
-
def factor
|
2519
|
-
f = 1
|
2520
|
-
for c in @children
|
2521
|
-
f *= c.factor
|
2522
|
-
end
|
2523
|
-
f
|
2524
|
-
end
|
2525
|
-
|
2526
|
-
end
|
2527
|
-
|
2528
|
-
class MulNode < ContainerNode
|
2529
|
-
|
2530
|
-
include BinaryNode
|
2531
|
-
include Kakezan
|
2532
|
-
|
2533
|
-
def initialize(lhs, rhs)
|
2534
|
-
@lhs, @rhs = lhs, rhs
|
2535
|
-
end
|
2536
|
-
|
2537
|
-
def to_s
|
2538
|
-
lhs = @lhs.to_s
|
2539
|
-
rhs = @rhs.to_s
|
2540
|
-
if (/\d$/ =~ lhs && /^\w/ =~ rhs) then
|
2541
|
-
"#{lhs} #{rhs}"
|
2542
|
-
else
|
2543
|
-
"#{lhs}.#{rhs}"
|
2544
|
-
end
|
2545
|
-
end
|
2546
|
-
|
2547
|
-
end
|
2548
|
-
|
2549
|
-
class MultiNode < ContainerNode
|
2550
|
-
|
2551
|
-
include Kakezan
|
2552
|
-
|
2553
|
-
def initialize(*children)
|
2554
|
-
@children = children
|
2555
|
-
for c in @children
|
2556
|
-
raise "# MultiNode.new(#{children.inspect})" unless Node === c
|
2557
|
-
end
|
2558
|
-
end
|
2559
|
-
|
2560
|
-
def to_s
|
2561
|
-
s = @children.join(';')
|
2562
|
-
s.gsub(/\d;\w/) { |dsw| dsw.sub(/;/, ' ') }.gsub(/;/, '.')
|
2563
|
-
end
|
2564
|
-
|
2565
|
-
def each
|
2566
|
-
@children.each {|child| yield child }
|
2567
|
-
end
|
2568
|
-
|
2569
|
-
attr_reader :children
|
2570
|
-
|
2571
|
-
def append(other)
|
2572
|
-
case other
|
2573
|
-
when MultiNode
|
2574
|
-
@children += other.children
|
2575
|
-
else
|
2576
|
-
@children.push other
|
2577
|
-
end
|
2578
|
-
end
|
2579
|
-
|
2580
|
-
def sort
|
2581
|
-
table = {}
|
2582
|
-
for child in self
|
2583
|
-
name = child.name
|
2584
|
-
if (table.include?(name)) then
|
2585
|
-
table[name] = table[name].mul_eval(child)
|
2586
|
-
else
|
2587
|
-
table[name] = child
|
2588
|
-
end
|
2589
|
-
end
|
2590
|
-
list = []
|
2591
|
-
for name in table.keys.sort
|
2592
|
-
candi = table[name]
|
2593
|
-
if PowNode === candi and NumberNode === candi.lhs then
|
2594
|
-
v = candi.value
|
2595
|
-
list.push NumberNode.new(v) unless v == 1
|
2596
|
-
next
|
2597
|
-
end
|
2598
|
-
next if candi.power.value == 0
|
2599
|
-
list.push candi
|
2600
|
-
end
|
2601
|
-
if list.length > 1
|
2602
|
-
list.delete(NumberNode::UNITY)
|
2603
|
-
end
|
2604
|
-
self.class.new(*list)
|
2605
|
-
end
|
2606
|
-
|
2607
|
-
def collect_hash(stopper, op)
|
2608
|
-
list = []
|
2609
|
-
for child in self
|
2610
|
-
list.push(child.send(op, stopper))
|
2611
|
-
end
|
2612
|
-
self.class.new(*list).flatten2
|
2613
|
-
end
|
2614
|
-
|
2615
|
-
def expand(stopper)
|
2616
|
-
collect_hash(stopper, :expand)
|
2617
|
-
end
|
2618
|
-
|
2619
|
-
def unalias(stopper)
|
2620
|
-
collect_hash(stopper, :unalias)
|
2621
|
-
end
|
2622
|
-
|
2623
|
-
def foldnumber(stopper)
|
2624
|
-
collect_hash(stopper, :foldnumber)
|
2625
|
-
end
|
2626
|
-
|
2627
|
-
def value
|
2628
|
-
raise "this is dimensional units" if (@children.size > 1)
|
2629
|
-
@children.first ? @children.first.value : NumberNode::UNITY.value
|
2630
|
-
end
|
2631
|
-
|
2632
|
-
end
|
2633
|
-
class ShiftNode < ContainerNode
|
2634
|
-
|
2635
|
-
include BinaryNode
|
2636
|
-
|
2637
|
-
def initialize(lhs, rhs)
|
2638
|
-
@lhs, @rhs = lhs, rhs
|
2639
|
-
end
|
2640
|
-
|
2641
|
-
attr_reader :lhs, :rhs
|
2642
|
-
alias :ref :rhs
|
2643
|
-
|
2644
|
-
def to_s
|
2645
|
-
"(#{@lhs.to_s} @ #{@rhs.to_s})"
|
2646
|
-
end
|
2647
|
-
|
2648
|
-
def trim2; @lhs; end
|
2649
|
-
def trim
|
2650
|
-
self.class.new(@lhs.trim, @rhs.trim2)
|
2651
|
-
end
|
2652
|
-
|
2653
|
-
def flatten2; @lhs; end
|
2654
|
-
def flatten
|
2655
|
-
lf = @lhs.flatten
|
2656
|
-
case lf
|
2657
|
-
when ShiftNode
|
2658
|
-
rf = lf.rhs.add_eval(@rhs)
|
2659
|
-
self.class.new(lf.lhs, rf)
|
2660
|
-
else
|
2661
|
-
self.class.new(lf, @rhs.flatten)
|
2662
|
-
end
|
2663
|
-
end
|
2664
|
-
|
2665
|
-
def sort
|
2666
|
-
self.class.new(@lhs.sort, @rhs.sort)
|
2667
|
-
end
|
2668
|
-
|
2669
|
-
def ref
|
2670
|
-
case @lhs
|
2671
|
-
when ShiftNode
|
2672
|
-
@lhs.ref.add_eval(@rhs)
|
2673
|
-
else
|
2674
|
-
@rhs
|
2675
|
-
end
|
2676
|
-
end
|
2677
|
-
|
2678
|
-
def deref
|
2679
|
-
case @lhs
|
2680
|
-
when ShiftNode
|
2681
|
-
@lhs.deref
|
2682
|
-
else
|
2683
|
-
@lhs
|
2684
|
-
end
|
2685
|
-
end
|
2686
|
-
|
2687
|
-
def name
|
2688
|
-
@lhs.name
|
2689
|
-
end
|
2690
|
-
|
2691
|
-
def factor
|
2692
|
-
@lhs.factor
|
2693
|
-
end
|
2694
|
-
|
2695
|
-
end
|
2696
|
-
def initialize string
|
2697
|
-
case string
|
2698
|
-
when String
|
2699
|
-
@string, @ptree = string, nil
|
2700
|
-
when Node
|
2701
|
-
@string, @ptree = nil, string
|
2702
|
-
else
|
2703
|
-
@string, @ptree = String(string), nil
|
2704
|
-
end
|
2705
|
-
@copy = @lexstat = nil
|
2706
|
-
end
|
2707
|
-
|
2708
|
-
#
|
2709
|
-
# === LEXICAL ANALYZER ===
|
2710
|
-
#
|
2711
|
-
|
2712
|
-
def rewind
|
2713
|
-
@copy = @string.dup.strip
|
2714
|
-
@lexstat = nil
|
2715
|
-
end
|
2716
|
-
|
2717
|
-
RE_SPACE = '([ \t])'
|
2718
|
-
RE_INTEGER = '([-+]?\d+)'
|
2719
|
-
RE_EXP = '([eE][-+]?[0-9]+)'
|
2720
|
-
RE_REAL = "([-+]?[0-9]*(\\.[0-9]*#{RE_EXP}?|#{RE_EXP}))"
|
2721
|
-
RE_YEAR = "([-+]?[0-9]{1,4})"
|
2722
|
-
RE_MONTH = "(0?[1-9]|1[0-2])"
|
2723
|
-
RE_DAY = "([12][0-9]|30|31|0?[1-9])"
|
2724
|
-
RE_HOUR = "(2[0-3]|[0-1]?[0-9])"
|
2725
|
-
RE_MINUTE = "([0-5]?[0-9])"
|
2726
|
-
RE_SECOND = "((#{RE_MINUTE}|60)(\\.[0-9]*)?)"
|
2727
|
-
RE_NAME = "(%|[a-zA-Z][a-zA-Z_]*([0-9]+[a-zA-Z_]+)*)"
|
2728
|
-
|
2729
|
-
RE_DATE = "#{RE_YEAR}-#{RE_MONTH}-#{RE_DAY}"
|
2730
|
-
RE_TIME = "#{RE_HOUR}((:[0-5]?[0-9]|[0-5][0-9])(:#{RE_SECOND})?)?"
|
2731
|
-
RE_HandM = "#{RE_HOUR}((:[0-5]?[0-9]|[0-5][0-9]))?"
|
2732
|
-
|
2733
|
-
def next_token
|
2734
|
-
|
2735
|
-
# decomment
|
2736
|
-
@copy.sub!(/^#.*/, '');
|
2737
|
-
|
2738
|
-
if @copy.sub!(%r{^\s*(\))}, '') then
|
2739
|
-
@lexstat = nil
|
2740
|
-
return [$1, $1]
|
2741
|
-
end
|
2742
|
-
|
2743
|
-
if @copy.sub!(%r{^\s*(\()\s*}, '') then
|
2744
|
-
return [$1, $1]
|
2745
|
-
end
|
2746
|
-
|
2747
|
-
if @copy.sub!(%r{^[ \t]*(@)[ \t]*}, '') \
|
2748
|
-
or @copy.sub!(%r{^[ \t]+(after|from|since|ref)[ \t]+}i, '') then
|
2749
|
-
@lexstat = :SHIFT_SEEN
|
2750
|
-
return [:SHIFT, $1]
|
2751
|
-
end
|
2752
|
-
|
2753
|
-
if @copy.sub!(%r{^[ \t]*(/)[ \t]*}, '') \
|
2754
|
-
or @copy.sub!(%r{^[ \t]+(per)[ \t]+}i, '') then
|
2755
|
-
@lexstat = nil
|
2756
|
-
return [:DIVIDE, $1]
|
2757
|
-
end
|
2758
|
-
|
2759
|
-
if @copy.sub!(%r{^(\^|\*\*)}, '') then
|
2760
|
-
@lexstat = nil
|
2761
|
-
return [:EXPONENT, $1]
|
2762
|
-
end
|
2763
|
-
|
2764
|
-
if @copy.sub!(%r{^(\.|\*|[ \t]+)}, '') then
|
2765
|
-
@lexstat = nil
|
2766
|
-
return [:MULTIPLY, $1]
|
2767
|
-
end
|
2768
|
-
|
2769
|
-
if :SHIFT_SEEN === @lexstat \
|
2770
|
-
and @copy.sub!(%r{^#{RE_DATE}T?[ \t]*}, '') then
|
2771
|
-
y, m, d = $1, $2, $3
|
2772
|
-
@lexstat = :DATE_SEEN
|
2773
|
-
return [:DATE, XDate.new(y.to_i, m.to_i, d.to_i)]
|
2774
|
-
end
|
2775
|
-
|
2776
|
-
if :SHIFT_SEEN === @lexstat \
|
2777
|
-
and @copy.sub!(%r{^now[ \t]*}, '') then
|
2778
|
-
@lexstat = nil
|
2779
|
-
return [:DATE, :now]
|
2780
|
-
end
|
2781
|
-
|
2782
|
-
if :DATE_SEEN === @lexstat \
|
2783
|
-
and @copy.sub!(%r{^#{RE_TIME}[ \t]*}, '') then
|
2784
|
-
h, m, s = $1, $3, $5
|
2785
|
-
m = m.sub(/:/,'') if m
|
2786
|
-
s = 0 if s.nil?
|
2787
|
-
@lexstat = :TIME_SEEN
|
2788
|
-
return [:TIME, ((h.to_i * 60 + m.to_i) * 60 + Float(s))]
|
2789
|
-
end
|
2790
|
-
|
2791
|
-
if :DATE_SEEN === @lexstat \
|
2792
|
-
and @copy.sub!(%r{^([0-2][0-9])([0-5][0-9])[ \t]*}, '') then
|
2793
|
-
h, m = $1, $2
|
2794
|
-
@lexstat = :TIME_SEEN
|
2795
|
-
return [:TIME, ((h.to_i * 60 + m.to_i) * 60.0)]
|
2796
|
-
end
|
2797
|
-
|
2798
|
-
if :DATE_SEEN === @lexstat \
|
2799
|
-
and @copy.sub!(%r{^([0-9])([0-5][0-9])[ \t]*}, '') then
|
2800
|
-
h, m = $1, $2
|
2801
|
-
@lexstat = :TIME_SEEN
|
2802
|
-
return [:TIME, ((h.to_i * 60 + m.to_i) * 60.0)]
|
2803
|
-
end
|
2804
|
-
|
2805
|
-
if :TIME_SEEN === @lexstat \
|
2806
|
-
and @copy.sub!(%r{^UTC[ \t]*}, '') then
|
2807
|
-
@lexstat = nil
|
2808
|
-
return [:ZONE, 0]
|
2809
|
-
end
|
2810
|
-
|
2811
|
-
if :TIME_SEEN === @lexstat \
|
2812
|
-
and @copy.sub!(%r{^([-+]?)#{RE_HandM}[ \t]*}, '') then
|
2813
|
-
sgn, h, m = $1, $2, $4
|
2814
|
-
m = m.sub(/:/,'') if m
|
2815
|
-
@lexstat = nil
|
2816
|
-
h = h.to_i
|
2817
|
-
h = -h if sgn == "-"
|
2818
|
-
m = m.to_i
|
2819
|
-
m = -m if sgn == "-"
|
2820
|
-
return [:ZONE, ((h * 60) + m)]
|
2821
|
-
end
|
2822
|
-
|
2823
|
-
if @copy.sub!(%r{^#{RE_NAME}}, '') then
|
2824
|
-
@lexstat = nil
|
2825
|
-
return [:NAME, $1]
|
2826
|
-
end
|
2827
|
-
|
2828
|
-
if @copy.sub!(%r{^#{RE_REAL}}, '') then
|
2829
|
-
@lexstat = nil
|
2830
|
-
return [:REAL, $1.to_f]
|
2831
|
-
end
|
2832
|
-
|
2833
|
-
if @copy.sub!(%r{^#{RE_INTEGER}}, '') then
|
2834
|
-
@lexstat = nil
|
2835
|
-
return [:INT, $1.to_i]
|
2836
|
-
end
|
2837
|
-
|
2838
|
-
if @copy.sub!(%r{^(-)}, '') then
|
2839
|
-
@lexstat = nil
|
2840
|
-
return [:MULTIPLY, $1]
|
2841
|
-
end
|
2842
|
-
|
2843
|
-
if @copy.sub!(%r{^(.)}, '') then
|
2844
|
-
return [$1, $1]
|
2845
|
-
end
|
2846
|
-
|
2847
|
-
return [false, false]
|
2848
|
-
|
2849
|
-
end
|
2850
|
-
|
2851
|
-
#
|
2852
|
-
# === USER LEVEL METHODS ===
|
2853
|
-
#
|
2854
|
-
|
2855
|
-
def tokens
|
2856
|
-
rewind
|
2857
|
-
x = []
|
2858
|
-
while (t = next_token).first
|
2859
|
-
x.push t
|
2860
|
-
end
|
2861
|
-
x
|
2862
|
-
end
|
2863
|
-
|
2864
|
-
def do_parse2
|
2865
|
-
rewind
|
2866
|
-
return NumberNode.new(1) if @string.nil? or @string.empty?
|
2867
|
-
pa = do_parse
|
2868
|
-
pa ? pa : ErrorNode.new(@string)
|
2869
|
-
end
|
2870
|
-
|
2871
|
-
def ptree
|
2872
|
-
@ptree = do_parse2 if not @ptree
|
2873
|
-
@ptree
|
2874
|
-
end
|
2875
|
-
|
2876
|
-
def dup
|
2877
|
-
@string ? self.class.new(@string) : self.class.new(@ptree)
|
2878
|
-
end
|
2879
|
-
|
2880
|
-
def parse
|
2881
|
-
dup.parse!
|
2882
|
-
end
|
2883
|
-
|
2884
|
-
def parse!
|
2885
|
-
@ptree = do_parse2 if not @ptree
|
2886
|
-
self
|
2887
|
-
end
|
2888
|
-
|
2889
|
-
def self::parse(string)
|
2890
|
-
new(string).parse!
|
2891
|
-
end
|
2892
|
-
|
2893
|
-
=begin
|
2894
|
-
--- reduce0
|
2895
|
-
just do nothing.
|
2896
|
-
=end
|
2897
|
-
|
2898
|
-
def reduce0
|
2899
|
-
self
|
2900
|
-
end
|
2901
|
-
|
2902
|
-
=begin
|
2903
|
-
--- reduce1
|
2904
|
-
removes unnecessary parentheses.
|
2905
|
-
=end
|
2906
|
-
|
2907
|
-
def reduce1
|
2908
|
-
@string = ptree.to_s
|
2909
|
-
self
|
2910
|
-
end
|
2911
|
-
|
2912
|
-
=begin
|
2913
|
-
--- reduce2
|
2914
|
-
removes shift operator within multiplication/division/exponent
|
2915
|
-
=end
|
2916
|
-
|
2917
|
-
def reduce2
|
2918
|
-
@ptree = ptree.reduce2
|
2919
|
-
@string = nil
|
2920
|
-
self
|
2921
|
-
end
|
2922
|
-
|
2923
|
-
=begin
|
2924
|
-
--- reduce3
|
2925
|
-
flattens expression and collects all factors
|
2926
|
-
=end
|
2927
|
-
|
2928
|
-
def reduce3
|
2929
|
-
@ptree = ptree.reduce3
|
2930
|
-
@string = nil
|
2931
|
-
self
|
2932
|
-
end
|
2933
|
-
|
2934
|
-
=begin
|
2935
|
-
--- reduce4
|
2936
|
-
collects terms with the same name
|
2937
|
-
=end
|
2938
|
-
|
2939
|
-
def reduce4
|
2940
|
-
@ptree = ptree.reduce4
|
2941
|
-
@string = nil
|
2942
|
-
self
|
2943
|
-
end
|
2944
|
-
|
2945
|
-
=begin
|
2946
|
-
--- reduce5
|
2947
|
-
expands all terms recursively
|
2948
|
-
=end
|
2949
|
-
|
2950
|
-
def reduce5
|
2951
|
-
@ptree = ptree.reduce5
|
2952
|
-
@string = nil
|
2953
|
-
self
|
2954
|
-
end
|
2955
|
-
|
2956
|
-
attr_reader :string
|
2957
|
-
|
2958
|
-
def to_s
|
2959
|
-
@string = @ptree.to_s if @string.nil?
|
2960
|
-
@string
|
2961
|
-
end
|
2962
|
-
|
2963
|
-
def inspect
|
2964
|
-
if @ptree.nil? then
|
2965
|
-
"Units{#{@string}}"
|
2966
|
-
else
|
2967
|
-
"Units[#{@ptree.inspect}]".gsub(/Units::/, '').gsub(/Node\[/, '[')
|
2968
|
-
end
|
2969
|
-
end
|
2970
|
-
|
2971
|
-
def self::[](string)
|
2972
|
-
new(string)
|
2973
|
-
end
|
2974
|
-
|
2975
|
-
def self::parse(string)
|
2976
|
-
new(string).parse!
|
2977
|
-
end
|
2978
|
-
|
2979
|
-
def eval(x = 0)
|
2980
|
-
r5 = ptree.reduce5
|
2981
|
-
case r = r5.ref
|
2982
|
-
when TimeNode
|
2983
|
-
r.add(x, r5.name)
|
2984
|
-
else
|
2985
|
-
fac = NumberNode.new(x + r.value)
|
2986
|
-
self.class.new(MulNode.new(fac, r5.deref))
|
2987
|
-
end
|
2988
|
-
end
|
2989
|
-
|
2990
|
-
def convert(numeric, to_units)
|
2991
|
-
to_units = Units.new( to_units ) if to_units.is_a?(String)
|
2992
|
-
r5 = dup.ptree.reduce5
|
2993
|
-
case r = r5.ref
|
2994
|
-
when TimeNode
|
2995
|
-
r.add_time(r5.deref.mul(numeric)).div_time(to_units.ptree)
|
2996
|
-
else
|
2997
|
-
shift1 = r.value
|
2998
|
-
numeric = shift1 + numeric if shift1 != 0
|
2999
|
-
fact = r5.divide(tp = to_units.dup.ptree).reduce5.value
|
3000
|
-
numeric *= fact if fact != 1
|
3001
|
-
shift2 = tp.reduce5.ref.value
|
3002
|
-
numeric = numeric - shift2 if shift2 != 0
|
3003
|
-
numeric
|
3004
|
-
end
|
3005
|
-
end
|
3006
|
-
|
3007
|
-
def factor_and_offset(to_units)
|
3008
|
-
# To convert a numeric from self to to_units:
|
3009
|
-
# scale_factor * numeric + add_offset
|
3010
|
-
to_units = Units.new( to_units ) if to_units.is_a?(String)
|
3011
|
-
add_offset = convert(0, to_units)
|
3012
|
-
scale_factor = convert(1, to_units) - add_offset
|
3013
|
-
[ scale_factor, add_offset ]
|
3014
|
-
end
|
3015
|
-
|
3016
|
-
def convert2(val, to_units)
|
3017
|
-
# Like Units#convert, but applicable to any Numeric-like objects.
|
3018
|
-
# Returns the original value if the units are incompatible.
|
3019
|
-
to_units = Units.new( to_units ) if to_units.is_a?(String)
|
3020
|
-
if ( self == to_units )
|
3021
|
-
val
|
3022
|
-
elsif ( self =~ to_units )
|
3023
|
-
if Numeric===val
|
3024
|
-
convert( val, to_units )
|
3025
|
-
else
|
3026
|
-
factor, offset = factor_and_offset( to_units )
|
3027
|
-
val*factor + offset
|
3028
|
-
end
|
3029
|
-
else
|
3030
|
-
unless $VERBOSE.nil?
|
3031
|
-
$stderr.print( "*WARNING*: " +
|
3032
|
-
"incompatible units: #{self.to_s} and #{to_units.to_s}\n")
|
3033
|
-
caller(0).each{|c| $stderr.print "\t* ",c,"\n"}
|
3034
|
-
end
|
3035
|
-
val
|
3036
|
-
end
|
3037
|
-
end
|
3038
|
-
|
3039
|
-
@@reduce = :reduce4
|
3040
|
-
|
3041
|
-
def self::reduce_level
|
3042
|
-
@@reduce.to_s[-1]
|
3043
|
-
end
|
3044
|
-
|
3045
|
-
def self::reduce_level=(n)
|
3046
|
-
@@reduce = case n
|
3047
|
-
when 1 then :reduce1
|
3048
|
-
when 2 then :reduce2
|
3049
|
-
when 3 then :reduce3
|
3050
|
-
when 4 then :reduce4
|
3051
|
-
else :reduce5
|
3052
|
-
end
|
3053
|
-
end
|
3054
|
-
|
3055
|
-
def binop(op, other)
|
3056
|
-
case other
|
3057
|
-
when Numeric
|
3058
|
-
other = NumberNode.new(other)
|
3059
|
-
when Units
|
3060
|
-
other = other.ptree
|
3061
|
-
end
|
3062
|
-
q = self.ptree.send(op, other).send(@@reduce)
|
3063
|
-
Units.new(q)
|
3064
|
-
end
|
3065
|
-
|
3066
|
-
def *(other)
|
3067
|
-
binop(:mul, other)
|
3068
|
-
end
|
3069
|
-
|
3070
|
-
def **(other)
|
3071
|
-
binop(:pow, other)
|
3072
|
-
end
|
3073
|
-
|
3074
|
-
def /(other)
|
3075
|
-
binop(:divide, other)
|
3076
|
-
end
|
3077
|
-
|
3078
|
-
def ^(other)
|
3079
|
-
binop(:shift, other)
|
3080
|
-
end
|
3081
|
-
|
3082
|
-
def ==(other)
|
3083
|
-
case other
|
3084
|
-
when self.class
|
3085
|
-
dup.reduce5.to_s == other.dup.reduce5.to_s
|
3086
|
-
else
|
3087
|
-
false
|
3088
|
-
end
|
3089
|
-
end
|
3090
|
-
|
3091
|
-
#def === (other)
|
3092
|
-
# reduce5.ptree.deref.to_s == other.reduce5.ptree.deref.to_s
|
3093
|
-
#end
|
3094
|
-
|
3095
|
-
alias === ==
|
3096
|
-
|
3097
|
-
#def === (other)
|
3098
|
-
# # returns true if other is within a factor and/or offset of difference.
|
3099
|
-
# case other
|
3100
|
-
# when self.class
|
3101
|
-
# (self/other).reduce5.ptree.children.each do |child|
|
3102
|
-
# return false if !( NumberNode === child )
|
3103
|
-
# end
|
3104
|
-
# true
|
3105
|
-
# else
|
3106
|
-
# false
|
3107
|
-
# end
|
3108
|
-
#end
|
3109
|
-
|
3110
|
-
|
3111
|
-
def =~(other)
|
3112
|
-
case other
|
3113
|
-
when self.class
|
3114
|
-
(self/other).reduce5.ptree.children.each{ |node|
|
3115
|
-
return false unless NumberNode === node
|
3116
|
-
}
|
3117
|
-
true
|
3118
|
-
else
|
3119
|
-
false
|
3120
|
-
end
|
3121
|
-
end
|
3122
|
-
|
3123
|
-
def self::pow_f(a, b)
|
3124
|
-
if Integer === b and b < 0 then
|
3125
|
-
a ** b.to_f
|
3126
|
-
else
|
3127
|
-
a ** b
|
3128
|
-
end
|
3129
|
-
end
|
3130
|
-
|
3131
|
-
##### racc 1.4.5 generates ###
|
3132
|
-
|
3133
|
-
racc_reduce_table = [
|
3134
|
-
0, 0, :racc_error,
|
3135
|
-
0, 17, :_reduce_none,
|
3136
|
-
1, 17, :_reduce_2,
|
3137
|
-
1, 17, :_reduce_3,
|
3138
|
-
1, 18, :_reduce_none,
|
3139
|
-
3, 18, :_reduce_5,
|
3140
|
-
3, 18, :_reduce_6,
|
3141
|
-
1, 19, :_reduce_none,
|
3142
|
-
1, 19, :_reduce_none,
|
3143
|
-
2, 19, :_reduce_9,
|
3144
|
-
3, 19, :_reduce_10,
|
3145
|
-
3, 19, :_reduce_11,
|
3146
|
-
3, 19, :_reduce_12,
|
3147
|
-
3, 19, :_reduce_13,
|
3148
|
-
1, 22, :_reduce_14,
|
3149
|
-
2, 22, :_reduce_15,
|
3150
|
-
3, 22, :_reduce_16,
|
3151
|
-
3, 22, :_reduce_17,
|
3152
|
-
1, 20, :_reduce_none,
|
3153
|
-
3, 20, :_reduce_19,
|
3154
|
-
1, 23, :_reduce_20,
|
3155
|
-
1, 23, :_reduce_21,
|
3156
|
-
1, 21, :_reduce_none,
|
3157
|
-
3, 21, :_reduce_23,
|
3158
|
-
1, 24, :_reduce_24,
|
3159
|
-
2, 24, :_reduce_25,
|
3160
|
-
3, 24, :_reduce_26 ]
|
3161
|
-
|
3162
|
-
racc_reduce_n = 27
|
3163
|
-
|
3164
|
-
racc_shift_n = 39
|
3165
|
-
|
3166
|
-
racc_action_table = [
|
3167
|
-
3, 4, 34, 4, 14, 22, 23, 36, 9, 10,
|
3168
|
-
9, 4, 24, 5, 4, 26, 37, 4, 9, 10,
|
3169
|
-
4, 9, 38, 5, 9, 10, 20, 9, 4, 5,
|
3170
|
-
nil, 4, 20, nil, nil, 9, nil, 24, 9, 10,
|
3171
|
-
26, nil, 16, 5, 17, 18, nil, 4, 10, 4,
|
3172
|
-
nil, 4, 5, 12, 9, 12, 9, 12, 9, 4,
|
3173
|
-
nil, nil, nil, nil, nil, 12, 9 ]
|
3174
|
-
|
3175
|
-
racc_action_check = [
|
3176
|
-
0, 0, 24, 26, 6, 13, 14, 33, 0, 0,
|
3177
|
-
26, 5, 26, 0, 20, 26, 34, 18, 5, 5,
|
3178
|
-
12, 20, 35, 5, 18, 18, 20, 12, 16, 18,
|
3179
|
-
nil, 17, 12, nil, nil, 16, nil, 16, 17, 17,
|
3180
|
-
16, nil, 8, 17, 8, 8, nil, 29, 8, 31,
|
3181
|
-
nil, 15, 8, 29, 29, 31, 31, 15, 15, 1,
|
3182
|
-
nil, nil, nil, nil, nil, 1, 1 ]
|
3183
|
-
|
3184
|
-
racc_action_pointer = [
|
3185
|
-
-1, 57, nil, nil, nil, 9, 4, nil, 38, nil,
|
3186
|
-
nil, nil, 18, -10, 6, 49, 26, 29, 15, nil,
|
3187
|
-
12, nil, nil, nil, -10, nil, 1, nil, nil, 45,
|
3188
|
-
nil, 47, nil, -8, 3, 7, nil, nil, nil ]
|
3189
|
-
|
3190
|
-
racc_action_default = [
|
3191
|
-
-1, -7, -8, -3, -20, -27, -27, -2, -4, -21,
|
3192
|
-
-14, -15, -27, -27, -27, -9, -27, -27, -27, -18,
|
3193
|
-
-27, -16, -17, 39, -24, -22, -27, -5, -6, -10,
|
3194
|
-
-12, -11, -13, -27, -25, -27, -19, -26, -23 ]
|
3195
|
-
|
3196
|
-
racc_goto_table = [
|
3197
|
-
2, 15, 7, 28, 21, 2, 6, 13, 27, nil,
|
3198
|
-
29, 31, 19, 35, nil, nil, 19, 30, 32, nil,
|
3199
|
-
19, nil, nil, nil, nil, nil, 19 ]
|
3200
|
-
|
3201
|
-
racc_goto_check = [
|
3202
|
-
7, 6, 2, 5, 4, 7, 1, 2, 4, nil,
|
3203
|
-
6, 6, 7, 5, nil, nil, 7, 7, 7, nil,
|
3204
|
-
7, nil, nil, nil, nil, nil, 7 ]
|
3205
|
-
|
3206
|
-
racc_goto_pointer = [
|
3207
|
-
nil, 6, 2, nil, -8, -13, -7, 0, nil ]
|
3208
|
-
|
3209
|
-
racc_goto_default = [
|
3210
|
-
nil, nil, nil, 8, 33, nil, 1, 11, 25 ]
|
3211
|
-
|
3212
|
-
racc_token_table = {
|
3213
|
-
false => 0,
|
3214
|
-
Object.new => 1,
|
3215
|
-
:INT => 2,
|
3216
|
-
:ERR => 3,
|
3217
|
-
:SHIFT => 4,
|
3218
|
-
:SPACE => 5,
|
3219
|
-
:MULTIPLY => 6,
|
3220
|
-
:DIVIDE => 7,
|
3221
|
-
:EXPONENT => 8,
|
3222
|
-
:REAL => 9,
|
3223
|
-
:NAME => 10,
|
3224
|
-
:DATE => 11,
|
3225
|
-
:TIME => 12,
|
3226
|
-
:ZONE => 13,
|
3227
|
-
"(" => 14,
|
3228
|
-
")" => 15 }
|
3229
|
-
|
3230
|
-
racc_use_result_var = false
|
3231
|
-
|
3232
|
-
racc_nt_base = 16
|
3233
|
-
|
3234
|
-
Racc_arg = [
|
3235
|
-
racc_action_table,
|
3236
|
-
racc_action_check,
|
3237
|
-
racc_action_default,
|
3238
|
-
racc_action_pointer,
|
3239
|
-
racc_goto_table,
|
3240
|
-
racc_goto_check,
|
3241
|
-
racc_goto_default,
|
3242
|
-
racc_goto_pointer,
|
3243
|
-
racc_nt_base,
|
3244
|
-
racc_reduce_table,
|
3245
|
-
racc_token_table,
|
3246
|
-
racc_shift_n,
|
3247
|
-
racc_reduce_n,
|
3248
|
-
racc_use_result_var ]
|
3249
|
-
|
3250
|
-
Racc_token_to_s_table = [
|
3251
|
-
'$end',
|
3252
|
-
'error',
|
3253
|
-
'INT',
|
3254
|
-
'ERR',
|
3255
|
-
'SHIFT',
|
3256
|
-
'SPACE',
|
3257
|
-
'MULTIPLY',
|
3258
|
-
'DIVIDE',
|
3259
|
-
'EXPONENT',
|
3260
|
-
'REAL',
|
3261
|
-
'NAME',
|
3262
|
-
'DATE',
|
3263
|
-
'TIME',
|
3264
|
-
'ZONE',
|
3265
|
-
'"("',
|
3266
|
-
'")"',
|
3267
|
-
'$start',
|
3268
|
-
'unit_spec',
|
3269
|
-
'origin_exp',
|
3270
|
-
'unit_exp',
|
3271
|
-
'value_exp',
|
3272
|
-
'timestamp',
|
3273
|
-
'power_exp',
|
3274
|
-
'number_exp',
|
3275
|
-
'time_exp']
|
3276
|
-
|
3277
|
-
Racc_debug_parser = false
|
3278
|
-
|
3279
|
-
##### racc system variables end #####
|
3280
|
-
|
3281
|
-
# reduce 0 omitted
|
3282
|
-
|
3283
|
-
# reduce 1 omitted
|
3284
|
-
|
3285
|
-
def _reduce_2( val, _values)
|
3286
|
-
yyaccept;
|
3287
|
-
end
|
3288
|
-
|
3289
|
-
def _reduce_3( val, _values)
|
3290
|
-
yyerrok
|
3291
|
-
end
|
3292
|
-
|
3293
|
-
# reduce 4 omitted
|
3294
|
-
|
3295
|
-
def _reduce_5( val, _values)
|
3296
|
-
val[0].shift(val[2])
|
3297
|
-
end
|
3298
|
-
|
3299
|
-
def _reduce_6( val, _values)
|
3300
|
-
val[0].shift(val[2])
|
3301
|
-
end
|
3302
|
-
|
3303
|
-
# reduce 7 omitted
|
3304
|
-
|
3305
|
-
# reduce 8 omitted
|
3306
|
-
|
3307
|
-
def _reduce_9( val, _values)
|
3308
|
-
val[0].mul(val[1])
|
3309
|
-
end
|
3310
|
-
|
3311
|
-
def _reduce_10( val, _values)
|
3312
|
-
val[0].mul(val[2])
|
3313
|
-
end
|
3314
|
-
|
3315
|
-
def _reduce_11( val, _values)
|
3316
|
-
val[0].divide(val[2])
|
3317
|
-
end
|
3318
|
-
|
3319
|
-
def _reduce_12( val, _values)
|
3320
|
-
val[0].mul(val[2])
|
3321
|
-
end
|
3322
|
-
|
3323
|
-
def _reduce_13( val, _values)
|
3324
|
-
val[0].divide(val[2])
|
3325
|
-
end
|
3326
|
-
|
3327
|
-
def _reduce_14( val, _values)
|
3328
|
-
NameNode.new(val[0])
|
3329
|
-
end
|
3330
|
-
|
3331
|
-
def _reduce_15( val, _values)
|
3332
|
-
val[0].pow(val[1])
|
3333
|
-
end
|
3334
|
-
|
3335
|
-
def _reduce_16( val, _values)
|
3336
|
-
val[0].pow(val[2])
|
3337
|
-
end
|
3338
|
-
|
3339
|
-
def _reduce_17( val, _values)
|
3340
|
-
val[1]
|
3341
|
-
end
|
3342
|
-
|
3343
|
-
# reduce 18 omitted
|
3344
|
-
|
3345
|
-
def _reduce_19( val, _values)
|
3346
|
-
val[1]
|
3347
|
-
end
|
3348
|
-
|
3349
|
-
def _reduce_20( val, _values)
|
3350
|
-
NumberNode.new(val[0])
|
3351
|
-
end
|
3352
|
-
|
3353
|
-
def _reduce_21( val, _values)
|
3354
|
-
NumberNode.new(val[0])
|
3355
|
-
end
|
3356
|
-
|
3357
|
-
# reduce 22 omitted
|
3358
|
-
|
3359
|
-
def _reduce_23( val, _values)
|
3360
|
-
val[1]
|
3361
|
-
end
|
3362
|
-
|
3363
|
-
def _reduce_24( val, _values)
|
3364
|
-
TimeNode.new(val[0], 0.0, 0)
|
3365
|
-
end
|
3366
|
-
|
3367
|
-
def _reduce_25( val, _values)
|
3368
|
-
TimeNode.new(val[0], val[1], 0)
|
3369
|
-
end
|
3370
|
-
|
3371
|
-
def _reduce_26( val, _values)
|
3372
|
-
TimeNode.new(val[0], val[1], val[2])
|
3373
|
-
end
|
3374
|
-
|
3375
|
-
def _reduce_none( val, _values)
|
3376
|
-
val[0]
|
3377
|
-
end
|
3378
|
-
|
3379
|
-
end # class Units
|
3380
|
-
end # module NumRu
|
3381
|
-
|
3382
|
-
####################
|
3383
|
-
if $0 == __FILE__
|
3384
|
-
include NumRu
|
3385
|
-
|
3386
|
-
def assert(test, seikai)
|
3387
|
-
raise "#{test.inspect} != #{seikai.inspect}" if test != seikai
|
3388
|
-
puts "ok #{seikai.inspect}"
|
3389
|
-
end
|
3390
|
-
|
3391
|
-
puts "=== reduce1 ==="
|
3392
|
-
|
3393
|
-
assert Units.new('').reduce1.to_s, ""
|
3394
|
-
assert Units.new('m').reduce1.to_s, "m"
|
3395
|
-
assert Units.new('3').reduce1.to_s, "3"
|
3396
|
-
assert Units.new('3.14').reduce1.to_s, "3.14"
|
3397
|
-
assert Units.new('m2').reduce1.to_s, "m2"
|
3398
|
-
assert Units.new('m.s').reduce1.to_s, "m.s"
|
3399
|
-
assert Units.new('m/s').reduce1.to_s, "m.s-1"
|
3400
|
-
assert Units.new('kg.m/s2').reduce1.to_s, "kg.m.(s2)-1"
|
3401
|
-
assert Units.new('s @ 2003-11-29').reduce1.to_s,
|
3402
|
-
"(s @ 2003-11-29T00:00:00.00 +00:00)"
|
3403
|
-
assert Units.new('s @ 2003-11-29T11:24').reduce1.to_s,
|
3404
|
-
"(s @ 2003-11-29T11:24:00.00 +00:00)"
|
3405
|
-
assert Units.new('s @ 2003-11-29T11:24:11 -09:00').reduce1.to_s,
|
3406
|
-
"(s @ 2003-11-29T11:24:11.00 -09:00)"
|
3407
|
-
|
3408
|
-
assert Units.new('100').reduce1.to_s, "100"
|
3409
|
-
assert Units.new('(10)^2').reduce1.to_s, "(10)2"
|
3410
|
-
assert Units.new('(10)^2/100').reduce1.to_s, "(10)2.(100)-1"
|
3411
|
-
|
3412
|
-
puts "=== reduce2 ==="
|
3413
|
-
|
3414
|
-
assert Units.new('s @ 2003-11-29').reduce2.to_s,
|
3415
|
-
"(s @ 2003-11-29T00:00:00.00 +00:00)"
|
3416
|
-
assert Units.new('m/(s @ 2003-11-29)').reduce2.to_s, "m.s-1"
|
3417
|
-
assert Units.new('m/((K @ 273.15) (s from 2003-11-29))').reduce2.to_s, "m.(K.s)-1"
|
3418
|
-
|
3419
|
-
assert Units.new('(10)^2/100').reduce2.to_s, "(10)2.(100)-1"
|
3420
|
-
|
3421
|
-
puts "=== reduce3 ==="
|
3422
|
-
|
3423
|
-
assert Units::MultiNode.new(Units::NameNode.new('a'), \
|
3424
|
-
Units::NumberNode.new(1), \
|
3425
|
-
Units::NameNode.new('b')).to_s, 'a.1 b'
|
3426
|
-
|
3427
|
-
assert Units.new('kg').reduce3.inspect, "Units[Name[kg]]"
|
3428
|
-
assert Units.new('kg.m').reduce3.inspect, "Units[Multi[Name[kg], Name[m]]]"
|
3429
|
-
assert Units.new('kg.m.s').reduce3.inspect,
|
3430
|
-
"Units[Multi[Name[kg], Name[m], Name[s]]]"
|
3431
|
-
|
3432
|
-
assert Units.new('(m.s)^2').reduce3.inspect,
|
3433
|
-
"Units[Multi[Pow[Name[m], Number[2]], Pow[Name[s], Number[2]]]]"
|
3434
|
-
assert Units.new('K @ 273.15').reduce3.inspect,
|
3435
|
-
"Units[Shift[Name[K], Number[273.15]]]"
|
3436
|
-
assert Units.new('((a.b)^2)^2').reduce3.inspect,
|
3437
|
-
"Units[Multi[Pow[Name[a], Number[4]], Pow[Name[b], Number[4]]]]"
|
3438
|
-
assert Units.new('((a.b)^2 c4 d)^2').reduce3.inspect,
|
3439
|
-
"Units[Multi[Pow[Name[a], Number[4]], Pow[Name[b], Number[4]], Pow[Name[c], Number[8]], Pow[Name[d], Number[2]]]]"
|
3440
|
-
assert Units.new('((a.b)^2 c4 d)^2').reduce3.to_s,
|
3441
|
-
"a4 b4 c8 d2"
|
3442
|
-
assert Units.new('((a.b)^2 a4 b)^2').reduce3.to_s,
|
3443
|
-
"a4 b4 a8 b2"
|
3444
|
-
|
3445
|
-
assert Units.new('s @ 2003-11-29').reduce3.to_s,
|
3446
|
-
"(s @ 2003-11-29T00:00:00.00 +00:00)"
|
3447
|
-
assert Units.new('m/(s @ 2003-11-29)').reduce3.to_s, "m.s-1"
|
3448
|
-
assert Units.new('m/((K @ 273.15) (s from 2003-11-29))').reduce3.to_s, "m.K-1 s-1"
|
3449
|
-
|
3450
|
-
assert Units.new('(10)^2/100').reduce3.to_s, "(10)2.(100)-1"
|
3451
|
-
|
3452
|
-
puts "=== reduce4 ==="
|
3453
|
-
|
3454
|
-
assert Units.new('((a.b)^2 a4 b @ now)^2 @ 273.15').reduce4.to_s,
|
3455
|
-
"(a12 b6 @ 273.15)"
|
3456
|
-
|
3457
|
-
assert Units.new('km2').reduce4.to_s, "km2"
|
3458
|
-
assert Units.new('hours.hour').reduce4.to_s, "hour2"
|
3459
|
-
assert Units.new('(10)^2').reduce4.to_s, "100"
|
3460
|
-
assert Units.new('100/10').reduce4.to_s, "10.0"
|
3461
|
-
assert Units.new('(10)^2/100').reduce4.to_s, "1.0"
|
3462
|
-
|
3463
|
-
puts "=== reduce5 ==="
|
3464
|
-
|
3465
|
-
assert Units.new('km2').reduce5.to_s, "1000000 m2"
|
3466
|
-
assert Units.new('(10)^2/100').reduce5.to_s, "1.0"
|
3467
|
-
|
3468
|
-
assert Units.new('hPa').reduce5.to_s, "100 kg.m-1 s-2"
|
3469
|
-
assert Units.new('mb').reduce5.to_s, "100.0 kg.m-1 s-2"
|
3470
|
-
|
3471
|
-
assert Units.new('hPa/mb').reduce5.to_s, "1.0"
|
3472
|
-
|
3473
|
-
assert Units.new('(K @ 273.15)@ 10').reduce5.to_s, "(K @ 283.15)"
|
3474
|
-
|
3475
|
-
puts "=== APPLICATIONS ==="
|
3476
|
-
|
3477
|
-
assert Units.new('km @ 2').convert(3, Units.new('m @ 100')), 4900
|
3478
|
-
assert Units.new('degree_F').convert(32, Units.new('K')).to_s, "273.15"
|
3479
|
-
|
3480
|
-
u1 = Units.new('m/s')
|
3481
|
-
u2 = Units.new('mm/s')
|
3482
|
-
assert((u1/u2).to_s, "m.mm-1")
|
3483
|
-
assert((u1*u2).to_s, "m.mm.s-2")
|
3484
|
-
|
3485
|
-
u1 = Units.new('years since 1999-01-01 00:00').reduce4
|
3486
|
-
u2 = Units.new('hours since 2001-01-01 00:00').reduce4
|
3487
|
-
assert u1.convert(3, u2), 24 * 365
|
3488
|
-
u3 = Units.new('months since 2001-01-01 00:00').reduce4
|
3489
|
-
assert u1.convert(3, u3), 12.0
|
3490
|
-
|
3491
|
-
Units.reduce_level = 3
|
3492
|
-
assert((Units.new('hours') ** 2).to_s, "hours2")
|
3493
|
-
Units.reduce_level = 4
|
3494
|
-
assert((Units.new('hours') ** 2).to_s, "hour2")
|
3495
|
-
Units.reduce_level = 5
|
3496
|
-
assert((Units.new('hours') ** 2).to_s, "12960000 s2")
|
3497
|
-
|
3498
|
-
assert(Units.new('day') =~ Units.new('s since 2002-01-01'), true)
|
3499
|
-
assert(Units.new('m') =~ Units.new('1'), false)
|
3500
|
-
|
3501
|
-
un1 = Units['day since 2000-01-01']
|
3502
|
-
un2 = Units['s since 2000-01-01']
|
3503
|
-
assert(un1.convert(0, un2), 0.0)
|
3504
|
-
assert(un1.convert(1, un2), 86400.0)
|
3505
|
-
end
|
1
|
+
require "numru/units/version"
|
2
|
+
require "numru/units/units.rb"
|