1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__
6 #define CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__
17 namespace convert_dict
{
21 // Reads Hunspell .dic files.
24 // Associated with each word is a list of affix group IDs. This will typically
25 // be only one long, but may be more if there are multiple groups of
26 // independent affix rules for a base word.
27 typedef std::pair
<std::string
, std::vector
<int> > WordEntry
;
28 typedef std::vector
<WordEntry
> WordList
;
30 explicit DicReader(const base::FilePath
& path
);
33 // Non-numeric affixes will be added to the given AffReader and converted into
35 bool Read(AffReader
* aff_reader
);
37 // Returns the words read by Read(). These will be in order.
38 const WordList
& words() const { return words_
; }
42 FILE* additional_words_file_
;
44 // Contains all words and their corresponding affix index.
48 } // namespace convert_dict
50 #endif // CHROME_TOOLS_CONVERT_DICT_DIC_READER_H__