Révision 116

tmp/org.txm.core/default.xml (revision 116)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<workspace name="default">
3
   <projects>
4
      <project name="default">
5
         <bases>
6
         </bases>
7

  
8
         <corpora>
9
         </corpora>
10
      </project>
11
   </projects>
12
</workspace>
0 13

  
tmp/org.txm.core/.project (revision 116)
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>org.txm.core</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>org.eclipse.pde.ManifestBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
		<buildCommand>
19
			<name>org.eclipse.pde.SchemaBuilder</name>
20
			<arguments>
21
			</arguments>
22
		</buildCommand>
23
		<buildCommand>
24
			<name>net.sourceforge.metrics.builder</name>
25
			<arguments>
26
			</arguments>
27
		</buildCommand>
28
		<buildCommand>
29
			<name>com.stateofflow.eclipse.metrics.MetricsBuilder</name>
30
			<arguments>
31
			</arguments>
32
		</buildCommand>
33
	</buildSpec>
34
	<natures>
35
		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
36
		<nature>org.eclipse.pde.PluginNature</nature>
37
		<nature>org.eclipse.jdt.core.javanature</nature>
38
		<nature>net.sourceforge.metrics.nature</nature>
39
		<nature>com.stateofflow.eclipse.metrics.MetricsNature</nature>
40
	</natures>
41
</projectDescription>
0 42

  
tmp/org.txm.core/buildTST.properties (revision 116)
1
bin.includes = META-INF/,\
2
               .,\
3
               lib/
4
jars.compile.order = .,\
5
                     bin/
6
source.. = src/groovy/,\
7
           src/java/
8
jars.extra.classpath = lib/ant-1.7.1.jar,\
9
                       lib/antlr-2.7.7.jar,\
10
                       lib/asm-analysis-2.2.3.jar,\
11
                       lib/asm-tree-2.2.3.jar,\
12
                       lib/colt-1.2.0.jar,\
13
                       lib/commons-cli-1.2.jar,\
14
                       lib/commons-io-1.4.jar,\
15
                       lib/commons-lang-2.4.jar,\
16
                       lib/concurrent-1.3.4.jar,\
17
                       lib/hsqldb.jar,\
18
                       lib/jline-0.9.94.jar,\
19
                       lib/junit-4.5.jar,\
20
                       lib/log4j-1.2.12.jar,\
21
                       lib/REngine.jar,\
22
                       lib/RserveEngine.jar,\
23
                       lib/saxon-xom-9.2.jar
24
source.. = src/java/
25
output.. = bin/
0 26

  
tmp/org.txm.core/buildJavadoc.xml (revision 116)
1
<project name="Toolbox" default="doc">
2
	
3
	<path id="lib.dir">
4
		<!-- fileset : TO BE DEFINED MANUALLY -->
5
		<fileset dir="/home/mdecorde/LIBRAIRIES/groovy-2.2.1/embeddable">
6
			<include name="*.jar" />
7
		</fileset>
8
	</path>
9

  
10
	<tstamp>
11
		<format property="TODAY" pattern="yyyy-MM-dd HH:mm" />
12
	</tstamp>
13

  
14
	<taskdef name="groovydoc" classname="org.codehaus.groovy.ant.Groovydoc" classpathref="lib.dir" />
15
	
16
	<target name="doc">
17
		<mkdir dir="javadoc/" />
18
		<!-- packagenames : TO BE UPDATED MANUALLY using TBX exported packages list. BECAUSE org.txm.utils.tostring.ToString make groovydoc raise an exception ... -->
19
		<groovydoc 
20
			destdir="javadoc/" 
21
			sourcepath="src/java:src/groovy" 
22
			packagenames="filters.BuildXmlLiturgie,filters.Concatenator,filters.CutHeader,filters.EliminateWhiteSpaces,filters.FusionHeader,filters.FusionXmlHeaderBody,filters.MinimalFilter,filters.OneOpenTagPerLine,filters.OneTagPerLine,filters.ProcessEnclitics,filters.ProcessQuotes,filters.RegexFilter,filters.ReunitBrokenTags,filters.ReunitBrokenWords,filters.TagSentences,filters.Tokeniser,filters.WordInternalElement,filters.eliminateNAttributes,org.txm,org.txm.annotation,org.txm.doc,org.txm.export,org.txm.export.conll2009,org.txm.export.ts,org.txm.functions,org.txm.functions.ca,org.txm.functions.classification,org.txm.functions.concordances,org.txm.functions.concordances.comparators,org.txm.functions.contrasts,org.txm.functions.cooccurrences,org.txm.functions.cooccurrences.comparators,org.txm.functions.coocmatrix,org.txm.functions.diagnostic,org.txm.functions.internal,org.txm.functions.intertextualdistance,org.txm.functions.mesures,org.txm.functions.parabrowser,org.txm.functions.parallelcontexts,org.txm.functions.preview,org.txm.functions.queryindex,org.txm.functions.referencer,org.txm.functions.progression,org.txm.functions.selection,org.txm.functions.specificities,org.txm.functions.summary,org.txm.functions.index,org.txm.importer,org.txm.importer.RGAQCJ,org.txm.importer.alceste,org.txm.importer.bfm,org.txm.importer.bvh,org.txm.importer.corptef,org.txm.importer.csv,org.txm.importer.cwb,org.txm.importer.discours,org.txm.importer.doc,org.txm.importer.europress,org.txm.importer.factiva,org.txm.importer.filters,org.txm.importer.fleurs,org.txm.importer.frantext,org.txm.importer.graal,org.txm.importer.hyperbase,org.txm.importer.hyperprince,org.txm.importer.lasla,org.txm.importer.limsi,org.txm.importer.perrault,org.txm.importer.quick,org.txm.importer.scripting,org.txm.importer.tigersearch,org.txm.importer.tmx,org.txm.importer.transana,org.txm.importer.transcriber,org.txm.importer.wtc,org.txm.importer.xml,org.txm.importer.xmltxm,org.txm.importer.xmltxmpara,org.txm.metadatas,org.txm.objects,org.txm.renderer,org.txm.scripts,org.txm.scripts.clix,org.txm.scripts.i18n,org.txm.scripts.teitxm,org.txm.scripts.tigersearch,org.txm.searchengine.cqp,org.txm.searchengine.cqp.clientExceptions,org.txm.searchengine.cqp.corpus,org.txm.searchengine.cqp.corpus.query,org.txm.searchengine.cqp.serverException,org.txm.searchengine.ts,org.txm.setup,org.txm.sql,org.txm.stat,org.txm.stat.data,org.txm.stat.engine.r,org.txm.stat.engine.r.data,org.txm.stat.engine.r.function,org.txm.stat.engine.r.rcolt,org.txm.stat.utils,org.txm.svn,org.txm.sw,org.txm.test,org.txm.tests,org.txm.tokenizer,org.txm.toolbox,org.txm.utils,org.txm.utils.i18n,org.txm.utils.logger,org.txm.utils.processbuilder,org.txm.utils.saxon,org.txm.utils.treetagger" 
23
			use="true"  
24
			windowtitle="TXM Groovy and Java documentation ${TODAY}" 
25
			doctitle="TXM Groovy and Java documentation ${TODAY}" 
26
			header="TXM Groovy and Java documentation ${TODAY}" 
27
			footer="TXM Groovy and Java documentation ${TODAY}" 
28
			private="false">
29
			
30
			<link packages="java.,org.xml.,javax.,org.xml." href="http://java.sun.com/j2se/1.5.0/docs/api" />
31
			<link packages="org.apache.ant.,org.apache.tools.ant." href="http://www.dpml.net/api/ant/1.7.0" />
32
			<link packages="org.junit.,junit.framework." href="http://junit.sourceforge.net/junit3.8.1/javadoc/" />
