2 **********************************************************************
3 * Copyright (C) 2005-2012, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
11 #include "unicode/uobject.h"
13 #if !UCONFIG_NO_CONVERSION
18 class CharsetRecognizer;
21 * CharsetMatch represents the results produced by one Charset Recognizer for one input text
22 * Any confidence > 0 indicates a possible match, meaning that the input bytes
25 * The full results of a detect are represented by an array of these
26 * CharsetMatch objects, each representing a possible matching charset.
28 * Note that a single charset recognizer may detect multiple closely related
29 * charsets, and set different names depending on the exact input bytes seen.
31 class CharsetMatch : public UMemory
36 const char *fCharsetName;
43 * fully set the state of this CharsetMatch.
44 * Called by the CharsetRecognizers to record match results.
45 * Default (NULL) parameters for names will be filled by calling the
46 * corresponding getters on the recognizer.
48 void set(InputText *input,
49 const CharsetRecognizer *cr,
51 const char *csName=NULL,
52 const char *lang=NULL);
55 * Return the name of the charset for this Match
57 const char *getName() const;
59 const char *getLanguage()const;
61 int32_t getConfidence()const;
63 int32_t getUChars(UChar *buf, int32_t cap, UErrorCode *status) const;
69 #endif /* __CSMATCH_H */