View Javadoc

1   /*
2    * Copyright (C) 2004-2006 Christian Siefkes <christian@siefkes.net>.
3    * Development of this software is supported by the German Research Society,
4    * Berlin-Brandenburg Graduate School in Distributed Information Systems
5    * (DFG grant no. GRK 316).
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, visit
19   * http://www.gnu.org/licenses/gpl.html or write to the Free Software
20   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21   */
22  package de.fu_berlin.ties.eval;
23  
24  import de.fu_berlin.ties.io.Storable;
25  
26  /***
27   * Provides a read-only view on the statistics calculated by the
28   * {@link de.fu_berlin.ties.eval.FeatureCount} class and the underlying raw
29   * counts.
30   *
31   * @author Christian Siefkes
32   * @version $Revision: 1.6 $, $Date: 2006/10/21 16:04:11 $, $Author: siefkes $
33   */
34  public interface FeatureCountView extends Storable {
35  
36      /***
37       * Calculates and returns the average number of context representations in a
38       * document.
39       *
40       * @return the average number of context representations
41       */
42      double getAverageContexts();
43  
44      /***
45       * Calculates and returns the average number of non-comment features in a
46       * context representation.
47       *
48       * @return the average number of features
49       */
50      double getAverageFeatures();
51  
52      /***
53       * Calculates and returns the average number of unique non-comment features
54       * in a context representation.
55       *
56       * @return the average number of features
57       */
58      double getAverageUniqueFeatures();
59  
60      /***
61       * Returns the number of characters counted so far. Only characters
62       * <em>within</em> features are counted; separators between different
63       * features are ignored.
64       *
65       * @return the value of the attribute
66       */
67      long getCharacters();
68  
69      /***
70       * Calculates and returns the average number of characters in a context
71       * representation. Only characters <em>within</em> features are considered;
72       * separators between different features are ignored.
73       *
74       * @return the average number of characters in a context
75       */
76      double getCharactersPerContext();
77  
78      /***
79       * Calculates and returns the average number of characters in a feature.
80       *
81       * @return the average number of characters in a feature
82       */
83      double getCharactersPerFeature();
84  
85      /***
86       * Returns the number of representations evaluated so far.
87       * @return the value of the attribute
88       */
89      long getContexts();
90  
91      /***
92       * Returns the number of documents counted so far.
93       * @return the value of the attribute
94       */
95      long getDocuments();
96  
97  
98      /***
99       * Returns the number of non-comment features encountered so far.
100      * @return the value of the attribute
101      */
102     long getFeatureSum();
103 
104     /***
105      * Returns the number of non-comment non-duplicate features encountered so
106      * far. Duplicates within the same context representation are ignored; but
107      * equal features in different representations are not recognized as
108      * duplicate.
109      *
110      * @return the value of the attribute
111      */
112     long getUniqueFeatureSum();
113 
114 }