Skip to content

Commit 2aa0d3a

Browse files
committed
add scala doc
1 parent 0430d86 commit 2aa0d3a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/main/scala/com/johnsnowlabs/nlp/HasMultipleInputAnnotationCols.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@
1616

1717
package com.johnsnowlabs.nlp
1818

19-
import com.johnsnowlabs.nlp.AnnotatorType.CHUNK
20-
import org.apache.spark.ml.param.{Params, StringArrayParam}
21-
import org.apache.spark.sql.types.StructType
22-
19+
/**
20+
* Trait used to create annotators with input columns of variable length.
21+
* */
2322
trait HasMultipleInputAnnotationCols extends HasInputAnnotationCols {
2423

24+
/** Annotator reference id. The Annotator type is the same for any of the input columns*/
2525
val inputAnnotatorType: String
2626

2727
lazy override val inputAnnotatorTypes: Array[String] = getInputCols.map(_ =>inputAnnotatorType)
2828

29+
/**
30+
* Columns that contain annotations necessary to run this annotator
31+
* AnnotatorType is the same for all input columns in that annotator.
32+
*/
2933
override def setInputCols(value: Array[String]): this.type = {
3034
set(inputCols, value)
3135
}

src/test/scala/com/johnsnowlabs/nlp/annotators/multipleannotations/MultiannotationsSpec.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.johnsnowlabs.nlp.annotators.multipleannotations
22

3-
import com.johnsnowlabs.nlp.annotators.sbd.pragmatic.SentenceDetector
4-
import com.johnsnowlabs.nlp.{ContentProvider, DocumentAssembler, LightPipeline, RecursivePipeline, SparkAccessor}
5-
import com.johnsnowlabs.nlp.annotators.{TextMatcher, Tokenizer}
6-
import com.johnsnowlabs.nlp.util.io.ReadAs
3+
import com.johnsnowlabs.nlp.{DocumentAssembler, LightPipeline,SparkAccessor}
74
import com.johnsnowlabs.tags.FastTest
85
import org.apache.spark.ml.Pipeline
96
import org.scalatest.flatspec.AnyFlatSpec
@@ -12,7 +9,7 @@ class MultiannotationsSpec extends AnyFlatSpec {
129
import SparkAccessor.spark.implicits._
1310

1411
"An multiple anootator chunks" should "transform data " taggedAs FastTest in {
15-
val data = SparkAccessor.spark.sparkContext.parallelize(Seq("Example text")).toDS().toDF("text")
12+
val data = SparkAccessor.spark.sparkContext.parallelize(Seq("Example text")).toDS().toDF("text")
1613

1714
val documentAssembler = new DocumentAssembler()
1815
.setInputCol("text")

0 commit comments

Comments
 (0)