33
			<link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/" />
34
		</groovydoc>
35
	</target>
36
</project>
0 37

  
tmp/org.txm.core/src/R/HelloWorld.R (revision 116)
1
print("Hello World!")
tmp/org.txm.core/src/R/TXTCSV2Alceste.R (revision 116)
1
# Script R écrit par Lise Vaudor (UMR 5600 EVS) en mars 2012
2

  
3
setwd(choose.dir())  # choix du répertoire de travail
4
metadata=read.table("metadata.csv",sep=",",header=T)
5
write.table("texte_tot.txt")
6

  
7
for (i in 1:nrow(metadata)){   # on parcourt un à un les lignes du fichier de métadonnées
8
   namefile=paste(metadata$id[i],".txt",sep="") # on considère le fichier dont le nom est donnée à la ième ligne
9
   descripteur_i=c("****")
10
   for (j in 1:ncol(metadata)){
11
         descripteur_i=paste(descripteur_i," *",colnames(metadata)[j],"_",metadata[i,j],sep="")  # on parcourt l'ensemble des colonnes de metadata pour créer le descripteur
12
   }
13
   cat(descripteur_i, file="texte_tot.txt",append=T)  # on concatène au fichier texte_tot le decripteur...
14
   cat("\n", file="texte_tot.txt",append=T)                # des sauts de ligne...
15
   cat(scan(namefile, what="character"), file="texte_tot.txt",append=T) # le texte qui nous intéresse...
16
   cat("\n", file="texte_tot.txt",append=T)                # re-des sauts de ligne
17
   cat("\n", file="texte_tot.txt",append=T)
18
}
tmp/org.txm.core/src/R/plot100.R (revision 116)
1
x <- rnorm(100)
2
y <- rnorm(100)
3
plot(x, y)
tmp/org.txm.core/src/R/sample.R (revision 116)
1
x <- rnorm(100)
2
show(x)
tmp/org.txm.core/src/java/org/txm/searchengine/package.html (revision 116)
1
<html>
2
<body>
3
<p>All full text indexing, retrieving and querying functions of the toolbox.</p>
4
</body>
5
</html>
0 6

  
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/clientExceptions/package.html (revision 116)
1
<html>
2
<body>
3
<p>Exception during communication between the cqp server and the cqp client.</p>
4
</body>
5
</html>
0 6

  
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/clientExceptions/ServerNotFoundException.java (revision 116)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
25
// $LastChangedRevision: 2386 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.searchengine.cqp.clientExceptions;
29

  
30
import java.io.IOException;
31

  
32
// TODO: Auto-generated Javadoc
33
/**
34
 * Thrown to indicates that client do not find the server.
35
 *
36
 * @author Jean-Philippe Magué
37
 */
38
public class ServerNotFoundException extends CqiClientException {
39

  
40
	/** The Constant serialVersionUID. */
41
	private static final long serialVersionUID = 1L;
42

  
43
	/**
44
	 * Instantiates a new server not found exception.
45
	 * 
46
	 * @param string
47
	 *            the message
48
	 * @param e
49
	 *            the cause
50
	 */
51
	public ServerNotFoundException(String string, IOException e) {
52
		super(string, e);
53
	}
54

  
55
	/**
56
	 * Instantiates a new server not found exception.
57
	 * 
58
	 * @param string
59
	 *            the message
60
	 */
61
	public ServerNotFoundException(String string) {
62
		super(string);
63
	}
64

  
65
	/**
66
	 * Instantiates a new server not found exception.
67
	 * 
68
	 * @param e
69
	 *            the cause
70
	 */
71
	public ServerNotFoundException(Throwable e) {
72
		super(e);
73
	}
74

  
75
}
0 76

  
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/clientExceptions/UnexpectedAnswerException.java (revision 116)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
25
// $LastChangedRevision: 2386 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.searchengine.cqp.clientExceptions;
29

  
30
// TODO: Auto-generated Javadoc
31
/**
32
 * Thrown to indicates that client recieved unexpected data from the server.
33
 *
34
 * @author Jean-Philippe Magué
35
 */
36
public class UnexpectedAnswerException extends CqiClientException {
37

  
38
	/** The Constant serialVersionUID. */
39
	private static final long serialVersionUID = 1L;
40

  
41
	/**
42
	 * Instantiates a new unexpected answer exception.
43
	 */
44
	public UnexpectedAnswerException() {
45
		super();
46
	}
47

  
48
	/**
49
	 * Instantiates a new unexpected answer exception.
50
	 * 
51
	 * @param arg0
52
	 *            the message
53
	 */
54
	public UnexpectedAnswerException(String arg0) {
55
		super(arg0);
56
	}
57

  
58
	/**
59
	 * Instantiates a new unexpected answer exception.
60
	 * 
61
	 * @param arg0
62
	 *            the cause
63
	 */
64
	public UnexpectedAnswerException(Throwable arg0) {
65
		super(arg0);
66
	}
67

  
68
	/**
69
	 * Instantiates a new unexpected answer exception.
70
	 * 
71
	 * @param arg0
72
	 *            the message
73
	 * @param arg1
74
	 *            the cause
75
	 */
76
	public UnexpectedAnswerException(String arg0, Throwable arg1) {
77
		super(arg0, arg1);
78
	}
79

  
80
}
0 81

  
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/clientExceptions/InvalidCqpIdException.java (revision 116)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
25
// $LastChangedRevision: 2386 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.searchengine.cqp.clientExceptions;
29

  
30
// TODO: Auto-generated Javadoc
31
/**
32
 * The Class InvalidCqpIdException.
33
 */
34
public class InvalidCqpIdException extends Exception {
35

  
36
	/** The Constant serialVersionUID. */
37
	private static final long serialVersionUID = 1L;
38

  
39
	/**
40
	 * Instantiates a new invalid cqp id exception.
41
	 */
42
	public InvalidCqpIdException() {
43
		// TODO Auto-generated constructor stub
44
	}
45

  
46
	/**
47
	 * Instantiates a new invalid cqp id exception.
48
	 *
49
	 * @param arg0 the arg0
50
	 */
51
	public InvalidCqpIdException(String arg0) {
52
		super(arg0);
53
		// TODO Auto-generated constructor stub
54
	}
55

  
56
	/**
57
	 * Instantiates a new invalid cqp id exception.
58
	 *
59
	 * @param arg0 the arg0
60
	 */
61
	public InvalidCqpIdException(Throwable arg0) {
62
		super(arg0);
63
		// TODO Auto-generated constructor stub
64
	}
65

  
66
	/**
67
	 * Instantiates a new invalid cqp id exception.
68
	 *
69
	 * @param arg0 the arg0
70
	 * @param arg1 the arg1
71
	 */
72
	public InvalidCqpIdException(String arg0, Throwable arg1) {
73
		super(arg0, arg1);
74
		// TODO Auto-generated constructor stub
75
	}
76

  
77
}
0 78

  
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/clientExceptions/CqiClientException.java (revision 116)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
25
// $LastChangedRevision: 2386 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.searchengine.cqp.clientExceptions;
29

  
30
import org.txm.Toolbox;
31

  
32
// TODO: Auto-generated Javadoc
33
/**
34
 * Base class for the Exception raised by the CQi client itself (i.e. not
35
 * recieved from the CQi server)
36
 * 
37
 * @author Jean-Philippe Magué
38
 */
