-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDesqExampleWithDictionary.scala
More file actions
31 lines (22 loc) · 1.02 KB
/
DesqExampleWithDictionary.scala
File metadata and controls
31 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package de.uni_mannheim.desq.examples.readme
import de.uni_mannheim.desq.dictionary._
import de.uni_mannheim.desq.mining.spark._
import org.apache.spark.{SparkConf, SparkContext}
object DesqExampleWithDictionary {
def main(args: Array[String]) {
implicit val sc = new SparkContext(new SparkConf().setAppName(getClass.getName).setMaster("local"))
// read the dictionary
val dictionary = Dictionary.loadFrom("data/readme/dictionary.json")
// read the data and convert it into DESQ's internal format (DesqDataset)
val data = DesqDataset.loadFromDelFile("data/readme/sequences.del", dictionary).recomputeDictionary()
// create a Miner
val patternExpression = "(.^...^)"
val minimumSupport = 2
val properties = DesqCount.createConf(patternExpression, minimumSupport)
val miner = DesqMiner.create(new DesqMinerContext(properties))
// do the mining; this creates another DesqDataset containing the result
val patterns = miner.mine(data)
// print the result
patterns.print()
}
}