You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2022/09/06 22:33:27 UTC
[incubator-nlpcraft] branch master updated: Scaladoc.
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/master by this push:
new 4cc50a05 Scaladoc.
4cc50a05 is described below
commit 4cc50a0570067dcf9159a6314cd01633ae64c049
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Tue Sep 6 15:33:21 2022 -0700
Scaladoc.
---
.../nlpcraft/annotations/NCIntentObject.java | 5 +-
scaladoc/docroot.md | 61 +++++++++++++++++++++-
2 files changed, 62 insertions(+), 4 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/annotations/NCIntentObject.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/annotations/NCIntentObject.java
index b11ebc1e..56f2d1d1 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/annotations/NCIntentObject.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/annotations/NCIntentObject.java
@@ -25,9 +25,8 @@ import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
- * TODO:
- * Marker annotation. Applied to class member of main model.
- * These fields objects scanned the same way as main model.
+ * Marker annotation that can be applied to class member of main model.
+ * The fields objects annotated with this annotation are scanned the same way as main model.
*/
@Documented
@Retention(value=RUNTIME)
diff --git a/scaladoc/docroot.md b/scaladoc/docroot.md
index cf57e844..993dfc29 100644
--- a/scaladoc/docroot.md
+++ b/scaladoc/docroot.md
@@ -32,13 +32,72 @@ libraryDependencies += "org.apache.nlpcraft" % "nlpcraft" % "1.0.0"
#### **Annotations:**
Due to Scala 3 limitation on runtime retained annotations NLPCraft annotations are written in Java. Javadoc documentation
-cannot be readily integrated into standard Scaladoc tooling chain and therefore NLPCraft annotations are listed here
+cannot be readily integrated into standard Scaladoc toolchain and thus NLPCraft annotations are listed here
along with their source code for the purpose of documentation:
`org.apache.nlpcraft.annotations.`**NCIntent**
+<pre>
+// Annotation to bind an intent with the method serving as its callback.
+@Documented
+@Retention(value=RUNTIME)
+@Target(value={METHOD, TYPE})
+@Repeatable(NCIntent.NCIntentList.class)
+public @interface NCIntent {
+ // Intent specification using IDL.
+ String value() default "";
+ // Grouping annotation required for when more than one 'NCIntent' annotation is used.
+ @Retention(RetentionPolicy.RUNTIME)
+ @Documented
+ @Target(value={METHOD, TYPE})
+ @interface NCIntentList {
+ // Gets the list of all 'NCIntent' annotations attached to the callback or class.
+ NCIntent[] value();
+ }
+}
+</pre>
`org.apache.nlpcraft.annotations.`**NCIntentRef**
+<pre>
+// Annotation referencing an intent defined outside of callback method declaration.
+@Documented
+@Retention(value=RUNTIME)
+@Target(value=METHOD)
+@Repeatable(NCIntentRef.NCIntentRefList.class)
+public @interface NCIntentRef {
+ // ID of the intent defined externally.
+ String value() default "";
+
+ // Grouping annotation required for when more than one 'NCIntentRef' annotation is used.
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(value=METHOD)
+ @Documented
+ @interface NCIntentRefList {
+ // Gets the list of all 'NCIntentRef' annotations attached to the callback.
+ NCIntentRef[] value();
+ }
+}
+</pre>
`org.apache.nlpcraft.annotations.`**NCIntentTerm**
+<pre>
+// Annotation to mark callback parameter to receive intent term's tokens.
+@Documented
+@Retention(value=RUNTIME)
+@Target(value=PARAMETER)
+public @interface NCIntentTerm {
+ // ID of the intent term.
+ String value();
+}
+</pre>
`org.apache.nlpcraft.annotations`.**NCIntentObject**
+<pre>
+// Marker annotation that can be applied to class member of main model.
+// The fields objects annotated with this annotation are scanned the same way as main model.
+@Documented
+@Retention(value=RUNTIME)
+@Target(value=FIELD)
+public @interface NCIntentObject {
+ // No-op.
+}
+</pre>