This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-431-430
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-431-430 by this push:
new 362f987 WIP.
362f987 is described below
commit 362f987a82a28cb315b8306c7258bf278c331e2c
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Sep 6 12:22:03 2021 +0300
WIP.
---
.../apache/nlpcraft/common/nlp/numeric/NCNumericManager.scala | 2 +-
.../probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/numeric/NCNumericManager.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/numeric/NCNumericManager.scala
index 1dab5ef..3d767dc 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/numeric/NCNumericManager.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/numeric/NCNumericManager.scala
@@ -85,7 +85,7 @@ object NCNumericManager extends NCService {
* @return
*/
private def mkSolidNumUnit(t: NCNlpSentenceToken): Option[NCNumeric] = {
- val s = t.origText
+ val s = t.normText
val num = s.takeWhile(_.isDigit)
val after = s.drop(num.length)
diff --git
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
index c8cca78..7e25cb1 100644
---
a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
+++
b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/numeric/NCEnricherNumericSpec.scala
@@ -28,7 +28,6 @@ import org.junit.jupiter.api.Test
class NCEnricherNumericSpec extends NCEnricherBaseSpec {
/**
*
- * @throws Exception
*/
@Test
def test(): Unit =
@@ -63,6 +62,14 @@ class NCEnricherNumericSpec extends NCEnricherBaseSpec {
Seq(
num(text = "23m", 23, 23, unit = Some("meter"))
)
+ ),
+
+ // One variant.
+ _ => checkAll(
+ "23M",
+ Seq(
+ num(text = "23M", 23, 23, unit = Some("meter"))
+ )
)
)
}