39
public class CqiClientException extends Exception {
40

  
41
	/** The Constant serialVersionUID. */
42
	private static final long serialVersionUID = 1L;
43

  
44
	/**
45
	 * Instantiates a new cqi client exception.
46
	 * 
47
	 * @param message
48
	 *            the message
49
	 */
50
	public CqiClientException(String message) {
51
		super(message);
52
	}
53

  
54
	static int counter = 0;
55
	/**
56
	 * Instantiates a new cqi client exception.
57
	 * 
58
	 * @param cause
59
	 *            the cause
60
	 */
61
	public CqiClientException(Throwable cause) {
62
		super(cause);
63
		if(cause instanceof java.net.SocketException){
64
			if (counter++ < 5) {
65
				if(!Toolbox.getCqiClient().reconnect())
66
					Toolbox.restartSearchEngine();
67
			}
68
		}
69
	}
70

  
71
	/**
72
	 * Instantiates a new cqi client exception.
73
	 * 
74
	 * @param message
75
	 *            the message
76
	 * @param cause
77
	 *            the cause
78
	 */
79
	public CqiClientException(String message, Throwable cause) {
80
		super(message, cause);
81
		if(cause instanceof java.net.SocketException)
82
		{
83
			if(!Toolbox.getCqiClient().reconnect())
84
				Toolbox.restartSearchEngine();
85
		}
86
	}
87

  
88
	/**
89
	 * Instantiates a new cqi client exception.
90
	 */
91
	public CqiClientException() {
92
		super();
93
	}
94

  
95
}
0 96

  
tmp/org.txm.core/src/java/org/txm/searchengine/cqp/MemCqiServer.java (revision 116)
1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
// 
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
// 
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
// 
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
// 
22
// 
23
// 
24
// $LastChangedDate: 2011-12-14 10:52:18 +0100 (mer., 14 déc. 2011) $
25
// $LastChangedRevision: 2080 $
26
// $LastChangedBy: mdecorde $ 
27
//
28
package org.txm.searchengine.cqp;
29

  
30
import java.io.BufferedReader;
31
import java.io.File;
32
import java.io.IOException;
33
import java.io.InputStream;
34
import java.io.InputStreamReader;
35
import java.io.OutputStream;
36
import java.lang.reflect.Field;
37
import java.util.Arrays;
38

  
39
import org.apache.commons.lang.ArrayUtils;
40
import org.apache.commons.lang.StringUtils;
41
import org.txm.Messages;
42
import org.txm.Toolbox;
43
import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
44
import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
45
import org.txm.searchengine.cqp.serverException.CqiCqpErrorNoSuchCorpus;
46
import org.txm.searchengine.cqp.serverException.CqiServerError;
47
import org.txm.utils.ExecTimer;
48
import org.txm.utils.logger.Log;
49

  
50
// TODO: Auto-generated Javadoc
51
/**
52
 * This class aims at handling a CQi server process. It is not a CQi server per
53
 * se.
54
 * 
55
 * @author Jean-Philippe Magué
56
 */
