Recognizers-Text icon indicating copy to clipboard operation
Recognizers-Text copied to clipboard

[* Unit] Support for compound dimension units (#2037)

Open aitelint opened this issue 5 years ago • 10 comments

Added support for compound dimension units so that they can be extracted as a single entity. The compound behaviour is controlled by the flag EnableCompoundTypes as requested in #2037. Relevant test cases have been added to the new spec file DimensionModelCompoundMode.json.

Also noticed that 'gallon' is currently listed among the units of weight (WeightSuffixList), but should not it be among the units of volume (VolumeSuffixList)?

aitelint avatar Jul 27 '20 17:07 aitelint

@LionbridgeCSII, @LionbridgeCS2, should #2217 be merged first? Or does this one replace it?

tellarin avatar Jul 29 '20 02:07 tellarin

@tellarin, this one contains also the commit from #2217. But it seems that the use of 'double[]' in the new dictionary DimensionUnitMultiplesMap is breaking the javascript build

aitelint avatar Jul 29 '20 05:07 aitelint

@tellarin, this one contains also the commit from #2217. But it seems that the use of 'double[]' in the new dictionary DimensionUnitMultiplesMap is breaking the javascript build

Does javascript support something like "number[]"? If so, the code generator can be modified to translate the type. Can you test this and reply here? If it would work, we can plan to change the generator soon.

tellarin avatar Sep 02 '20 10:09 tellarin

Does javascript support something like "number[]"? If so, the code generator can be modified to translate the type. Can you test this and reply here? If it would work, we can plan to change the generator soon.

I remember trying using other types like "int[]" and "string[]", (not sure about "number[]" but will try again), but they all gave the same problem

aitelint avatar Sep 02 '20 11:09 aitelint

@tellarin, with "number[]" javascript builds correctly, but .NET does not support it.

aitelint avatar Sep 04 '20 07:09 aitelint

I'll try to commit a change to JavaScript code generator in this PR soon to make the conversion. The YAML should still declare it as double.

tellarin avatar Sep 04 '20 08:09 tellarin

I'm making the mentioned change in another PR that will also update all generated resources across platforms. Once that's merged, this PR can be rebased on /master and it should pass. Then we can go through the full review. Sorry for the delay.

tellarin avatar Sep 09 '20 06:09 tellarin

@LionbridgeCSII, PR #2273 included the code gen change. You should now be able to use double[] in the YAML dictionary.

tellarin avatar Sep 15 '20 05:09 tellarin

@tellarin, it seems that now java compilation fails

aitelint avatar Sep 17 '20 07:09 aitelint

@tellarin, it seems that now java compilation fails

modifed the java code generator to include double[], but still failing. So, modified again to transform double[] to string[]

aitelint avatar Sep 21 '20 05:09 aitelint