Revision 2129

tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java (revision 2129)
162 162
		return builder.toString();
163 163
	}
164 164

  
165
	public static String getText(File xmlWFile, String string) throws IOException {
166
		BufferedReader reader = getReader(xmlWFile);
165
	public static String getText(File file) throws IOException {
166
		return getText(file, UTF8);
167
	}
168
	
169
	public static String getText(File file, String encoding) throws IOException {
170
		BufferedReader reader = getReader(file, encoding);
167 171
		StringBuilder builder = new StringBuilder();
168 172
		try{
169 173
			String line = reader.readLine();
tmp/org.txm.connlu.core/groovy/org/txm/scripts/importer/connlu/CONNLUImport.groovy (revision 2129)
35 35
		
36 36
		super.start(); // call the usual XTZ import
37 37
		
38
		if (successFul) {
38
		if (isSuccessful) {
39 39
			println "BUILD CONNL-UD indexes ??"
40 40
	
41 41
		}
tmp/org.txm.connlu.core/groovy/org/txm/scripts/importer/connlu/connluLoader.groovy (revision 2129)
55 55
		i.pager = new XTZPager(i)
56 56
 */
57 57
i.process();
58
readyToLoad = i.successFul && project.save()
58
readyToLoad = i.isSuccessful && project.save()
tmp/org.txm.tigersearch.rcp/.classpath (revision 2129)
8 8
		</accessrules>
9 9
	</classpathentry>
10 10
	<classpathentry kind="src" path="src"/>
11
	<classpathentry kind="src" path="groovy"/>
11 12
	<classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
12 13
	<classpathentry exported="true" kind="lib" path="lib/log4j-1.2.12.jar"/>
13 14
	<classpathentry exported="true" kind="lib" path="lib/TigerSearch.jar">
tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImport.groovy (revision 2129)
12 12
import org.txm.objects.Project
13 13
import org.txm.utils.BundleUtils;
14 14
import org.txm.utils.io.FileCopy;
15
import org.txm.utils.io.IOUtils
15 16
import org.apache.log4j.BasicConfigurator;
16 17
import org.txm.importer.xtz.*
17 18
import org.txm.scripts.importer.xtz.*
......
40 41
		
41 42
		super.start(); // call the usual XTZ import
42 43
		
43
		if (successFul) {
44
		if (isSuccessful) {
44 45

  
45 46
			File tigerDir = new File(this.binaryDirectory, "tiger");
46 47
			tigerDir.mkdir();
......
83 84
				IndexBuilderErrorHandler handler = new SimpleErrorHandler(tigerBinDir.getAbsolutePath());
84 85
				XMLIndexing indexing = new XMLIndexing(corpusName, uri, tigerBinDir.getAbsolutePath(), handler,false);
85 86
				indexing.startIndexing();
87
				File logs = new File(tigerBinDir, "indexing.log");
88
				String txt = IOUtils.getText(logs);
89
				if (txt.contains("Error in corpus graph ")) {
90
					println  "Error while importing TIGER corpus: "+txt;
91
					isSuccessful = false;
92
				}
86 93
			}
87 94
			catch (Exception e) { System.out.println(e.getMessage()); }
88 95
		}
tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/tigersearchLoader.groovy (revision 2129)
56 56
		i.pager = new XTZPager(i)
57 57
 */
58 58
i.process();
59
readyToLoad = i.successFul && project.save()
59
readyToLoad = i.isSuccessful && project.save()
tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java (revision 2129)
53 53

  
54 54
	@Override
55 55
	public Selection query(CorpusBuild corpus, Query query, String name, boolean saveQuery) throws Exception {
56
		
56 57
		File tigerDirectory = new File(corpus.getProjectDirectory(), "tiger");
57 58
		File configfile = new File(tigerDirectory, "tigersearch.logprop");
58 59
		TSCorpusManager manager = new TSCorpusManager(tigerDirectory, configfile);
59 60

  
60
		
61 61
		TSCorpus tcorpus = manager.getCorpus(corpus.getRootCorpusBuild().getID());
62 62
		TSResult result = tcorpus.query(query.getQueryString().replace("\n", " "));
63 63
		MatchResult mresult = result.getMatchResult();
......
96 96
			//System.out.println(" sent: "+sent);
97 97
			int sent_submatch = mresult.getSentenceSubmatchSize(sent);
98 98
			
99
			
100 99
			//System.out.println(" sent submatch size: "+sent_submatch);
101 100
			for (int isubmatch = 0 ; isubmatch < sent_submatch ; isubmatch++) { // the matches in the sentence
102 101
				int[] match = mresult.getSentenceSubmatchAt(sent, isubmatch);

Also available in: Unified diff