You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2020/05/19 16:42:33 UTC

[incubator-nlpcraft] branch NLPCRAFT-30-tmp updated: Utilities methods refactoring.

This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch NLPCRAFT-30-tmp
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-30-tmp by this push:
     new a8f3625  Utilities methods refactoring.
a8f3625 is described below

commit a8f36252f2a2a5ddc277abacb2e9de096d96c224
Author: Sergey Kamov <se...@apache.org>
AuthorDate: Tue May 19 19:42:22 2020 +0300

    Utilities methods refactoring.
---
 .../probe/mgrs/nlp/impl/NCVariantsCreator.scala    | 27 ++++++++++++++++++----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/impl/NCVariantsCreator.scala b/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/impl/NCVariantsCreator.scala
index 9cc3789..9cd7bad 100644
--- a/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/impl/NCVariantsCreator.scala
+++ b/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/impl/NCVariantsCreator.scala
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.nlpcraft.probe.mgrs.nlp.impl
 
 import java.io.Serializable
@@ -14,15 +31,15 @@ import scala.collection.{Seq, mutable}
 import scala.language.implicitConversions
 
 /**
-  *
+  * Utility class prepare list of variants based on list of sentences.
   */
 private[nlp] object NCVariantsCreator {
     /**
+      * Makes variants for given sentences.
       *
-      * @param mdl
-      * @param srvReqId
-      * @param sens
-      * @return
+      * @param mdl Model.
+      * @param srvReqId Server request ID.
+      * @param sens Sentences.
       */
     def makeVariants(mdl: NCModelDecorator, srvReqId: String, sens: Seq[NCNlpSentence]): Seq[NCVariant] = {
         val seq = sens.map(_.toSeq.map(nlpTok ⇒ NCTokenImpl(mdl, srvReqId, nlpTok) → nlpTok))