Compare commits

...

2 Commits

Author SHA1 Message Date
401a3ecbc8 canonical unit names must be singular!
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
fixes #34
2025-03-19 13:10:55 -04:00
d7416b480b roomread trigger
fixes #32
2025-03-18 21:43:28 -04:00
3 changed files with 15 additions and 7 deletions

View File

@ -10,7 +10,7 @@ public class RoomRead : Behavior
{ {
public override string Name => "Room Read"; public override string Name => "Room Read";
public override string Trigger => "roomread"; public override string Trigger => "!roomread";
public override async Task<bool> ActOn(Message message) public override async Task<bool> ActOn(Message message)
{ {

View File

@ -127,6 +127,7 @@ namespace vassago.Conversion
return $"{String.Format("{0:N}", accumulator)} {normalizedDestUnit}"; return $"{String.Format("{0:N}", accumulator)} {normalizedDestUnit}";
} }
} }
return "you can never read this.";
} }
return "dimensional analysis failure - I know those units but can't find a path between them."; return "dimensional analysis failure - I know those units but can't find a path between them.";
} }
@ -170,9 +171,9 @@ namespace vassago.Conversion
{ {
if (conv.Item1 == last && currentPath.Contains(conv.Item2) == false && conv.Item3 != null) if (conv.Item1 == last && currentPath.Contains(conv.Item2) == false && conv.Item3 != null)
{ {
var test = exhaustiveBreadthFirst(dest, currentPath.Append(conv.Item2)); var test = exhaustiveBreadthFirst(dest, currentPath.Append(conv.Item2));
if (test != null) if (test != null)
return test; return test;
} }
if (conv.Item2 == last && currentPath.Contains(conv.Item1) == false && conv.Item4 != null) if (conv.Item2 == last && currentPath.Contains(conv.Item1) == false && conv.Item4 != null)
{ {

View File

@ -219,16 +219,16 @@
] ]
}, },
{ {
"canonical":"blue whale lengths", "canonical":"blue whale length",
"aliases": [ "aliases": [
"bwl", "bwl",
"whales" "whales"
] ]
}, },
{ {
"canonical":"ångströms", "canonical":"ångström",
"aliases": [ "aliases": [
"angstroms", "angstrom",
"Å" "Å"
] ]
}, },
@ -239,6 +239,12 @@
"micrometres", "micrometres",
"microns" "microns"
] ]
},
{
"canonical":"uncle jordan",
"aliases":[
"uj"
]
} }
], ],
"linearPairs":[ "linearPairs":[
@ -267,6 +273,7 @@
{"item1":"blue whale length", "item2": "m", "factor": 29.9}, {"item1":"blue whale length", "item2": "m", "factor": 29.9},
{"item1":"m", "item2": "ångström", "factor": 10000000000}, {"item1":"m", "item2": "ångström", "factor": 10000000000},
{"item1":"smoot", "item2": "ft", "factor": 5.583333333333}, {"item1":"smoot", "item2": "ft", "factor": 5.583333333333},
{"item1":"uncle jordan", "item2": "cm", "factor":192.405},
{"item1":"floz", "item2":"mL", "factor":29.57344}, {"item1":"floz", "item2":"mL", "factor":29.57344},
{"item1":"L", "item2":"mL", "factor":1000}, {"item1":"L", "item2":"mL", "factor":1000},