-
Notifications
You must be signed in to change notification settings - Fork 0
/
actor-script.scala
39 lines (29 loc) · 937 Bytes
/
actor-script.scala
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
32
33
34
35
36
37
38
39
package acrostic
import scala.io.Source
import scala.collection.{immutable, mutable}
object AcrosticFinder {
private val text_file = "test1.txt"
private val outputter = new Outputter
def load_words(dictionary_file: String) = {
val word_list = new mutable.ArrayBuffer[Lookup]()
for (word <- Source.fromFile(dictionary_file).getLines map { _.trim }) {
val lu = new Lookup(word, outputter)
lu.start
word_list += lu
}
println("[!] generated " + word_list.size + " dictionary words")
return word_list
}
def main(args: Array[String]) {
println("[!] starting acrostic finding")
val dictionary = new Dictionary(load_words(args(0)))
dictionary.start()
outputter.start()
val column_splitter = new ColumnSplitter(dictionary)
column_splitter.start()
column_splitter! args(1)
Thread.sleep(1000)
System.exit(0)
}
}
// vim: set ts=4 sw=4 et: