Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / filters / OneOpenTagPerLine / OneOpenTagPerLine.groovy @ 1000

History | View | Annotate | Download (2.1 kB)

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:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$ 
27
//
28
package org.txm.scripts.filters.OneOpenTagPerLine;
29

    
30
//Pre-processing extra-word tags (1)
31
import org.txm.importer.scripts.filters.Filter;
32
import org.txm.tokenizer.TokenizerClasses;
33

    
34
// TODO: Auto-generated Javadoc
35
/**
36
 * The Class OneOpenTagPerLine.
37
 */
38
class OneOpenTagPerLine extends Filter {
39
        
40
        /** The tag_all. */
41
        String tag_all = TokenizerClasses.tag_all;
42
        
43
        /** The counterreg1. */
44
        int counterreg1 = 0;
45
        
46
        /** The counterreg2. */
47
        int counterreg2 = 0;
48

    
49
        /* (non-Javadoc)
50
         * @see org.txm.importer.filters.Filter#SetUsedParam(java.lang.Object)
51
         */
52
        void SetUsedParam(Object args) {
53

    
54
        }
55

    
56
        /* (non-Javadoc)
57
         * @see org.txm.importer.filters.Filter#before()
58
         */
59
        boolean before() {
60

    
61
        }
62

    
63
        /* (non-Javadoc)
64
         * @see org.txm.importer.filters.Filter#after()
65
         */
66
        void after()
67
        {
68
                println "reg1 : $counterreg1";
69
                println "reg2 : $counterreg2";
70
        }
71

    
72
        /** The segment. */
73
        def segment;
74

    
75
        /* (non-Javadoc)
76
         * @see org.txm.importer.filters.Filter#filter()
77
         */
78
        void filter()
79
        {
80
                segment = line.trim()
81
                if(segment[0] == "<")
82
                        output.write(lineSeparator+line);
83
                else
84
                output.write(" "+segment)
85
                /*if ( line ==~ /([^<])+>$/)
86
                {
87
                        output.write(" "+line.trim())
88
                }
89
                else
90
                {
91
                        output.write(lineSeparator+line);
92
                }*/
93
        }
94
}