IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

API standards et tierces Java Discussion :

Intégrer TreeTagger dans Java


Sujet :

API standards et tierces Java

  1. #21
    Membre confirmé
    Inscrit en
    Janvier 2010
    Messages
    113
    Détails du profil
    Informations forums :
    Inscription : Janvier 2010
    Messages : 113
    Par défaut
    salut,
    j'ai indiqué le chemin du fichier english.par comme ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    tt.setModel("/home/user/Bureau/english.par");
    j'ai essayé la meme chose avec english-chunker.par.

    mais ça n'a pas marcher, voici le code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    40
    41
    42
    43
    44
    45
    46
    47
    import java.io.IOException;
    import java.util.Vector;
     
    import org.annolab.tt4j.TokenHandler;
    import org.annolab.tt4j.TreeTaggerException;
    import org.annolab.tt4j.TreeTaggerWrapper;
     
     
    public class tagger {
    	Vector<String> v;
     
    	public tagger() {		
    		// TODO Auto-generated constructor stub
    		TreeTaggerWrapper tt = new TreeTaggerWrapper<String>();
    		v=new Vector<String>();
    		v.add("This");
    		 try {
    		     tt.setModel("/home/user/Bureau/english.par");
    		     tt.setHandler(new TokenHandler<String>() {
    		         public void token(String token, String pos, String lemma) {
    		             System.out.println(token+"\t"+pos+"\t"+lemma);
    		         }
    		     });
    				tt.process(v);
    			} catch (IOException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			} 
    			catch (TreeTaggerException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
    		 finally {
    		     tt.destroy();
    		 }
    	}
     
    	/**
             * @param args
             */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		new tagger();
     
    	}
     
    }
    les exceptions sont :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    java.io.IOException: Unable to locate tree-tagger binary
    	at org.annolab.tt4j.DefaultExecutableResolver.getExecutable(DefaultExecutableResolver.java:69)
    	at org.annolab.tt4j.TreeTaggerWrapper.getTaggerProcess(TreeTaggerWrapper.java:508)
    	at org.annolab.tt4j.TreeTaggerWrapper.process(TreeTaggerWrapper.java:384)
    	at tagger.<init>(tagger.java:24)
    	at tagger.main(tagger.java:43)
    j'ai ajouté le chemin des binaire au path, comme suis:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    export CLASSPATH=/home/user/Bureau/tree-tagger-linux-3.2/bin
    mais le souci persiste.Comment je dois proceder pour corriger le probleme?

    Merci

  2. #22
    Invité de passage
    Inscrit en
    Février 2010
    Messages
    1
    Détails du profil
    Informations forums :
    Inscription : Février 2010
    Messages : 1
    Par défaut fatouch
    Bonjour,
    j'ai essayé d'inclure treetagger dans une application java sous eclipse
    mais j'ai toujours le même problème :

    "java.io.IOException: Unable to locate tree-tagger binary"

    Je ne sais pas quoi faire.
    Est ce qu'il y a quelqu'un qui peut m'aider?
    Merci.

  3. #23
    Candidat au Club
    Inscrit en
    Avril 2010
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 2
    Par défaut comment integrer treetagger dans une application java
    Bonjour,
    j'ai remarqué que vous vous connaissez en java
    SVP j'ai besoin d'integrer "treetagger" dans eclipse,et je ne sais pas comment faire
    SVP aidez moi,j'en ai besoin pour mon application

  4. #24
    Membre averti
    Homme Profil pro
    Développeur Java
    Inscrit en
    Juin 2010
    Messages
    26
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Juin 2010
    Messages : 26
    Par défaut
    Exactement la même erreur que toi "sitws".
    pour l'instant je n'ai pas trouvé de solution, si j'en ai une je la posterai.

  5. #25
    Membre averti
    Homme Profil pro
    Développeur Java
    Inscrit en
    Juin 2010
    Messages
    26
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Juin 2010
    Messages : 26
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     
     
    private final String _pathTreeTagger = "ressources/treetagger/bin/tree-tagger"; 
     
    .....
    tt.setModel("ressources/treetagger/english.par");
    tt.setExecutableProvider(new ExecutableResolver()     {				
    	@Override
    	public void setPlatformDetector(PlatformDetector arg0) {}
     
    	@Override
    	public String getExecutable() throws IOException 
    	{
    		return _pathTreeTagger;
    	}
    	@Override
    	public void destroy() {}				
    });
    .....
    Il suffit d'implémenter la méthode getExecutable() de la classe : ExecutableResolver() pour qu'elle renvoie le chemin de l'executable de treetagger.

    Citation Envoyé par From Annolab documentation
    For additional flexibility, register a custom ExecutableResolver using setExecutableProvider(ExecutableResolver) or a custom ModelResolver using setModelProvider(ModelResolver). Custom providers may extract models and executable from archives or download them from some location and temporarily or permanently install them in the file system. A custom model resolver may also be used to resolve a language code (e.g. en) to a particular model.

  6. #26
    Invité de passage
    Femme Profil pro
    Inscrit en
    Avril 2011
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Avril 2011
    Messages : 1
    Par défaut .rar
    Bonjour tout le monde,

    excusez mais d'ou vous avez importer :
    import org.annolab.tt4j.TokenHandler;
    import org.annolab.tt4j.TreeTaggerException;
    import org.annolab.tt4j.TreeTaggerWrapper;

    ?

  7. #27
    Membre averti
    Profil pro
    Inscrit en
    Février 2009
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 33
    Par défaut
    Bonjour mes amis(es)

    SVP j'ai besoin d'integrer "treetagger" dans Netbeans sous windows,et je ne sais pas comment faire
    SVP aidez moi,j'en ai besoin pour mon application

    Merci d'avance

  8. #28
    Membre confirmé Avatar de nounouuuuu201186
    Femme Profil pro
    Stagiaire
    Inscrit en
    Juillet 2011
    Messages
    169
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Stagiaire
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juillet 2011
    Messages : 169
    Par défaut TreeTagger
    J'ai le même problème avec la reconnaissance de la classe TreeTagger pourtant j'ai importer le jar sous eclipse.Y a t-il quelqu'un qui peut m'aider?

Discussions similaires

  1. Intégrer python dans java
    Par trin86 dans le forum Interfaçage autre langage
    Réponses: 4
    Dernier message: 25/02/2009, 09h17
  2. Intégrer Flash dans java ?
    Par nonah dans le forum AWT/Swing
    Réponses: 1
    Dernier message: 13/06/2008, 13h33
  3. intégrer du code java dans windev
    Par akremb22 dans le forum WinDev
    Réponses: 1
    Dernier message: 15/04/2008, 17h28
  4. [Java][5.5.1] Intégrer birt dans netbeans
    Par aliomrani1 dans le forum BIRT
    Réponses: 2
    Dernier message: 13/06/2007, 09h43
  5. [débutante]Intégrer flash dans une application java
    Par bouba83 dans le forum Interfaces Graphiques en Java
    Réponses: 6
    Dernier message: 11/05/2006, 11h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo