Revision 479 tmp/org.txm.groovy.core/src/groovy/org/txm/export/ConcordancesExport.groovy

ConcordancesExport.groovy (revision 479)
26 26
//
27 27
//
28 28
//
29
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
30
// $LastChangedRevision: 2386 $
29
// $LastChangedDate: 2017-04-19 16:23:38 +0200 (mer. 19 avril 2017) $
30
// $LastChangedRevision: 3430 $
31 31
// $LastChangedBy: mdecorde $
32 32
//
33 33
package org.txm.export
34 34

  
35 35
// import the packages containing the functions we are going to use
36 36
import org.txm.Toolbox
37
import org.txm.concordance.core.functions.*
38
import org.txm.concordance.core.functions.comparators.*
39
import org.txm.searchengine.cqp.ReferencePattern
40 37
import org.txm.searchengine.cqp.corpus.*
41 38
import org.txm.searchengine.cqp.corpus.query.*
39
import org.txm.concordance.core.functions.Concordance
40
import org.txm.concordance.core.functions.Line
41
import org.txm.concordance.core.functions.comparators.LexicographicKeywordComparator
42
import org.txm.functions.concordances.*
43
import org.txm.functions.concordances.comparators.*
44
import org.txm.searchengine.cqp.ReferencePattern
42 45

  
43 46
// TODO: Auto-generated Javadoc
44 47
/* (non-Javadoc)
......
52 55
}
53 56

  
54 57
// get the BFM corpus
55
def discours = CorpusManager.getCorpusManager().getCorpus("GRAAL")
58
def discours = CorpusManager.getCorpusManager().getCorpus("VOEUX")
56 59

  
57 60
// get some properties
58
def pos = discours.getProperty("fropos")
61
def pos = discours.getProperty("frpos")
59 62
println "pos: "+pos
60
def pb = discours.getProperty("pb")
61
println "pb: "+pb
62 63
def id = discours.getProperty("id")
63 64
println "id: "+id
64 65
def word = discours.getProperty("word")
......
80 81
// define the references pattern for each concordance line
81 82
def referencePattern = new ReferencePattern()
82 83
referencePattern.addProperty(text_id)
83
referencePattern.addProperty(pb)
84 84
referencePattern.addProperty(pos)
85 85
referencePattern.addProperty(id)
86 86

  
87 87
def sortReferencePattern = new ReferencePattern()
88 88
sortReferencePattern.addProperty(text_id)
89
sortReferencePattern.addProperty(pb)
90 89
sortReferencePattern.addProperty(pos)
91 90
sortReferencePattern.addProperty(id)
92 91

  
......
132 131
		 */
133 132
		
134 133
		String ntext = l.getViewRef().getValue(text_id)
135
		String page = l.getViewRef().getValue(pb)
136 134
		String lcontext = l.leftContextToString()
137 135
		String pivot = l.keywordToString()
138 136
		String rien = ""
......
146 144
		}
147 145
		
148 146
		//println l.getKeywordsViewProperties().get(pos)
149
		writer.write(ntext+"_"+page+"\t"+lcontext+"\t"+pivot+"\t"+poss+"\t"+rien+"\t"+rcontext+"\t"+ids+"\n")
147
		writer.write(ntext+"\t"+lcontext+"\t"+pivot+"\t"+poss+"\t"+rien+"\t"+rcontext+"\t"+ids+"\n")
150 148
	}
151 149
	writer.flush()
152 150
}

Also available in: Unified diff