private def checkMinMax()

in nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelScanner.scala [306:327]


    private def checkMinMax(cfg: NCModelConfig, mtd: Method, paramCls: Seq[Class[_]], limits: Seq[(Int, Int)]): Unit =
        require(paramCls.sizeIs == limits.length)

        paramCls.zip(limits).zipWithIndex.foreach { case ((cls, (min, max)), i) =>
            def mkArg(): String = arg2Str(mtd, i)

            val p1 = "its $IT annotated argument"
            val p2 = s"mdlId=${cfg.getId}, arg=${mkArg()}"

            // Argument is single entity but defined as not single entity.
            if cls == CLS_ENTITY && (min != 1 || max != 1) then
                E(s"Intent term must have [1,1] quantifier because $p1 is a single value [$p2]")
            // Argument is not single entity but defined as single entity.
            else if cls != CLS_ENTITY && (min == 1 && max == 1) then
                E(s"Intent term has [1,1] quantifier but $p1 is not a single value [$p2]")
            // Argument is optional but defined as not optional.
            else if cls == CLS_SCALA_OPT && (min != 0 || max != 1) then
                E(s"Intent term must have [0,1] quantifier because $p1 is optional [$p2]")
            // Argument is not optional but defined as optional.
            else if cls != CLS_SCALA_OPT && (min == 0 && max == 1) then
                E(s"Intent term has [0,1] quantifier but $p1 is not optional [$p2]")
        }