Statistics
| Revision:

root / tmp / org.txm.core.tests / src / org / txm / scripts / tests / test1 / create.groovy @ 1626

History | View | Annotate | Download (757 Bytes)

1 1626 mdecorde
package org.txm.scripts.tests.test1
2 1626 mdecorde
3 1626 mdecorde
import java.util.Calendar
4 1626 mdecorde
import java.util.Locale
5 1626 mdecorde
6 1626 mdecorde
import org.txm.*
7 1626 mdecorde
import org.txm.core.results.TXMResult
8 1626 mdecorde
import org.txm.objects.*
9 1626 mdecorde
import org.txm.searchengine.cqp.corpus.MainCorpus
10 1626 mdecorde
import org.txm.properties.core.functions.*
11 1626 mdecorde
12 1626 mdecorde
Workspace w = Toolbox.workspace
13 1626 mdecorde
14 1626 mdecorde
Project p = w.getProject("NANOBROWN")
15 1626 mdecorde
if (p != null) {
16 1626 mdecorde
        p.delete();
17 1626 mdecorde
}
18 1626 mdecorde
19 1626 mdecorde
p = new Project(w, "NANOBROWN", true)
20 1626 mdecorde
p.setSourceDirectory("")
21 1626 mdecorde
p.setDescription("Test1 corpus");
22 1626 mdecorde
p.setLang("en");
23 1626 mdecorde
p.setImportModuleName("xtz")
24 1626 mdecorde
if (!p.compute()) {
25 1626 mdecorde
        return false;
26 1626 mdecorde
}
27 1626 mdecorde
28 1626 mdecorde
MainCorpus c = p.getCorpusBuild("NANOBROWN")
29 1626 mdecorde
if (c == null) {
30 1626 mdecorde
        return false;
31 1626 mdecorde
}
32 1626 mdecorde
33 1626 mdecorde
Properties props = new Properties(c)
34 1626 mdecorde
if (!props.compute()) {
35 1626 mdecorde
        return false
36 1626 mdecorde
}
37 1626 mdecorde
38 1626 mdecorde
return ["project":p, "corpus":c, "properties":props]