You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by if...@apache.org on 2021/02/19 01:56:47 UTC
[incubator-nlpcraft] 18/21: Fix regex
This is an automated email from the ASF dual-hosted git repository.
ifropc pushed a commit to branch NLPCRAFT-91
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit 4fe3ee10716190f4f00c959bb47cf8ee46324fe1
Author: Ifropc <if...@apache.org>
AuthorDate: Wed Feb 10 17:54:05 2021 -0800
Fix regex
---
.../nlpcraft/probe/mgrs/deploy/NCDeployManager.scala | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index 58a8c36..ec250c2 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -17,35 +17,33 @@
package org.apache.nlpcraft.probe.mgrs.deploy
+import io.opencensus.trace.Span
import java.io._
import java.lang.reflect.{InvocationTargetException, Method, ParameterizedType, Type}
import java.util
import java.util.function.Function
import java.util.jar.JarInputStream
import java.util.regex.{Pattern, PatternSyntaxException}
-
-import io.opencensus.trace.Span
-import org.apache.nlpcraft.model.NCModelView._
import org.apache.nlpcraft.common._
import org.apache.nlpcraft.common.ascii.NCAsciiTable
import org.apache.nlpcraft.common.config.NCConfigurable
import org.apache.nlpcraft.common.makro.NCMacroParser
import org.apache.nlpcraft.common.nlp.core.{NCNlpCoreManager, NCNlpPorterStemmer}
import org.apache.nlpcraft.common.util.NCUtils.{DSL_FIX, REGEX_FIX}
+import org.apache.nlpcraft.model.NCModelView._
import org.apache.nlpcraft.model._
import org.apache.nlpcraft.model.factories.basic.NCBasicModelFactory
import org.apache.nlpcraft.model.intent.impl.{NCIntentDslCompiler, NCIntentSolver}
import org.apache.nlpcraft.model.intent.utils.NCDslIntent
import org.apache.nlpcraft.probe.mgrs.NCProbeSynonymChunkKind.{DSL, REGEX, TEXT}
-import org.apache.nlpcraft.probe.mgrs.{NCProbeModel, NCProbeSynonym, NCProbeSynonymChunk}
import org.apache.nlpcraft.probe.mgrs.model.NCModelSynonymDslCompiler
+import org.apache.nlpcraft.probe.mgrs.{NCProbeModel, NCProbeSynonym, NCProbeSynonymChunk}
import resource.managed
-
import scala.collection.JavaConverters._
-import scala.compat.java8.OptionConverters._
import scala.collection.convert.DecorateAsScala
-import scala.collection.{Map, Seq, Set, mutable}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
+import scala.collection.{Map, Seq, Set, mutable}
+import scala.compat.java8.OptionConverters._
import scala.util.control.Exception._
/**
@@ -53,7 +51,7 @@ import scala.util.control.Exception._
*/
object NCDeployManager extends NCService with DecorateAsScala {
private final val TOKENS_PROVIDERS_PREFIXES = Set("nlpcraft:", "google:", "stanford:", "opennlp:", "spacy:")
- private final val ID_REGEX = "^[_a-zA-Z]+[a-zA-Z0-9:-_]*$"
+ private final val ID_REGEX = "^[_a-zA-Z]+[a-zA-Z0-9:\\-_]*$"
private final val CLS_INTENT = classOf[NCIntent]
private final val CLS_INTENT_REF = classOf[NCIntentRef]