Free Electron
BruteScan.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_BruteScan_h__
8 #define __sample_text_BruteScan_h__
9 
10 namespace fe
11 {
12 
13 /**************************************************************************//**
14  @brief Analyze text on the fly
15 
16  @ingroup sample_text
17 
18  Just answer queries without much regard for performance.
19  Capital letters are not considered.
20 *//***************************************************************************/
21 class FE_DL_EXPORT BruteScan: virtual public StringScanI
22 {
23  public:
24  BruteScan(void) {}
25 virtual ~BruteScan(void) {}
26 
27  //* As StringScanI
28 virtual void analyze(String a_text);
29 virtual U32 wordCount(void);
30 virtual U32 charCount(void);
31 virtual U32 letterCount(void);
32 virtual U32 letterFrequency(char m_letter);
33 
34  private:
35 
36  void populateHistogram(void);
37 
38  String m_text;
39  std::map<char,U32> m_histogram;
40 };
41 
42 } // namespace
43 
44 #endif /* __sample_text_BruteScan_h__ */
Text Analyzer.
Definition: StringScanI.h:20
kernel
Definition: namespace.dox:3
Analyze text on the fly.
Definition: BruteScan.h:21
Automatically reference-counted string container.
Definition: String.h:128