57
public class MemCqiServer extends AbstractCqiServer {
58

  
59
	/**
60
	 * Instantiates a new CQi server.
61
	 * 
62
	 * @param pathToExecutable
63
	 *            the path to the executable
64
	 * @param pathToRegistry
65
	 *            the path to the registry
66
	 * @param pathToInitFile
67
	 *            the path to the init file
68
	 * 
69
	 * @throws ServerNotFoundException
70
	 *             the server not found exception
71
	 */
72
	public MemCqiServer(String pathToExecutable, String pathToRegistry,
73
			String pathToInitFile) throws ServerNotFoundException {
74
		this(pathToExecutable, pathToRegistry, pathToInitFile, ""); //$NON-NLS-1$
75
	}
76

  
77
	/**
78
	 ** Instantiates a new CQi server.
79
	 * 
80
	 * @param pathToExecutable
81
	 *            the path to the executable
82
	 * @param pathToRegistry
83
	 *            the path to the registry
84
	 * @param pathToInitFile
85
	 *            the path to the init file
86
	 * @param additionalOptions
87
	 *            the additional command line options
88
	 * 
89
	 * @throws ServerNotFoundException
90
	 *             the server not found exception
91
	 */
92
	public MemCqiServer(String pathToExecutable, String pathToRegistry,
93
			String pathToInitFile, String additionalOptions)
94
					throws ServerNotFoundException {
95

  
96
	}
97

  
98
	/** The path to executable. */
99
	String pathToExecutable;
100

  
101
	/** The path to registry. */
102
	String pathToRegistry;
103

  
104
	/** The path to init file. */
105
	String pathToInitFile;
106

  
107
	/** The additional options. */
108
	String additionalOptions;
109

  
110
	/** The monitor output. */
111
	boolean monitorOutput;
112

  
113
	/** The cmd line. */
114
	static String[] cmdLine;
115
	public boolean debug = false;
116

  
117
	public void setDebug(boolean val)
118
	{
119
		debug = val;
120
	}
121

  
122
	public native int getErrorCode();
123

  
124

  
125
	/**
126
	 * Instantiates a new cqi server.
127
	 *
128
	 * @param pathToExecutable the path to executable
129
	 * @param pathToRegistry the path to registry
130
	 * @param pathToInitFile the path to init file
131
	 * @param additionalOptions the additional options
132
	 * @param monitorOutput the monitor output
133
	 * @throws Exception 
134
	 */
135
	public MemCqiServer(String pathToExecutable, String pathToRegistry,
136
			String pathToInitFile, String additionalOptions,
137
			boolean monitorOutput) throws Exception {
138

  
139
		this.pathToExecutable = pathToExecutable;
140
		this.pathToRegistry = pathToRegistry;
141
		this.pathToInitFile = pathToInitFile;
142
		this.additionalOptions = additionalOptions;
143
		this.monitorOutput = monitorOutput;
144

  
145
		if (!isLoaded) {
146
			
147
			Field LIBRARIES = ClassLoader.class.getDeclaredField("loadedLibraryNames");
148
			LIBRARIES.setAccessible(true);
149
			
150
			try {
151
				String path = System.getProperty("java.library.path");
152
				String libpath = System.getProperty("path.separator")+Toolbox.getParam(Toolbox.CQI_SERVER_PATH_TO_CQPLIB);
153
				if (!path.contains(libpath)) {
154
					path += libpath;
155
				}
156
				System.setProperty("java.library.path", path);
157
				//System.out.println("Current java.library.path "+System.getProperty("java.library.path"));
158

  
159
				// this is a hack to force the JVM to reload java.library.path
160
				Field fieldSysPath = ClassLoader.class.getDeclaredField( "sys_paths" );
161
				fieldSysPath.setAccessible( true );
162
				fieldSysPath.set( null, null );
163
				
164
				System.loadLibrary("cqpjni");
165
				Log.info("cqpjni loaded from dirs "+path);
166
				isLoaded = true;
167

  
168
			} catch (Throwable e) {
169
				System.err.println("Failed to load CQP lib with exception: "+e);
170
				System.err.println("Looking for Cqi libs in : "+System.getProperty("java.library.path")); 
171
				System.err.println("Current directory: "+new File(".").getAbsolutePath());
172
				throw new Exception(e);
173
			}
174
		}
175
	}
176

  
177
	/**
178
	 * Gets the last cmd line.
179
	 *
180
	 * @return the last cmd line
181
	 */
182

  
183
	public String getLastCmdLine() {
184
		return StringUtils.join(cmdLine, " "); //$NON-NLS-1$
185
	}
186

  
187
	/**
188
	 * Start.
189
	 *
190
	 * @return true, if successful
191
	 */
192
	public Boolean start() {
193
		String[] cmd = { pathToExecutable, "-I", pathToInitFile, "-r", pathToRegistry }; //$NON-NLS-1$ //$NON-NLS-2$
194
		cmdLine = (String[]) ArrayUtils.addAll(cmd, additionalOptions.trim().split(" ")); //$NON-NLS-1$
195
		Log.info("Starting NullSearchEngineServer: "+Arrays.toString(cmdLine)+" ... ");
196

  
197
		//try {
198
			isLoaded = start(cmdLine);
199
			//System.out.println("IS LOADED: "+isLoaded);
200
			if (isLoaded) {
201
				System.out.println(Messages.CqiClient_34);
202
			} else {
203
				System.out.println("Failed to start SearchEngine in memory mode.");
204
			}
205
			return isLoaded;
206
//		} catch(Exception e) {
207
//			System.out.println("Failed to start MemCqiServer: "+e+ " (error code: "+getErrorCode()+")");
208
//			return false;
209
//		}
210
	}
211

  
212
	/**
213
	 * Convert stream to string.
214
	 *
215
	 * @param is the is
216
	 * @return the string
217
	 */
218

  
219
	public String convertStreamToString(InputStream is) {
220
		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
221
		StringBuilder sb = new StringBuilder();
222
		String line = null;
223
		try {
224
			while ((line = reader.readLine()) != null) {
225
				sb.append(line);
226
			}
227
		} catch (IOException e) {
228
			org.txm.utils.logger.Log.printStackTrace(e);
229
		} finally {
230
			try {
231
				is.close();
232
			} catch (IOException e) {
233
				org.txm.utils.logger.Log.printStackTrace(e);
234
			}
235
		}
236

  
237
		return sb.toString();
238
	}
239

  
240
	/**
241
	 * Checks if the server is running.
242
	 * 
243
	 * @return true, if is running
244
	 */
245

  
246
	public Boolean isRunning() {
247
		return isLoaded;
248
	}
249

  
250
	/*
251
	 * (non-Javadoc)
252
	 * 
253
	 * @see java.lang.Object#finalize()
254
	 */
255
	protected void finalize() throws Throwable {
256

  
257
	}
258

  
259
	/**
260
	 * Gets the error stream.
261
	 *
262
	 * @return the error stream
263
	 */
264

  
265
	public InputStream getErrorStream() {
266
		return null;
267
	}
268

  
269
	/**
270
	 * Gets the input stream.
271
	 *
272
	 * @return the input stream
273
	 */
274

  
275
	public InputStream getInputStream() {
276
		return new InputStream() {
277
			public int read() throws IOException {
278
				return 0;
279
			}
280
		};
281
	}
282

  
283
	/**
284
	 * Gets the output stream.
285
	 *
286
	 * @return the output stream
287
	 */
288

  
289
	public OutputStream getOutputStream() {
290
		return new OutputStream() {
291
			public void write(int arg0) throws IOException {
292
			}
293
		};
294
	}
295

  
296
	static Boolean isLoaded = false;
297

  
298
	public native Boolean start(String[] args);
299

  
300
	public native Boolean stop();
301

  
302
	public native int[] alg2Cpos(String arg0, int arg1) throws UnexpectedAnswerException, IOException, CqiServerError;
303

  
304
	public native Integer attributeSize(String arg0) throws IOException, UnexpectedAnswerException, CqiServerError ;
305

  
306
	public boolean connect(String arg0, String arg1) { return true;} ;
307

  
308
	public native String[] corpusAlignementAttributes(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
309

  
310
	public native String corpusCharset(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
311

  
312
	public native String corpusFullName(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
313

  
314
	public native String[] corpusInfo(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
315

  
316
	public native String[] corpusPositionalAttributes(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
317

  
318
	public native String[] corpusProperties(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
319

  
320
	public native Boolean corpusStructuralAttributeHasValues(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
321

  
322
	public native String[] corpusStructuralAttributes(String arg0) throws UnexpectedAnswerException, IOException, CqiServerError ;
323

  
324
	public native int[] cpos2Alg(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
325

  
326
	public native int[] cpos2Id(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
327

  
328
	public native int[] cpos2LBound(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
329

  
330
	public native int[] cpos2RBound(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
331

  
332
	public native String[] cpos2Str(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
333

  
334
	public native int[] cpos2Struc(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
335

  
336
	public native Boolean cqpQuery(String arg0, String arg1, String arg2)
337
			throws IOException, UnexpectedAnswerException, CqiServerError ;
338

  
339
	public native Boolean query(String arg0)
340
			throws IOException, UnexpectedAnswerException, CqiServerError ;
341

  
342
	public Boolean disconnect() { return true; };
343

  
344
	public native Boolean dropAttribute(String arg0) throws IOException, UnexpectedAnswerException, CqiServerError ;
345

  
346
	public native Boolean dropCorpus(String arg0) throws Exception ;
347

  
348
	public native Boolean dropSubCorpus(String arg0) throws IOException, UnexpectedAnswerException, CqiServerError ;
349

  
350
	public native int[] dumpSubCorpus(String arg0, byte arg1, int arg2, int arg3)
351
			throws IOException, UnexpectedAnswerException, CqiServerError ;
352

  
353
	public int[][] fdist1(String arg0, int arg1, byte arg2, String arg3)
354
			throws IOException, UnexpectedAnswerException, CqiServerError {
355
		int[] all = nfdist1(arg0, arg1, arg2, arg3);
356
		if (all == null) {
357
			return new int[0][0];
358
		}
359
		int[][] freqs = new int[all.length / 2][2];
360
		int c = 0;
361
		for (int i = 0 ; i < freqs.length ;i++) {
362
			freqs[i][0] = all[c++];
363
			freqs[i][1] = all[c++];
364
		}
365
		return freqs;
366

  
367
	}
368

  
369
	public native int[] nfdist1(String arg0, int arg1, byte arg2, String arg3)
370
			throws IOException, UnexpectedAnswerException, CqiServerError;
371

  
372
	public int[][] fdist2(String arg0, int arg1, byte arg2, String arg3,
373
			byte arg4, String arg5) throws IOException,
374
			UnexpectedAnswerException, CqiServerError {
375
		int[] all = nfdist2(arg0, arg1, arg2, arg3, arg4, arg5);
376
		if (all == null) {
377
			return new int[0][0];
378
		}
379
		int[][] freqs = new int[all.length / 2][3];
380
		int c = 0;
381
		for (int i = 0 ; i < freqs.length ; i++) {
382
			freqs[i][0] = all[c++];
383
			freqs[i][1] = all[c++];
384
			freqs[i][2] = all[c++];
385
		}
386
		return freqs;
387
	}
388

  
389
	public native int[] nfdist2(String arg0, int arg1, byte arg2, String arg3,
390
			byte arg4, String arg5) throws IOException, UnexpectedAnswerException, CqiServerError;
391

  
392
	public native String getLastCQPError() ;
393

  
394
	public native String getLastCqiError() throws UnexpectedAnswerException, IOException, CqiServerError;
395

  
396
	public native int[] id2Cpos(String arg0, int arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
397

  
398
	public native int[] id2Freq(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
399

  
400
	public native String[] id2Str(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
401

  
402
	public native int[] idList2Cpos(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
403

  
404
	public native Integer lexiconSize(String arg0) throws IOException, UnexpectedAnswerException, CqiServerError ;
405

  
406
	public native String[] listCorpora() throws UnexpectedAnswerException, IOException, CqiServerError;
407

  
408
	public native String[] listSubcorpora(String arg0) throws UnexpectedAnswerException, IOException, CqiCqpErrorNoSuchCorpus ;
409

  
410
	public Boolean reconnect() { return true; } ;
411

  
412
	public native int[] regex2Id(String arg0, String arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
413

  
414
	public native int[] str2Id(String arg0, String[] arg1) throws IOException, UnexpectedAnswerException, CqiServerError ;
415

  
416
	public native int[] struc2Cpos(String arg0, int arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
417

  
418
	public native String[] struc2Str(String arg0, int[] arg1) throws UnexpectedAnswerException, IOException, CqiServerError ;
419

  
420
	public native Boolean subCorpusHasField(String arg0, byte arg1) throws IOException, UnexpectedAnswerException, CqiServerError ;
421

  
422
	public native Integer subCorpusSize(String arg0) throws IOException, UnexpectedAnswerException, CqiServerError ;
423

  
424
	/**
425
	 * @param args
426
	 * @throws Exception 
427
	 */
428
	public static void main(String[] args) throws Exception {
429
		String pathToExecutable = "/home/mdecorde/workspace37/CWB-lib/src/cqp/";
430
		String cqpserverPathToExecutable = "/home/mdecorde/workspace37/CWB-lib/src/cqp/cqpserver";
431
		String pathToRegistry = "/home/mdecorde/TXM/registry";
432
		String pathToInitFile = "/usr/lib/TXM/cwb/cqpserver.init";
433

  
434
		String corpus = "DISCOURS";
435
		String subcorpusname = "SUB";
436
		String subcorpusid = corpus+":"+subcorpusname;
437
		String query = "[word=\"j.*\"]";
438
		String regex = "j.*";
439
		String pattribute1 = corpus+".word";
440
		String pattribute2 = corpus+".frpos";
441
		String pattribute3 = corpus+".frlemma";
442
		String sattribute1 = corpus+".text_id";
443
		String sattribute2 = corpus+".p_id";
444
		String sattribute3 = corpus+".s_id";
445

  
446
		String align_attr = "p_id";
447

  
448
		int[] cpos = {0,10000,2,3,4,5,6,7,8,9,10};
449
		//	int id = 1;
450
		int[] ids = {0,1,2,3,4,5,6,7,8,9,10};
451
		String[] strings = {"je", "jamais"};
452
		int[] strucpos = {0, 1, 2, 3 , 4};
453

  
454
		Toolbox.setParam(Toolbox.CQI_SERVER_PATH_TO_CQPLIB, pathToExecutable);
455

  
456
		MemCqiServer server = new MemCqiServer(pathToExecutable, pathToRegistry, pathToInitFile, " -b 10000000 -d OFF", false);
457
		if (server.start()) System.out.println("Mem Server ok");
458
		MemCqiClient client = new MemCqiClient(server);
459
		if (client.connect("anonymous", "")) System.out.println("Mem Client ok");
460

  
461
		NetCqiServer netServer = new NetCqiServer(cqpserverPathToExecutable, pathToRegistry, pathToInitFile, "", false);
462
		if (netServer.start()) System.out.println("Net Server ok");
463
		NetCqiClient netClient = new NetCqiClient("127.0.0.1", 4877);
464
		if (netClient.connect("anonymous", "")) System.out.println("Net Client ok");
465

  
466
		ExecTimer.start();
467

  
468
		try {
469
			System.out.println("client.alg2Cpos(sattribute, struct_id) : "+Arrays.toString(client.alg2Cpos(sattribute1, 0)));
470
		} catch(Exception e) { System.out.println("Exception : "+e);}
471
		try {
472
			System.out.println("netClient.alg2Cpos(sattribute, struct_id) : "+Arrays.toString(netClient.alg2Cpos(sattribute1, 0)));
473
		} catch(Exception e) { System.out.println("Exception : "+e);}
474

  
475
		try {
476
			System.out.println("client.attributeSize(sattribute1) : "+client.attributeSize(sattribute1));
477
		} catch(Exception e) { System.out.println("Exception : "+e);}
478
		try {
479
			System.out.println("netClient.attributeSize(sattribute1) : "+netClient.attributeSize(sattribute1));
480
		} catch(Exception e) { System.out.println("Exception : "+e);}
481

  
482

  
483
		try {
484
			System.out.println("client.attributeSize(sattribute2) : "+client.attributeSize(sattribute2));
485
		} catch(Exception e) { System.out.println("Exception : "+e);}
486
		try {
487
			System.out.println("netClient.attributeSize(sattribute2) : "+netClient.attributeSize(sattribute2));
488
		} catch(Exception e) { System.out.println("Exception : "+e);}
489

  
490

  
491
		try {
492
			System.out.println("client.attributeSize(sattribute3) : "+client.attributeSize(sattribute3));
493
		} catch(Exception e) { System.out.println("Exception : "+e);}
494
		try {
495
			System.out.println("netClient.attributeSize(sattribute3) : "+netClient.attributeSize(sattribute3));
496
		} catch(Exception e) { System.out.println("Exception : "+e);}
497

  
498

  
499
		try {
500
			System.out.println("client.corpusAlignementAttributes(corpus) : "+Arrays.toString(client.corpusAlignementAttributes(corpus)));
501
		} catch(Exception e) { System.out.println("Exception : "+e);}
502
		try {
503
			System.out.println("netClient.corpusAlignementAttributes(corpus) : "+Arrays.toString(netClient.corpusAlignementAttributes(corpus)));
504
		} catch(Exception e) { System.out.println("Exception : "+e);}
505

  
506
		try {
507
			System.out.println("client.corpusCharset(corpus) : "+client.corpusCharset(corpus));
508
		} catch(Exception e) { System.out.println("Exception : "+e);}
509
		try {
510
			System.out.println("netClient.corpusCharset(corpus) : "+netClient.corpusCharset(corpus));
511
		} catch(Exception e) { System.out.println("Exception : "+e);}
512

  
513

  
514
		try {
515
			System.out.println("client.corpusFullName(corpus) : "+client.corpusFullName(corpus));
516
		} catch(Exception e) { System.out.println("Exception : "+e);}
517
		try {
518
			System.out.println("netClient.corpusFullName(corpus) : "+netClient.corpusFullName(corpus));
519
		} catch(Exception e) { System.out.println("Exception : "+e);}
520

  
521
		try {
522
			System.out.println("client.corpusInfo(corpus) : "+client.corpusInfo(corpus));
523
		} catch(Exception e) { System.out.println("Exception : "+e);}
524
		try {
525
			System.out.println("netClient.corpusInfo(corpus) : "+netClient.corpusInfo(corpus));
526
		} catch(Exception e) { System.out.println("Exception : "+e);}
527

  
528

  
529
		try {
530
			System.out.println("client.corpusPositionalAttributes(corpus) : "+Arrays.toString(client.corpusPositionalAttributes(corpus)));
531
		} catch(Exception e) { System.out.println("Exception : "+e);}
532
		try {
533
			System.out.println("netClient.corpusPositionalAttributes(corpus) : "+Arrays.toString(netClient.corpusPositionalAttributes(corpus)));
534
		} catch(Exception e) { System.out.println("Exception : "+e);}
535

  
536

  
537
		try {
538
			System.out.println("client.corpusProperties(corpus) : "+Arrays.toString(client.corpusProperties(corpus)));
539
		} catch(Exception e) { System.out.println("Exception : "+e);}
540
		try {
541
			System.out.println("netClient.corpusProperties(corpus) : "+Arrays.toString(netClient.corpusProperties(corpus)));
542
		} catch(Exception e) { System.out.println("Exception : "+e);}
543

  
544

  
545
		try {
546
			System.out.println("client.corpusStructuralAttributeHasValues(sattribute1) : "+client.corpusStructuralAttributeHasValues(sattribute1));
547
		} catch(Exception e) { System.out.println("Exception : "+e);}
548
		try {
549
			System.out.println("netClient.corpusStructuralAttributeHasValues(sattribute1) : "+netClient.corpusStructuralAttributeHasValues(sattribute1));
550
		} catch(Exception e) { System.out.println("Exception : "+e);}
551

  
552
		try {
553
			System.out.println("client.corpusStructuralAttributeHasValues(sattribute2) : "+client.corpusStructuralAttributeHasValues(sattribute2));
554
		} catch(Exception e) { System.out.println("Exception : "+e);}
555
		try {
556
			System.out.println("netClient.corpusStructuralAttributeHasValues(sattribute2) : "+netClient.corpusStructuralAttributeHasValues(sattribute2));
557
		} catch(Exception e) { System.out.println("Exception : "+e);}
558

  
559
		try {
560
			System.out.println("client.corpusStructuralAttributeHasValues(sattribute3) : "+client.corpusStructuralAttributeHasValues(sattribute3));
561
		} catch(Exception e) { System.out.println("Exception : "+e);}
562
		try {
563
			System.out.println("netClient.corpusStructuralAttributeHasValues(sattribute3) : "+netClient.corpusStructuralAttributeHasValues(sattribute3));
564
		} catch(Exception e) { System.out.println("Exception : "+e);}
565

  
566
		try {
567
			System.out.println("client.corpusStructuralAttributes(corpus) : "+Arrays.toString(client.corpusStructuralAttributes(corpus)));
568
		} catch(Exception e) { System.out.println("Exception : "+e);}
569
		try {
570
			System.out.println("netClient.corpusStructuralAttributes(corpus) : "+Arrays.toString(netClient.corpusStructuralAttributes(corpus)));
571
		} catch(Exception e) { System.out.println("Exception : "+e);}
572

  
573
		try {
574
			System.out.println("client.cpos2Alg(align_attr, cpos) : "+Arrays.toString(client.cpos2Alg(align_attr, cpos)));
575
		} catch(Exception e) { System.out.println("Exception : "+e);}
576
		try {
577
			System.out.println("netClient.cpos2Alg(align_attr, cpos) : "+Arrays.toString(netClient.cpos2Alg(align_attr, cpos)));
578
		} catch(Exception e) { System.out.println("Exception : "+e);}
579

  
580
		try {
581
			System.out.println("client.cpos2Id(pattribute1, cpos) : "+Arrays.toString(client.cpos2Id(pattribute1, cpos)));
582
		} catch(Exception e) { System.out.println("Exception : "+e);}
583
		try {
584
			System.out.println("netClient.cpos2Id(pattribute1, cpos) : "+Arrays.toString(netClient.cpos2Id(pattribute1, cpos)));
585
		} catch(Exception e) { System.out.println("Exception : "+e);}
586

  
587
		try {
588
			System.out.println("client.cpos2Id(pattribute2, cpos) : "+Arrays.toString(client.cpos2Id(pattribute2, cpos)));
589
		} catch(Exception e) { System.out.println("Exception : "+e);}
590
		try {
591
			System.out.println("netClient.cpos2Id(pattribute2, cpos) : "+Arrays.toString(netClient.cpos2Id(pattribute2, cpos)));
592
		} catch(Exception e) { System.out.println("Exception : "+e);}
593

  
594
		try {
595
			System.out.println("client.cpos2Id(pattribute3, cpos) : "+Arrays.toString(client.cpos2Id(pattribute3, cpos)));
596
		} catch(Exception e) { System.out.println("Exception : "+e);}
597
		try {
598
			System.out.println("netClient.cpos2Id(pattribute3, cpos) : "+Arrays.toString(netClient.cpos2Id(pattribute3, cpos)));
599
		} catch(Exception e) { System.out.println("Exception : "+e);}
600

  
601
		try {
602
			System.out.println("client.cpos2LBound(sattribute1, cpos) : "+Arrays.toString(client.cpos2LBound(sattribute1, cpos)));
603
		} catch(Exception e) { System.out.println("Exception : "+e);}
604
		try {
605
			System.out.println("netClient.cpos2LBound(sattribute1, cpos) : "+Arrays.toString(netClient.cpos2LBound(sattribute1, cpos)));
606
		} catch(Exception e) { System.out.println("Exception : "+e);}
607

  
608
		try {
609
			System.out.println("client.cpos2LBound(sattribute2, cpos) : "+Arrays.toString(client.cpos2LBound(sattribute2, cpos)));
610
		} catch(Exception e) { System.out.println("Exception : "+e);}
611
		try {
612
			System.out.println("netClient.cpos2LBound(sattribute2, cpos) : "+Arrays.toString(netClient.cpos2LBound(sattribute2, cpos)));
613
		} catch(Exception e) { System.out.println("Exception : "+e);}
614

  
615
		try {
616
			System.out.println("client.cpos2LBound(sattribute3, cpos) : "+Arrays.toString(client.cpos2LBound(sattribute3, cpos)));
617
		} catch(Exception e) { System.out.println("Exception : "+e);}
618
		try {
619
			System.out.println("netClient.cpos2LBound(sattribute3, cpos) : "+Arrays.toString(netClient.cpos2LBound(sattribute3, cpos)));
620
		} catch(Exception e) { System.out.println("Exception : "+e);}
621

  
622
		try {
623
			System.out.println("client.cpos2RBound(sattribute1, cpos) : "+Arrays.toString(client.cpos2RBound(sattribute1, cpos)));
624
		} catch(Exception e) { System.out.println("Exception : "+e);}
625
		try {
626
			System.out.println("netClient.cpos2RBound(sattribute1, cpos) : "+Arrays.toString(netClient.cpos2RBound(sattribute1, cpos)));
627
		} catch(Exception e) { System.out.println("Exception : "+e);}
628

  
629
		try {
630
			System.out.println("client.cpos2RBound(sattribute2, cpos) : "+Arrays.toString(client.cpos2RBound(sattribute2, cpos)));
631
		} catch(Exception e) { System.out.println("Exception : "+e);}
632
		try {
633
			System.out.println("netClient.cpos2RBound(sattribute2, cpos) : "+Arrays.toString(netClient.cpos2RBound(sattribute2, cpos)));
634
		} catch(Exception e) { System.out.println("Exception : "+e);}
635

  
636
		try {
637
			System.out.println("client.cpos2RBound(sattribute3, cpos) : "+Arrays.toString(client.cpos2RBound(sattribute3, cpos)));
638
		} catch(Exception e) { System.out.println("Exception : "+e);}
639
		try {
640
			System.out.println("netClient.cpos2RBound(sattribute3, cpos) : "+Arrays.toString(netClient.cpos2RBound(sattribute3, cpos)));
641
		} catch(Exception e) { System.out.println("Exception : "+e);}
642

  
643
		try {
644
			System.out.println("client.cpos2Str(pattribute1, cpos) : "+Arrays.toString(client.cpos2Str(pattribute1, cpos)));
645
		} catch(Exception e) { System.out.println("Exception : "+e);}
646
		try {
647
			System.out.println("netClient.cpos2Str(pattribute1, cpos) : "+Arrays.toString(netClient.cpos2Str(pattribute1, cpos)));
648
		} catch(Exception e) { System.out.println("Exception : "+e);}
649

  
650
		try {
651
			System.out.println("client.cpos2Str(pattribute2, cpos) : "+Arrays.toString(client.cpos2Str(pattribute2, cpos)));
652
		} catch(Exception e) { System.out.println("Exception : "+e);}
653
		try {
654
			System.out.println("netClient.cpos2Str(pattribute2, cpos) : "+Arrays.toString(netClient.cpos2Str(pattribute2, cpos)));
655
		} catch(Exception e) { System.out.println("Exception : "+e);}
656

  
657
		try {
658
			System.out.println("client.cpos2Str(pattribute3, cpos) : "+Arrays.toString(client.cpos2Str(pattribute3, cpos)));
659
		} catch(Exception e) { System.out.println("Exception : "+e);}
660
		try {
661
			System.out.println("netClient.cpos2Str(pattribute3, cpos) : "+Arrays.toString(netClient.cpos2Str(pattribute3, cpos)));
662
		} catch(Exception e) { System.out.println("Exception : "+e);}
663

  
664
		try {
665
			System.out.println("client.cpos2Struc(sattribute1, cpos) : "+Arrays.toString(client.cpos2Struc(sattribute1, cpos)));
666
		} catch(Exception e) { System.out.println("Exception : "+e);}
667
		try {
668
			System.out.println("netClient.cpos2Struc(sattribute1, cpos) : "+Arrays.toString(netClient.cpos2Struc(sattribute1, cpos)));
669
		} catch(Exception e) { System.out.println("Exception : "+e);}
670

  
671
		try {
672
			System.out.println("client.cpos2Struc(sattribute2, cpos) : "+Arrays.toString(client.cpos2Struc(sattribute2, cpos)));
673
		} catch(Exception e) { System.out.println("Exception : "+e);}
674
		try {
675
			System.out.println("netClient.cpos2Struc(sattribute2, cpos) : "+Arrays.toString(netClient.cpos2Struc(sattribute2, cpos)));
676
		} catch(Exception e) { System.out.println("Exception : "+e);}
677

  
678
		try {
679
			System.out.println("client.cpos2Struc(sattribute3, cpos) : "+Arrays.toString(client.cpos2Struc(sattribute3, cpos)));
680
		} catch(Exception e) { System.out.println("Exception : "+e);}
681
		try {
682
			System.out.println("netClient.cpos2Struc(sattribute3, cpos) : "+Arrays.toString(netClient.cpos2Struc(sattribute3, cpos)));
683
		} catch(Exception e) { System.out.println("Exception : "+e);}
684

  
685
		try {
686
			System.out.println("client.cqpQuery(corpus, subcorpus, query)");client.cqpQuery(corpus, subcorpusname, query);
687
		} catch(Exception e) { System.out.println("Exception : "+e);}
688
		try {
689
			System.out.println("netClient.cqpQuery(corpus, subcorpus, query)");netClient.cqpQuery(corpus, subcorpusname, query);
690
		} catch(Exception e) { System.out.println("Exception : "+e);}
691

  
692
		try {
693
			System.out.println("client.dropAttribute(pattribute1)");client.dropAttribute(pattribute1);
694
		} catch(Exception e) { System.out.println("Exception : "+e);}
695
		try {
696
			System.out.println("netClient.dropAttribute(pattribute1)");netClient.dropAttribute(pattribute1);
697
		} catch(Exception e) { System.out.println("Exception : "+e);}
698

  
699
		try {
700
			System.out.println("client.dropAttribute(pattribute2)");client.dropAttribute(pattribute2);
701
		} catch(Exception e) { System.out.println("Exception : "+e);}
702
		try {
703
			System.out.println("netClient.dropAttribute(pattribute2)");netClient.dropAttribute(pattribute2);
704
		} catch(Exception e) { System.out.println("Exception : "+e);}
705

  
706
		try {
707
			System.out.println("client.dropAttribute(pattribute3)");client.dropAttribute(pattribute3);
708
		} catch(Exception e) { System.out.println("Exception : "+e);}
709
		try {
710
			System.out.println("netClient.dropAttribute(pattribute3)");netClient.dropAttribute(pattribute3);
711
		} catch(Exception e) { System.out.println("Exception : "+e);}
712

  
713
		try {
714
			System.out.println("client.dropCorpus(corpus)");client.dropCorpus(corpus);
715
		} catch(Exception e) { System.out.println("Exception : "+e);}
716
		try {
717
			System.out.println("netClient.dropCorpus(corpus)");netClient.dropCorpus(corpus);
718
		} catch(Exception e) { System.out.println("Exception : "+e);}
719

  
720
		try {
721
			System.out.println("client.dumpSubCorpus(subcorpus, CQI_CONST_FIELD_MATCH, 1, 2) : "+Arrays.toString(client.dumpSubCorpus(subcorpusid, NetCqiClient.CQI_CONST_FIELD_MATCH, 1, 10)));
722
		} catch(Exception e) { System.out.println("Exception : "+e);}
723
		try {
724
			System.out.println("netClient.dumpSubCorpus(subcorpus, CQI_CONST_FIELD_MATCH, 1, 2) : "+Arrays.toString(netClient.dumpSubCorpus(subcorpusid, NetCqiClient.CQI_CONST_FIELD_MATCH, 1, 10)));
725
		} catch(Exception e) { System.out.println("Exception : "+e);}
726

  
727
		try {
728
			System.out.println("client.dumpSubCorpus(subcorpus, CQI_CONST_FIELD_MATCHEND, 1, 2) : "+Arrays.toString(client.dumpSubCorpus(subcorpusid, NetCqiClient.CQI_CONST_FIELD_MATCHEND, 1, 10)));
729
		} catch(Exception e) { System.out.println("Exception : "+e);}
730
		try {
731
			System.out.println("netClient.dumpSubCorpus(subcorpus, CQI_CONST_FIELD_MATCHEND, 1, 2) : "+Arrays.toString(netClient.dumpSubCorpus(subcorpusid, NetCqiClient.CQI_CONST_FIELD_MATCHEND, 1, 10)));
732
		} catch(Exception e) { System.out.println("Exception : "+e);}
733

  
734
		//		try {
735
		//			System.out.println("client.fdist1(arg0, arg1, arg2, arg3) : "+client.fdist1(arg0, arg1, arg2, arg3));
736
		//		} catch(Exception e) { System.out.println("Exception : "+e);}
737
		//		try {
738
		//			System.out.println("netClient.fdist1(arg0, arg1, arg2, arg3) : "+netClient.fdist1(arg0, arg1, arg2, arg3));
739
		//		} catch(Exception e) { System.out.println("Exception : "+e);}
740

  
741
		//		try {
742
		//			System.out.println("//client.fdist2(arg0, arg1, arg2, arg3, arg4, arg5) : "+client.fdist2(arg0, arg1, arg2, arg3, arg4, arg5));
743
		//		} catch(Exception e) { System.out.println("Exception : "+e);}
744
		//		try {
745
		//			System.out.println("//netClient.fdist2(arg0, arg1, arg2, arg3, arg4, arg5) : "+netClient.fdist2(arg0, arg1, arg2, arg3, arg4, arg5));
746
		//		} catch(Exception e) { System.out.println("Exception : "+e);}
747

  
748
		try {
749
			System.out.println("client.getLastCqiError() : "+client.getLastCqiError());
750
		} catch(Exception e) { System.out.println("Exception : "+e);}
751
		try {
752
			System.out.println("netClient.getLastCqiError() : "+netClient.getLastCqiError());
753
		} catch(Exception e) { System.out.println("Exception : "+e);}
754

  
755
		try {
756
			System.out.println("client.getLastCQPError() : "+client.getLastCQPError());
757
		} catch(Exception e) { System.out.println("Exception : "+e);}
758
		try {
759
			System.out.println("netClient.getLastCQPError() : "+netClient.getLastCQPError());
760
		} catch(Exception e) { System.out.println("Exception : "+e);}
761

  
762
		try {
763
			System.out.println("client.id2Cpos(pattribute1, 0) : "+Arrays.toString(client.id2Cpos(pattribute1, 0)));
764
		} catch(Exception e) { System.out.println("Exception : "+e);}
765
		try {
766
			System.out.println("netClient.id2Cpos(pattribute1, 0) : "+Arrays.toString(netClient.id2Cpos(pattribute1, 0)));
767
		} catch(Exception e) { System.out.println("Exception : "+e);}
768

  
769
		try {
770
			System.out.println("client.id2Cpos(pattribute2, 0) : "+Arrays.toString(client.id2Cpos(pattribute2, 0)));
771
		} catch(Exception e) { System.out.println("Exception : "+e);}
772
		try {
773
			System.out.println("netClient.id2Cpos(pattribute2, 0) : "+Arrays.toString(netClient.id2Cpos(pattribute2, 0)));
774
		} catch(Exception e) { System.out.println("Exception : "+e);}
775

  
776
		try {
777
			System.out.println("client.id2Cpos(pattribute3, 0) : "+Arrays.toString(client.id2Cpos(pattribute3, 0)));
778
		} catch(Exception e) { System.out.println("Exception : "+e);}
779
		try {
780
			System.out.println("netClient.id2Cpos(pattribute3, 0) : "+Arrays.toString(netClient.id2Cpos(pattribute3, 0)));
781
		} catch(Exception e) { System.out.println("Exception : "+e);}
782

  
783
		try {
784
			System.out.println("client.id2Cpos(pattribute1, 1) : "+Arrays.toString(client.id2Cpos(pattribute1, 1)));
785
		} catch(Exception e) { System.out.println("Exception : "+e);}
786
		try {
787
			System.out.println("netClient.id2Cpos(pattribute1, 1) : "+Arrays.toString(netClient.id2Cpos(pattribute1, 1)));
788
		} catch(Exception e) { System.out.println("Exception : "+e);}
789

  
790
		try {
791
			System.out.println("client.id2Cpos(pattribute2, 1) : "+Arrays.toString(client.id2Cpos(pattribute2, 1)));
792
		} catch(Exception e) { System.out.println("Exception : "+e);}
793
		try {
794
			System.out.println("netClient.id2Cpos(pattribute2, 1) : "+Arrays.toString(netClient.id2Cpos(pattribute2, 1)));
795
		} catch(Exception e) { System.out.println("Exception : "+e);}
796

  
797
		try {
798
			System.out.println("client.id2Cpos(pattribute3, 1) : "+Arrays.toString(client.id2Cpos(pattribute3, 1)));
799
		} catch(Exception e) { System.out.println("Exception : "+e);}
800
		try {
801
			System.out.println("netClient.id2Cpos(pattribute3, 1) : "+Arrays.toString(netClient.id2Cpos(pattribute3, 1)));
802
		} catch(Exception e) { System.out.println("Exception : "+e);}
803

  
804
		try {
805
			System.out.println("client.id2Cpos(pattribute1, 2) : "+Arrays.toString(client.id2Cpos(pattribute1, 2)));
806
		} catch(Exception e) { System.out.println("Exception : "+e);}
807
		try {
808
			System.out.println("netClient.id2Cpos(pattribute1, 2) : "+Arrays.toString(netClient.id2Cpos(pattribute1, 2)));
809
		} catch(Exception e) { System.out.println("Exception : "+e);}
810

  
811
		try {
812
			System.out.println("client.id2Cpos(pattribute2, 2) : "+Arrays.toString(client.id2Cpos(pattribute2, 2)));
813
		} catch(Exception e) { System.out.println("Exception : "+e);}
814
		try {
815
			System.out.println("netClient.id2Cpos(pattribute2, 2) : "+Arrays.toString(netClient.id2Cpos(pattribute2, 2)));
816
		} catch(Exception e) { System.out.println("Exception : "+e);}
817

  
818
		try {
819
			System.out.println("client.id2Cpos(pattribute3, 2) : "+Arrays.toString(client.id2Cpos(pattribute3, 2)));
820
		} catch(Exception e) { System.out.println("Exception : "+e);}
821
		try {
822
			System.out.println("netClient.id2Cpos(pattribute3, 2) : "+Arrays.toString(netClient.id2Cpos(pattribute3, 2)));
823
		} catch(Exception e) { System.out.println("Exception : "+e);}
824

  
825
		try {
826
			System.out.println("client.id2Freq(pattribute1, ids) : "+Arrays.toString(client.id2Freq(pattribute1, ids)));
827
		} catch(Exception e) { System.out.println("Exception : "+e);}
828
		try {
829
			System.out.println("netClient.id2Freq(pattribute1, ids) : "+Arrays.toString(netClient.id2Freq(pattribute1, ids)));
830
		} catch(Exception e) { System.out.println("Exception : "+e);}
831

  
832
		try {
833
			System.out.println("client.id2Freq(pattribute2, ids) : "+Arrays.toString(client.id2Freq(pattribute2, ids)));
834
		} catch(Exception e) { System.out.println("Exception : "+e);}
835
		try {
836
			System.out.println("netClient.id2Freq(pattribute2, ids) : "+Arrays.toString(netClient.id2Freq(pattribute2, ids)));
837
		} catch(Exception e) { System.out.println("Exception : "+e);}
838

  
839
		try {
840
			System.out.println("client.id2Freq(pattribute3, ids) : "+Arrays.toString(client.id2Freq(pattribute3, ids)));
841
		} catch(Exception e) { System.out.println("Exception : "+e);}
842
		try {
843
			System.out.println("netClient.id2Freq(pattribute3, ids) : "+Arrays.toString(netClient.id2Freq(pattribute3, ids)));
844
		} catch(Exception e) { System.out.println("Exception : "+e);}
845

  
846
		try {
847
			System.out.println("client.id2Str(pattribute1, ids) : "+Arrays.toString(client.id2Str(pattribute1, ids)));
848
		} catch(Exception e) { System.out.println("Exception : "+e);}
849
		try {
850
			System.out.println("netClient.id2Str(pattribute1, ids) : "+Arrays.toString(netClient.id2Str(pattribute1, ids)));
851
		} catch(Exception e) { System.out.println("Exception : "+e);}
852

  
853
		try {
854
			System.out.println("client.id2Str(pattribute2, ids) : "+Arrays.toString(client.id2Str(pattribute2, ids)));
855
		} catch(Exception e) { System.out.println("Exception : "+e);}
856
		try {
857
			System.out.println("netClient.id2Str(pattribute2, ids) : "+Arrays.toString(netClient.id2Str(pattribute2, ids)));
858
		} catch(Exception e) { System.out.println("Exception : "+e);}
859

  
860
		try {
861
			System.out.println("client.id2Str(pattribute3, ids) : "+Arrays.toString(client.id2Str(pattribute3, ids)));
862
		} catch(Exception e) { System.out.println("Exception : "+e);}
863
		try {
864
			System.out.println("netClient.id2Str(pattribute3, ids) : "+Arrays.toString(netClient.id2Str(pattribute3, ids)));
865
		} catch(Exception e) { System.out.println("Exception : "+e);}
866

  
867
		try {
868
			System.out.println("client.idList2Cpos(pattribute1, ids) : "+Arrays.toString(client.idList2Cpos(pattribute1, ids)));
869
		} catch(Exception e) { System.out.println("Exception : "+e);}
870
		try {
871
			System.out.println("netClient.idList2Cpos(pattribute1, ids) : "+Arrays.toString(netClient.idList2Cpos(pattribute1, ids)));
872
		} catch(Exception e) { System.out.println("Exception : "+e);}
873

  
874
		try {
875
			System.out.println("client.idList2Cpos(pattribute2, ids) : "+Arrays.toString(client.idList2Cpos(pattribute2, ids)));
876
		} catch(Exception e) { System.out.println("Exception : "+e);}
877
		try {
878
			System.out.println("netClient.idList2Cpos(pattribute2, ids) : "+Arrays.toString(netClient.idList2Cpos(pattribute2, ids)));
879
		} catch(Exception e) { System.out.println("Exception : "+e);}
880

  
881
		try {
882
			System.out.println("client.idList2Cpos(pattribute3, ids) : "+Arrays.toString(client.idList2Cpos(pattribute3, ids)));
883
		} catch(Exception e) { System.out.println("Exception : "+e);}
884
		try {
885
			System.out.println("netClient.idList2Cpos(pattribute3, ids) : "+Arrays.toString(netClient.idList2Cpos(pattribute3, ids)));
886
		} catch(Exception e) { System.out.println("Exception : "+e);}
887

  
888
		try {
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff