Skip to content

Commit

Permalink
use include-what-you-use (#64)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: shijie.chen <[email protected]>
Co-authored-by: Weng Xuetian <[email protected]>
  • Loading branch information
3 people authored Apr 14, 2024
1 parent b525fd3 commit a2c477b
Show file tree
Hide file tree
Showing 43 changed files with 7 additions and 103 deletions.
3 changes: 0 additions & 3 deletions src/libime/core/datrie.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ namespace libime {
template <typename V, bool ORDERED = true, int MAX_TRIAL = 1>
class DATriePrivate;

template <typename T>
class DATrie;

template <typename T>
struct NaN {
static constexpr auto N1 = -1;
Expand Down
2 changes: 0 additions & 2 deletions src/libime/core/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
*/

#include "decoder.h"
#include "datrie.h"
#include "languagemodel.h"
#include "lattice_p.h"
#include "utils.h"
#include <boost/functional/hash.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/range/adaptor/sliced.hpp>
#include <chrono>
#include <limits>
#include <memory>
#include <queue>
Expand Down
3 changes: 0 additions & 3 deletions src/libime/core/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
#define _FCITX_LIBIME_CORE_DECODER_H_

#include "libimecore_export.h"
#include <cstdint>
#include <fcitx-utils/macros.h>
#include <libime/core/dictionary.h>
#include <libime/core/lattice.h>
#include <libime/core/segmentgraph.h>
#include <memory>
#include <vector>

namespace libime {

class DecoderPrivate;
class Dictionary;
class LanguageModel;

class LIBIMECORE_EXPORT Decoder {
friend class DecoderPrivate;
Expand Down
2 changes: 0 additions & 2 deletions src/libime/core/historybigram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
#include "zstdfilter.h"
#include <boost/algorithm/cxx11/all_of.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm.hpp>
#include <cmath>
#include <fcitx-utils/log.h>
#include <fcitx-utils/stringutils.h>
#include <iterator>
#include <ostream>
Expand Down
1 change: 0 additions & 1 deletion src/libime/core/historybigram.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace libime {

class HistoryBigramPrivate;
class HistoryBigram;

class LIBIMECORE_EXPORT HistoryBigram {
public:
Expand Down
5 changes: 0 additions & 5 deletions src/libime/core/inputbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "inputbuffer.h"
#include <boost/iterator/function_input_iterator.hpp>
#include <boost/range/iterator_range.hpp>
#include <exception>
#include <fcitx-utils/utf8.h>
#include <numeric>
#include <vector>

namespace libime {

Expand Down
2 changes: 0 additions & 2 deletions src/libime/core/inputbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "libimecore_export.h"
#include <boost/iterator/iterator_facade.hpp>
#include <fcitx-utils/inputbuffer.h>
#include <fcitx-utils/macros.h>
#include <memory>
#include <string_view>

namespace libime {
Expand Down
4 changes: 0 additions & 4 deletions src/libime/core/lattice.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "libimecore_export.h"
#include <algorithm>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/adaptor/type_erased.hpp>
#include <fcitx-utils/macros.h>
#include <fcitx-utils/stringutils.h>
#include <libime/core/languagemodel.h>
Expand All @@ -19,10 +18,7 @@

namespace libime {

class Decoder;
class LatticePrivate;
class SegmentGraphNode;
class SegmentGraph;
class LatticeNode;

class SentenceResult {
Expand Down
2 changes: 0 additions & 2 deletions src/libime/core/segmentgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

#include "segmentgraph.h"
#include "lattice_p.h"
#include <boost/algorithm/string.hpp>
#include <boost/range/combine.hpp>
#include <iostream>
#include <queue>

namespace libime {
Expand Down
5 changes: 0 additions & 5 deletions src/libime/core/segmentgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@

#include "libimecore_export.h"
#include <boost/iterator/transform_iterator.hpp>
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/range/adaptor/type_erased.hpp>
#include <boost/range/iterator_range.hpp>
#include <fcitx-utils/element.h>
#include <functional>
#include <list>
#include <string_view>
#include <unordered_map>
#include <unordered_set>

namespace libime {

class Lattice;
class SegmentGraphBase;
class SegmentGraph;
class SegmentGraphNode;
typedef std::function<bool(const SegmentGraphBase &graph,
const std::vector<size_t> &)>
Expand Down
10 changes: 0 additions & 10 deletions src/libime/core/triedictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,8 @@
#include "triedictionary.h"

#include "libime/core/datrie.h"
#include "libime/core/lattice.h"
#include "libime/core/lrucache.h"
#include "libime/core/utils.h"
#include <boost/algorithm/string.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/unordered_map.hpp>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <queue>
#include <string_view>
#include <type_traits>

namespace libime {

Expand Down
1 change: 0 additions & 1 deletion src/libime/core/userlanguagemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "constants.h"
#include "historybigram.h"
#include "lm/model.hh"
#include "utils.h"
#include "utils_p.h"
#include <cmath>

Expand Down
1 change: 0 additions & 1 deletion src/libime/core/userlanguagemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define _FCITX_LIBIME_CORE_USERLANGUAGEMODEL_H_

#include "libimecore_export.h"
#include <fcitx-utils/connectableobject.h>
#include <libime/core/languagemodel.h>

namespace libime {
Expand Down
1 change: 0 additions & 1 deletion src/libime/pinyin/pinyincontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "pinyinmatchstate.h"
#include <algorithm>
#include <fcitx-utils/charutils.h>
#include <fcitx-utils/log.h>
#include <fcitx-utils/utf8.h>
#include <iterator>
#include <stdexcept>
Expand Down
1 change: 0 additions & 1 deletion src/libime/pinyin/pinyincontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace libime {
class PinyinIME;
class PinyinContextPrivate;
class LatticeNode;
enum class PinyinPreeditMode;

class LIBIMEPINYIN_EXPORT PinyinContext : public InputBuffer {
Expand Down
3 changes: 3 additions & 0 deletions src/libime/pinyin/pinyindata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include "pinyinencoder.h"
#include <boost/algorithm/string/predicate.hpp>
#include <fcitx-utils/stringutils.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>

namespace libime {

Expand Down
3 changes: 0 additions & 3 deletions src/libime/pinyin/pinyindictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#include "pinyinencoder.h"
#include "pinyinmatchstate_p.h"
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/unordered_map.hpp>
#include <cmath>
#include <fstream>
#include <iomanip>
Expand Down
2 changes: 0 additions & 2 deletions src/libime/pinyin/pinyindictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define _FCITX_LIBIME_PINYIN_PINYINDICTIONARY_H_

#include "libimepinyin_export.h"
#include <fcitx-utils/connectableobject.h>
#include <fcitx-utils/macros.h>
#include <libime/core/triedictionary.h>
#include <libime/pinyin/pinyinencoder.h>
Expand All @@ -22,7 +21,6 @@ class PinyinDictionaryPrivate;
typedef std::function<bool(std::string_view encodedPinyin,
std::string_view hanzi, float cost)>
PinyinMatchCallback;
class PinyinDictionary;

using PinyinTrie = typename TrieDictionary::TrieType;

Expand Down
1 change: 0 additions & 1 deletion src/libime/pinyin/pinyinencoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/bimap.hpp>
#include <boost/bimap/unordered_set_of.hpp>
#include <boost/container/static_vector.hpp>
#include <fcitx-utils/charutils.h>
#include <functional>
Expand Down
2 changes: 0 additions & 2 deletions src/libime/pinyin/shuangpinprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#include "pinyinencoder.h"
#include "shuangpindata.h"
#include <boost/algorithm/string.hpp>
#include <exception>
#include <fcitx-utils/charutils.h>
#include <iostream>
#include <set>
#include <string_view>
#include <unordered_map>
Expand Down
1 change: 0 additions & 1 deletion src/libime/pinyin/shuangpinprofile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <memory>
#include <set>
#include <string>
#include <unordered_map>

namespace libime {

Expand Down
1 change: 0 additions & 1 deletion src/libime/table/autophrasedict.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <functional>
#include <istream>
#include <memory>
#include <ostream>
#include <string>
#include <string_view>

Expand Down
4 changes: 0 additions & 4 deletions src/libime/table/tablebaseddictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
#include "tableoptions.h"
#include "tablerule.h"
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <cstring>
#include <fcitx-utils/log.h>
#include <fcitx-utils/stringutils.h>
#include <fcitx-utils/utf8.h>
#include <fstream>
#include <istream>
#include <set>
#include <stdexcept>
#include <string>
Expand Down
4 changes: 0 additions & 4 deletions src/libime/table/tablecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
#include "tablecontext.h"
#include "constants.h"
#include "libime/core/decoder.h"
#include "libime/core/historybigram.h"
#include "libime/core/segmentgraph.h"
#include "libime/core/userlanguagemodel.h"
Expand All @@ -15,10 +14,7 @@
#include "tabledecoder.h"
#include "tableoptions.h"
#include "tablerule.h"
#include <boost/ptr_container/ptr_vector.hpp>
#include <chrono>
#include <fcitx-utils/log.h>
#include <fcitx-utils/stringutils.h>
#include <fcitx-utils/utf8.h>
#include <regex>

Expand Down
2 changes: 0 additions & 2 deletions src/libime/table/tablecontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
/// \brief Class provide input method support for table-based ones, like wubi.

#include "libimetable_export.h"
#include <fcitx-utils/connectableobject.h>
#include <fcitx-utils/macros.h>
#include <libime/core/inputbuffer.h>
#include <libime/core/lattice.h>
#include <libime/table/tablebaseddictionary.h>
#include <string_view>
#include <tuple>
Expand Down
1 change: 0 additions & 1 deletion src/libime/table/tabledecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "tableoptions.h"
#include "tablerule.h"
#include <boost/range/adaptor/filtered.hpp>
#include <cmath>
#include <fcitx-utils/utf8.h>

namespace libime {
Expand Down
4 changes: 0 additions & 4 deletions src/libime/table/tablerule.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
#include <fcitx-utils/charutils.h>
#include <iostream>
#include <libime/core/utils.h>
#include <limits>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
#include <vector>

namespace libime {
Expand Down
1 change: 0 additions & 1 deletion test/testmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "libime/core/lattice.h"
#include "testdir.h"
#include <cmath>
#include <fcitx-utils/log.h>

int main() {
using namespace libime;
Expand Down
2 changes: 0 additions & 2 deletions test/testpinyincontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
#include "libime/pinyin/pinyinime.h"
#include "testdir.h"
#include <array>
#include <boost/range/adaptor/transformed.hpp>
#include <fcitx-utils/log.h>
#include <fcitx-utils/stringutils.h>
#include <sstream>

using namespace libime;
Expand Down
1 change: 0 additions & 1 deletion test/testpinyindictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "libime/pinyin/pinyindictionary.h"
#include "libime/pinyin/pinyinencoder.h"
#include "testdir.h"
#include "testutils.h"
#include <fcitx-utils/log.h>
#include <sstream>

Expand Down
4 changes: 0 additions & 4 deletions test/testpinyinime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@
#include "libime/pinyin/shuangpinprofile.h"
#include "testdir.h"
#include "testutils.h"
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/device/null.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <fcitx-utils/log.h>
#include <fcitx-utils/stringutils.h>
#include <fstream>
#include <functional>
#include <sstream>

using namespace libime;

Expand Down
2 changes: 0 additions & 2 deletions test/testpinyinprediction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#include "libime/pinyin/pinyinencoder.h"
#include "libime/pinyin/pinyinprediction.h"
#include "testdir.h"
#include "testutils.h"
#include <fcitx-utils/log.h>
#include <sstream>

using namespace libime;

Expand Down
9 changes: 0 additions & 9 deletions test/testprediction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@
*/

#include "libime/core/historybigram.h"
#include "libime/core/languagemodel.h"
#include "libime/core/prediction.h"
#include "testdir.h"
#include "testutils.h"
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/device/null.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <fcitx-utils/log.h>
#include <fcitx-utils/stringutils.h>
#include <fstream>
#include <functional>

using namespace libime;

Expand Down
Loading

0 comments on commit a2c477b

Please sign in to comment.