New format for constants

master
hemanth 2015-08-14 05:58:59 +00:00
parent 722a8e47b3
commit e9f62738fb
3 changed files with 212 additions and 44 deletions

View File

@ -23,7 +23,7 @@ triggers startend => @triggers;
# Handle statement
handle query_lc => sub {
return unless my $val = $constants->{$_}; #lookup hash using query as key
return unless my $val = $constants->{$_}->{'value'}->{'html'}; #lookup hash using query as key
return $val, structured_answer => {
input => [],

View File

@ -1,41 +1,209 @@
"1729" : "Hardy Ramanujan number 1729 = 1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>"
"avogadro's number" : "Avogadro's number = 6.0221415 10^23"
"euler's constant" : "Euler's constant = 0.577215665"
"eulers constant" : "Euler's constant = 0.577215665"
"hardy ramanujan number" : "Hardy Ramanujan number 1729 = 1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>"
"planck's constant" : "Planck's constant = 6.626068 10^-34 m^2 kg / s"
"ramanujan number": "Hardy Ramanujan number 1729 = 1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>"
'amu' : '1 atomic mass unit = 1.66053886 10^-27 kilograms'
'astronomical unit' : '1 Astronomical Unit = 149 598 000 kilometers'
'atomic mass unit' : '1 atomic mass unit = 1.66053886 10^-27 kilograms'
'au' : '1 Astronomical Unit = 149 598 000 kilometers'
'avogadros number' : "Avogadro's number = 6.0221415 10^23"
'boltzmann constant' : 'Boltzmann constant = 1.3806503 10^-23 m^2 kg s^-2 K^-1'
'boltzmann constant' : 'the Stefan Boltzmann constant = 5.6704 10^-8 kg s^-3 K^-4'
'c' : 'the speed of light = 299 792 458 m / s'
'charge of electron' : 'elementary charge = 1.60217646 10^-19 coulombs'
'electron charge' : 'elementary charge = 1.60217646 10^-19 coulombs'
'electron mass' : 'electron mass = 9.10938188 10^-31 kilograms'
'electron volt' : '1 electron volt = 1.60217646 10^-19 joules'
'elementary charge' : 'elementary charge = 1.60217646 10^-19 coulombs'
'epsilon_0' : 'electric constant = 8.85418782 10^-12 m^-3 kg^-1 s^4 A^2'
'ev' : '1 electron volt = 1.60217646 10^-19 joules'
'faraday constant' : 'Faraday constant = 96 485.3415 s A / mol'
'fine structure constant' : 'fine-structure constant = 0.00729735253'
'fine-structure constant' : 'fine-structure constant = 0.00729735253'
'g' : 'gravitational constant = 6.67300 10^-11 m^3 kg^-1 s^-2'
'gravitational constant' : 'gravitational constant = 6.67300 10^-11 m^3 kg^-1 s^-2'
'h' : "Planck's constant = 6.626068 10^-34 m^2 kg / s"
'hbar' : 'hbar = 1.05457148 10^-34 m^2 kg / s'
'k' : 'Boltzmann constant = 1.3806503 10-23 m^2 kg s^-2 K^-1'
'magnetic flux quantum' : 'magnetic flux quantum = 2.06783364 10^-15 webers'
'molar gas constant' : 'the molar gas constant = 8.314472 m^2 kg s^-2 K^-1 mol^-1'
'permeability of free space' : 'the magnetic constant = 1.25663706 10^-6 m kg s^-2 A^-2'
'plancks constant' : "Planck's constant = 6.626068 10^-34 m^2 kg / s"
'proton mass' : 'proton mass = 1.67262158 10^-27 kilograms'
'q' : 'q = 1.60217733e^-19 coulomb'
'radius mars' : 'radius of Mars = 3397 kilometers'
'rydberg constant' : 'Rydberg constant = 10 973 731.6 m^-1'
'speed of light' : 'the speed of light = 299 792 458 m / s'
'speed of sound' : 'speed of sound at sea level = 340.29 m / s'
'stefan-boltzmann constant' : 'the Stefan Boltzmann constant = 5.6704 10^-8 kg s^-3 K^-4'
hardy ramanujan number:
name: Hardy Ramanujan Number 1729
aliases:
- the hardy ramanujan number
- hardy ramanujan number
- ramanujan number
- 1729
symbol:
wiki:
value:
plain: '1^3 + 12^3 = 9^3 + 10^3'
html: '1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>'
avogadros number:
name: Avogadro's Number
symbol:
wiki:
value:
plain: '6.0221415 10^23'
html: '6.0221415 10<sup>23</sup>'
eulers constant:
name: Euler's Constant
symbol:
wiki:
value:
plain: '0.577215665'
plancks constant:
name: planck's Constant
aliases:
- h
symbol:
wiki:
value:
plain: '6.626068 10^-34 m^2 kg / s'
html: '6.626068 10<sup>-34</sup> m<sup>2</sup> kg / s'
atomic mass unit:
name: 1 Atomic Mass Unit
aliases:
- amu
symbol:
wiki:
value:
plain: '1.66053886 10^-27 kilograms'
html: '1.66053886 10<sup>-27</sup> kilograms'
astronomical unit:
name: 1 Astronomical Unit
aliases:
- au
symbol:
wiki:
value:
plain: '149 598 000 kilometers'
avogadros number:
name: Avogadro's Number
symbol:
wiki:
value:
plain: '6.0221415 10^23'
html: '6.0221415 10<suip>23</sup>'
boltzmann constant:
name: The Stefan Boltzmann Constant
aliases:
- stefan boltzmann constant
- the stefan boltzmann constant
- k
symbol:
wiki:
value:
plain: '1.3806503 10^-23 m^2 kg s^-2 K^-1'
html: '1.3806503 10<sup>-23</sup> m<sup>2</sup> kg s<sup>-2</sup> K<sup>-1</sup>'
charge of electron:
name: Elementary Charge
aliases:
- electron charge
- elementary charge
symbol:
wiki:
value:
plain: '1.60217646 10^-19 coulombs'
html: '1.60217646 10<sup>-19</sup> coulombs'
electron mass:
name: Electron Mass
symbol:
wiki:
value:
plain: '9.10938188 10^-31 kilograms'
html: '9.10938188 10<sup>-31</sup> kilograms'
electron volt:
aliases:
- ev
name: 1 Electron Volt
symbol:
wiki:
value:
plain: '1.60217646 10^-19 joules'
html: '1.60217646 10<sup>-19</sup> joules'
epsilon 0:
name: Electric Constant
symbol:
wiki:
value:
plain: '8.85418782 10^-12 m^-3 kg^-1 s^4 A^2'
html: '8.85418782 10<sup>-12</sup> m<sup>-3</sup> kg<sup>-1</sup> s<sup>4</sup> A<sup>2</sup>'
faraday constant:
name: Faraday Constant
symbol:
wiki:
value:
plain: '96 485.3415 s A / mol'
fine structure constant:
name: Fine-structure Constant
symbol:
wiki:
value:
plain: '0.00729735253'
gravitational constant:
name: Gravitational Constant
aliases:
- g
symbol:
wiki:
value:
plain: '6.67300 10^-11 m^3 kg^-1 s^-2'
html: '6.67300 10<sup>-11</sup> m<sup>3</sup> kg<sup>-1</sup> s<sup>-2</sup>'
hbar:
name: hbar
symbol:
wiki:
value:
plain: '1.05457148 10^-34 m^2 kg / s'
html: '1.05457148 10<sup>-34</sup> m<sup>2</sup> kg / s'
magnetic flux quantum:
name: Magnetic Flux Quantum
symbol:
wiki:
value:
plain: '2.06783364 10^-15 webers'
html: '2.06783364 10<sup>-15</sup> webers'
molar gas constant:
name: The Molar Gas Constant
symbol:
wiki:
value:
plain: '8.314472 m^2 kg s^-2 K^-1 mol^-1'
html: '8.314472 m<sup>2</sup> kg s<sup>-2</sup> K<sup>-1</sup> mol<sup>-1</sup>'
permeability of free space:
name: The Magnetic Constant
symbol:
wiki:
value:
plain: '1.25663706 10^-6 m kg s^-2 A^-2'
html: '1.25663706 10<sup>-6</sup> m kg s<sup>-2</sup> A<sup>-2</sup>'
proton mass:
name: proton Mass
symbol:
wiki:
value:
plain: '1.67262158 10^-27 kilograms'
html: '1.67262158 10<sup>-27</sup> kilograms'
q:
name: q
symbol:
wiki:
value:
plain: '1.60217733e^-19 coulomb'
html: '1.60217733e<sup>-19</sup> coulomb'
rydberg constant:
name: Rydberg Constant
symbol:
wiki:
value:
plain: '10 973 731.6 m^-1'
html: '10 973 731.6 m<sup>-1</sup>'
speed of light:
name: the Speed Of Light
aliases:
- c
symbol:
wiki:
value:
plain: '299 792 458 m / s'
speed of sound:
name: speed Of Sound At Sea Level
symbol:
wiki:
value:
plain: '340.29 m / s'

View File

@ -11,11 +11,11 @@ zci is_cached => 1;
ddg_goodie_test(
[qw( DDG::Goodie::Constants )],
"Hardy Ramanujan number" => test_zci(
'Hardy Ramanujan number 1729 = 1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>',
'1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>',
structured_answer => {
input => [],
operation => 'Constants',
result => "Hardy Ramanujan number 1729 = 1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>",
result => "1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>",
}
),
"How old is my grandma?" => undef,