Free Electron
StringScanI.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __sample_text_StringScanI_h__
8 #define __sample_text_StringScanI_h__
9 
10 namespace fe
11 {
12 
13 /**************************************************************************//**
14  @brief Text Analyzer
15 
16  @ingroup sample_text
17 
18  Evaluate metrics on a given string.
19 *//***************************************************************************/
20 class FE_DL_EXPORT StringScanI: virtual public Component
21 {
22  public:
23  /// specify a string to process
24 virtual void analyze(String filename) =0;
25 
26  /// number of distinct words
27 virtual U32 wordCount(void) =0;
28 
29  /// number of non-whitespace characters
30 virtual U32 charCount(void) =0;
31 
32  /// number of unique non-whitespace letters (a-z)
33 virtual U32 letterCount(void) =0;
34 
35  /// appearances of a specific character (a-z)
36 virtual U32 letterFrequency(char m_letter) =0;
37 };
38 
39 } // namespace
40 
41 #endif /* __sample_text_StringScanI_h__ */
Text Analyzer.
Definition: StringScanI.h:20
kernel
Definition: namespace.dox:3
Automatically reference-counted string container.
Definition: String.h:128
Base for all interfacable components.
Definition: Component.h:20