diff --git a/libchinese-segmentation/chinese-segmentation.cpp b/libchinese-segmentation/chinese-segmentation.cpp index e3a1207..095d6a7 100644 --- a/libchinese-segmentation/chinese-segmentation.cpp +++ b/libchinese-segmentation/chinese-segmentation.cpp @@ -24,11 +24,10 @@ static ChineseSegmentation *global_instance_chinese_segmentation = nullptr; QMutex ChineseSegmentation::m_mutex; -ChineseSegmentation::ChineseSegmentation() -{ +ChineseSegmentation::ChineseSegmentation() { const char * const DICT_PATH = "/usr/share/ukui-search/res/dict/jieba.dict.utf8"; const char * const HMM_PATH = "/usr/share/ukui-search/res/dict/hmm_model.utf8"; - const char * const USER_DICT_PATH ="/usr/share/ukui-search/res/dict/user.dict.utf8"; + const char * const USER_DICT_PATH = "/usr/share/ukui-search/res/dict/user.dict.utf8"; const char * const IDF_PATH = "/usr/share/ukui-search/res/dict/idf.utf8"; const char * const STOP_WORD_PATH = "/usr/share/ukui-search/res/dict/stop_words.utf8"; @@ -39,26 +38,23 @@ ChineseSegmentation::ChineseSegmentation() STOP_WORD_PATH); } -ChineseSegmentation::~ChineseSegmentation() -{ +ChineseSegmentation::~ChineseSegmentation() { if(m_jieba) delete m_jieba; m_jieba = nullptr; } -ChineseSegmentation *ChineseSegmentation::getInstance() -{ +ChineseSegmentation *ChineseSegmentation::getInstance() { QMutexLocker locker(&m_mutex); - if (!global_instance_chinese_segmentation) { + if(!global_instance_chinese_segmentation) { global_instance_chinese_segmentation = new ChineseSegmentation; } return global_instance_chinese_segmentation; } -QVector ChineseSegmentation::callSegement(QString str) -{ +QVector ChineseSegmentation::callSegement(QString str) { std::string s; - s=str.toStdString(); + s = str.toStdString(); str.squeeze(); const size_t topk = -1; @@ -76,9 +72,8 @@ QVector ChineseSegmentation::callSegement(QString str) } -void ChineseSegmentation::convert(std::vector &keywordres, QVector &kw) -{ - for (auto i : keywordres){ +void ChineseSegmentation::convert(std::vector &keywordres, QVector &kw) { + for(auto i : keywordres) { SKeyWord temp; temp.word = i.word; temp.offsets = QVector::fromStdVector(i.offsets); diff --git a/libchinese-segmentation/chinese-segmentation.h b/libchinese-segmentation/chinese-segmentation.h index db054c4..c027608 100644 --- a/libchinese-segmentation/chinese-segmentation.h +++ b/libchinese-segmentation/chinese-segmentation.h @@ -32,24 +32,23 @@ #include #include -struct SKeyWord{ +struct SKeyWord { std::string word; QVector offsets; double weight; - ~SKeyWord(){ + ~SKeyWord() { word = std::move(""); offsets.clear(); offsets.shrink_to_fit(); } }; -class CHINESESEGMENTATION_EXPORT ChineseSegmentation -{ +class CHINESESEGMENTATION_EXPORT ChineseSegmentation { public: static ChineseSegmentation *getInstance(); ~ChineseSegmentation(); QVector callSegement(QString str); - void convert(std::vector& keywordres,QVector& kw); + void convert(std::vector& keywordres, QVector& kw); private: static QMutex m_mutex; cppjieba::Jieba *m_jieba; diff --git a/libchinese-segmentation/cppjieba/DictTrie.hpp b/libchinese-segmentation/cppjieba/DictTrie.hpp index a389348..736b685 100644 --- a/libchinese-segmentation/cppjieba/DictTrie.hpp +++ b/libchinese-segmentation/cppjieba/DictTrie.hpp @@ -43,252 +43,247 @@ const size_t DICT_COLUMN_NUM = 3; const char* const UNKNOWN_TAG = ""; class DictTrie { - public: - enum UserWordWeightOption { - WordWeightMin, - WordWeightMedian, - WordWeightMax, - }; // enum UserWordWeightOption +public: + enum UserWordWeightOption { + WordWeightMin, + WordWeightMedian, + WordWeightMax, + }; // enum UserWordWeightOption - DictTrie(const string& dict_path, const string& user_dict_paths = "", UserWordWeightOption user_word_weight_opt = WordWeightMedian) { - Init(dict_path, user_dict_paths, user_word_weight_opt); - } - - ~DictTrie() { - delete trie_; - } - - bool InsertUserWord(const string& word, const string& tag = UNKNOWN_TAG) { - DictUnit node_info; - if (!MakeNodeInfo(node_info, word, user_word_default_weight_, tag)) { - return false; + DictTrie(const string& dict_path, const string& user_dict_paths = "", UserWordWeightOption user_word_weight_opt = WordWeightMedian) { + Init(dict_path, user_dict_paths, user_word_weight_opt); } - active_node_infos_.push_back(node_info); - trie_->InsertNode(node_info.word, &active_node_infos_.back()); - return true; - } - bool InsertUserWord(const string& word,int freq, const string& tag = UNKNOWN_TAG) { - DictUnit node_info; - double weight = freq ? log(1.0 * freq / freq_sum_) : user_word_default_weight_ ; - if (!MakeNodeInfo(node_info, word, weight , tag)) { - return false; + ~DictTrie() { + delete trie_; } - active_node_infos_.push_back(node_info); - trie_->InsertNode(node_info.word, &active_node_infos_.back()); - return true; - } - const DictUnit* Find(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { - return trie_->Find(begin, end); - } - - void Find(RuneStrArray::const_iterator begin, - RuneStrArray::const_iterator end, - vector&res, - size_t max_word_len = MAX_WORD_LENGTH) const { - trie_->Find(begin, end, res, max_word_len); - } - - bool Find(const string& word) - { - const DictUnit *tmp = NULL; - RuneStrArray runes; - if (!DecodeRunesInString(word, runes)) - { - XLOG(ERROR) << "Decode failed."; + bool InsertUserWord(const string& word, const string& tag = UNKNOWN_TAG) { + DictUnit node_info; + if(!MakeNodeInfo(node_info, word, user_word_default_weight_, tag)) { + return false; + } + active_node_infos_.push_back(node_info); + trie_->InsertNode(node_info.word, &active_node_infos_.back()); + return true; } - tmp = Find(runes.begin(), runes.end()); - if (tmp == NULL) - { - return false; + + bool InsertUserWord(const string& word, int freq, const string& tag = UNKNOWN_TAG) { + DictUnit node_info; + double weight = freq ? log(1.0 * freq / freq_sum_) : user_word_default_weight_ ; + if(!MakeNodeInfo(node_info, word, weight, tag)) { + return false; + } + active_node_infos_.push_back(node_info); + trie_->InsertNode(node_info.word, &active_node_infos_.back()); + return true; } - else - { - return true; + + const DictUnit* Find(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { + return trie_->Find(begin, end); } - } - bool IsUserDictSingleChineseWord(const Rune& word) const { - return IsIn(user_dict_single_chinese_word_, word); - } + void Find(RuneStrArray::const_iterator begin, + RuneStrArray::const_iterator end, + vector&res, + size_t max_word_len = MAX_WORD_LENGTH) const { + trie_->Find(begin, end, res, max_word_len); + } - double GetMinWeight() const { - return min_weight_; - } + bool Find(const string& word) { + const DictUnit *tmp = NULL; + RuneStrArray runes; + if(!DecodeRunesInString(word, runes)) { + XLOG(ERROR) << "Decode failed."; + } + tmp = Find(runes.begin(), runes.end()); + if(tmp == NULL) { + return false; + } else { + return true; + } + } - void InserUserDictNode(const string& line) { - vector buf; - DictUnit node_info; - Split(line, buf, " "); - if(buf.size() == 1){ - MakeNodeInfo(node_info, - buf[0], - user_word_default_weight_, - UNKNOWN_TAG); - } else if (buf.size() == 2) { - MakeNodeInfo(node_info, - buf[0], - user_word_default_weight_, - buf[1]); - } else if (buf.size() == 3) { - int freq = atoi(buf[1].c_str()); - assert(freq_sum_ > 0.0); - double weight = log(1.0 * freq / freq_sum_); - MakeNodeInfo(node_info, buf[0], weight, buf[2]); + bool IsUserDictSingleChineseWord(const Rune& word) const { + return IsIn(user_dict_single_chinese_word_, word); + } + + double GetMinWeight() const { + return min_weight_; + } + + void InserUserDictNode(const string& line) { + vector buf; + DictUnit node_info; + Split(line, buf, " "); + if(buf.size() == 1) { + MakeNodeInfo(node_info, + buf[0], + user_word_default_weight_, + UNKNOWN_TAG); + } else if(buf.size() == 2) { + MakeNodeInfo(node_info, + buf[0], + user_word_default_weight_, + buf[1]); + } else if(buf.size() == 3) { + int freq = atoi(buf[1].c_str()); + assert(freq_sum_ > 0.0); + double weight = log(1.0 * freq / freq_sum_); + MakeNodeInfo(node_info, buf[0], weight, buf[2]); } static_node_infos_.push_back(node_info); - if (node_info.word.size() == 1) { - user_dict_single_chinese_word_.insert(node_info.word[0]); + if(node_info.word.size() == 1) { + user_dict_single_chinese_word_.insert(node_info.word[0]); } - } - - void LoadUserDict(const vector& buf) { - for (size_t i = 0; i < buf.size(); i++) { - InserUserDictNode(buf[i]); } - } - void LoadUserDict(const set& buf) { - std::set::const_iterator iter; - for (iter = buf.begin(); iter != buf.end(); iter++){ - InserUserDictNode(*iter); - } - } - - void LoadUserDict(const string& filePaths) { - vector files = limonp::Split(filePaths, "|;"); - size_t lineno = 0; - for (size_t i = 0; i < files.size(); i++) { - ifstream ifs(files[i].c_str()); - XCHECK(ifs.is_open()) << "open " << files[i] << " failed"; - string line; - - for (; getline(ifs, line); lineno++) { - if (line.size() == 0) { - continue; + void LoadUserDict(const vector& buf) { + for(size_t i = 0; i < buf.size(); i++) { + InserUserDictNode(buf[i]); } - InserUserDictNode(line); - } - } - } - - - private: - void Init(const string& dict_path, const string& user_dict_paths, UserWordWeightOption user_word_weight_opt) { - LoadDict(dict_path); - freq_sum_ = CalcFreqSum(static_node_infos_); - CalculateWeight(static_node_infos_, freq_sum_); - SetStaticWordWeights(user_word_weight_opt); - - if (user_dict_paths.size()) { - LoadUserDict(user_dict_paths); - } - Shrink(static_node_infos_); - CreateTrie(static_node_infos_); - } - - void CreateTrie(const vector& dictUnits) { - assert(dictUnits.size()); - vector words; - vector valuePointers; - for (size_t i = 0 ; i < dictUnits.size(); i ++) { - words.push_back(dictUnits[i].word); - valuePointers.push_back(&dictUnits[i]); } - trie_ = new Trie(words, valuePointers); - } - - - - - bool MakeNodeInfo(DictUnit& node_info, - const string& word, - double weight, - const string& tag) { - if (!DecodeRunesInString(word, node_info.word)) { - XLOG(ERROR) << "Decode " << word << " failed."; - return false; + void LoadUserDict(const set& buf) { + std::set::const_iterator iter; + for(iter = buf.begin(); iter != buf.end(); iter++) { + InserUserDictNode(*iter); + } } - node_info.weight = weight; - node_info.tag = tag; - return true; - } - void LoadDict(const string& filePath) { - ifstream ifs(filePath.c_str()); - XCHECK(ifs.is_open()) << "open " << filePath << " failed."; - string line; - vector buf; + void LoadUserDict(const string& filePaths) { + vector files = limonp::Split(filePaths, "|;"); + size_t lineno = 0; + for(size_t i = 0; i < files.size(); i++) { + ifstream ifs(files[i].c_str()); + XCHECK(ifs.is_open()) << "open " << files[i] << " failed"; + string line; - DictUnit node_info; - for (size_t lineno = 0; getline(ifs, line); lineno++) { - Split(line, buf, " "); - XCHECK(buf.size() == DICT_COLUMN_NUM) << "split result illegal, line:" << line; - MakeNodeInfo(node_info, - buf[0], - atof(buf[1].c_str()), - buf[2]); - static_node_infos_.push_back(node_info); + for(; getline(ifs, line); lineno++) { + if(line.size() == 0) { + continue; + } + InserUserDictNode(line); + } + } } - } - static bool WeightCompare(const DictUnit& lhs, const DictUnit& rhs) { - return lhs.weight < rhs.weight; - } - void SetStaticWordWeights(UserWordWeightOption option) { - XCHECK(!static_node_infos_.empty()); - vector x = static_node_infos_; - sort(x.begin(), x.end(), WeightCompare); - min_weight_ = x[0].weight; - max_weight_ = x[x.size() - 1].weight; - median_weight_ = x[x.size() / 2].weight; - switch (option) { - case WordWeightMin: - user_word_default_weight_ = min_weight_; - break; - case WordWeightMedian: - user_word_default_weight_ = median_weight_; - break; - default: - user_word_default_weight_ = max_weight_; - break; +private: + void Init(const string& dict_path, const string& user_dict_paths, UserWordWeightOption user_word_weight_opt) { + LoadDict(dict_path); + freq_sum_ = CalcFreqSum(static_node_infos_); + CalculateWeight(static_node_infos_, freq_sum_); + SetStaticWordWeights(user_word_weight_opt); + + if(user_dict_paths.size()) { + LoadUserDict(user_dict_paths); + } + Shrink(static_node_infos_); + CreateTrie(static_node_infos_); } - } - double CalcFreqSum(const vector& node_infos) const { - double sum = 0.0; - for (size_t i = 0; i < node_infos.size(); i++) { - sum += node_infos[i].weight; + void CreateTrie(const vector& dictUnits) { + assert(dictUnits.size()); + vector words; + vector valuePointers; + for(size_t i = 0 ; i < dictUnits.size(); i ++) { + words.push_back(dictUnits[i].word); + valuePointers.push_back(&dictUnits[i]); + } + + trie_ = new Trie(words, valuePointers); } - return sum; - } - void CalculateWeight(vector& node_infos, double sum) const { - assert(sum > 0.0); - for (size_t i = 0; i < node_infos.size(); i++) { - DictUnit& node_info = node_infos[i]; - assert(node_info.weight > 0.0); - node_info.weight = log(double(node_info.weight)/sum); + + + + bool MakeNodeInfo(DictUnit& node_info, + const string& word, + double weight, + const string& tag) { + if(!DecodeRunesInString(word, node_info.word)) { + XLOG(ERROR) << "Decode " << word << " failed."; + return false; + } + node_info.weight = weight; + node_info.tag = tag; + return true; } - } - void Shrink(vector& units) const { - vector(units.begin(), units.end()).swap(units); - } + void LoadDict(const string& filePath) { + ifstream ifs(filePath.c_str()); + XCHECK(ifs.is_open()) << "open " << filePath << " failed."; + string line; + vector buf; - vector static_node_infos_; - deque active_node_infos_; // must not be vector - Trie * trie_; + DictUnit node_info; + for(size_t lineno = 0; getline(ifs, line); lineno++) { + Split(line, buf, " "); + XCHECK(buf.size() == DICT_COLUMN_NUM) << "split result illegal, line:" << line; + MakeNodeInfo(node_info, + buf[0], + atof(buf[1].c_str()), + buf[2]); + static_node_infos_.push_back(node_info); + } + } - double freq_sum_; - double min_weight_; - double max_weight_; - double median_weight_; - double user_word_default_weight_; - unordered_set user_dict_single_chinese_word_; + static bool WeightCompare(const DictUnit& lhs, const DictUnit& rhs) { + return lhs.weight < rhs.weight; + } + + void SetStaticWordWeights(UserWordWeightOption option) { + XCHECK(!static_node_infos_.empty()); + vector x = static_node_infos_; + sort(x.begin(), x.end(), WeightCompare); + min_weight_ = x[0].weight; + max_weight_ = x[x.size() - 1].weight; + median_weight_ = x[x.size() / 2].weight; + switch(option) { + case WordWeightMin: + user_word_default_weight_ = min_weight_; + break; + case WordWeightMedian: + user_word_default_weight_ = median_weight_; + break; + default: + user_word_default_weight_ = max_weight_; + break; + } + } + + double CalcFreqSum(const vector& node_infos) const { + double sum = 0.0; + for(size_t i = 0; i < node_infos.size(); i++) { + sum += node_infos[i].weight; + } + return sum; + } + + void CalculateWeight(vector& node_infos, double sum) const { + assert(sum > 0.0); + for(size_t i = 0; i < node_infos.size(); i++) { + DictUnit& node_info = node_infos[i]; + assert(node_info.weight > 0.0); + node_info.weight = log(double(node_info.weight) / sum); + } + } + + void Shrink(vector& units) const { + vector(units.begin(), units.end()).swap(units); + } + + vector static_node_infos_; + deque active_node_infos_; // must not be vector + Trie * trie_; + + double freq_sum_; + double min_weight_; + double max_weight_; + double median_weight_; + double user_word_default_weight_; + unordered_set user_dict_single_chinese_word_; }; } diff --git a/libchinese-segmentation/cppjieba/FullSegment.hpp b/libchinese-segmentation/cppjieba/FullSegment.hpp index f2ff72f..1a2bca7 100644 --- a/libchinese-segmentation/cppjieba/FullSegment.hpp +++ b/libchinese-segmentation/cppjieba/FullSegment.hpp @@ -29,82 +29,82 @@ namespace cppjieba { class FullSegment: public SegmentBase { - public: - FullSegment(const string& dictPath) { - dictTrie_ = new DictTrie(dictPath); - isNeedDestroy_ = true; - } - FullSegment(const DictTrie* dictTrie) - : dictTrie_(dictTrie), isNeedDestroy_(false) { - assert(dictTrie_); - } - ~FullSegment() { - if (isNeedDestroy_) { - delete dictTrie_; +public: + FullSegment(const string& dictPath) { + dictTrie_ = new DictTrie(dictPath); + isNeedDestroy_ = true; } - } - void Cut(const string& sentence, - vector& words) const { - vector tmp; - Cut(sentence, tmp); - GetStringsFromWords(tmp, words); - } - void Cut(const string& sentence, - vector& words) const { - PreFilter pre_filter(symbols_, sentence); - PreFilter::Range range; - vector wrs; - wrs.reserve(sentence.size()/2); - while (pre_filter.HasNext()) { - range = pre_filter.Next(); - Cut(range.begin, range.end, wrs); + FullSegment(const DictTrie* dictTrie) + : dictTrie_(dictTrie), isNeedDestroy_(false) { + assert(dictTrie_); } - words.clear(); - words.reserve(wrs.size()); - GetWordsFromWordRanges(sentence, wrs, words); - } - void Cut(RuneStrArray::const_iterator begin, - RuneStrArray::const_iterator end, - vector& res) const { - // result of searching in trie tree - LocalVector > tRes; - - // max index of res's words - size_t maxIdx = 0; - - // always equals to (uItr - begin) - size_t uIdx = 0; - - // tmp variables - size_t wordLen = 0; - assert(dictTrie_); - vector dags; - dictTrie_->Find(begin, end, dags); - for (size_t i = 0; i < dags.size(); i++) { - for (size_t j = 0; j < dags[i].nexts.size(); j++) { - size_t nextoffset = dags[i].nexts[j].first; - assert(nextoffset < dags.size()); - const DictUnit* du = dags[i].nexts[j].second; - if (du == NULL) { - if (dags[i].nexts.size() == 1 && maxIdx <= uIdx) { - WordRange wr(begin + i, begin + nextoffset); - res.push_back(wr); - } - } else { - wordLen = du->word.size(); - if (wordLen >= 2 || (dags[i].nexts.size() == 1 && maxIdx <= uIdx)) { - WordRange wr(begin + i, begin + nextoffset); - res.push_back(wr); - } + ~FullSegment() { + if(isNeedDestroy_) { + delete dictTrie_; } - maxIdx = uIdx + wordLen > maxIdx ? uIdx + wordLen : maxIdx; - } - uIdx++; } - } - private: - const DictTrie* dictTrie_; - bool isNeedDestroy_; + void Cut(const string& sentence, + vector& words) const { + vector tmp; + Cut(sentence, tmp); + GetStringsFromWords(tmp, words); + } + void Cut(const string& sentence, + vector& words) const { + PreFilter pre_filter(symbols_, sentence); + PreFilter::Range range; + vector wrs; + wrs.reserve(sentence.size() / 2); + while(pre_filter.HasNext()) { + range = pre_filter.Next(); + Cut(range.begin, range.end, wrs); + } + words.clear(); + words.reserve(wrs.size()); + GetWordsFromWordRanges(sentence, wrs, words); + } + void Cut(RuneStrArray::const_iterator begin, + RuneStrArray::const_iterator end, + vector& res) const { + // result of searching in trie tree + LocalVector > tRes; + + // max index of res's words + size_t maxIdx = 0; + + // always equals to (uItr - begin) + size_t uIdx = 0; + + // tmp variables + size_t wordLen = 0; + assert(dictTrie_); + vector dags; + dictTrie_->Find(begin, end, dags); + for(size_t i = 0; i < dags.size(); i++) { + for(size_t j = 0; j < dags[i].nexts.size(); j++) { + size_t nextoffset = dags[i].nexts[j].first; + assert(nextoffset < dags.size()); + const DictUnit* du = dags[i].nexts[j].second; + if(du == NULL) { + if(dags[i].nexts.size() == 1 && maxIdx <= uIdx) { + WordRange wr(begin + i, begin + nextoffset); + res.push_back(wr); + } + } else { + wordLen = du->word.size(); + if(wordLen >= 2 || (dags[i].nexts.size() == 1 && maxIdx <= uIdx)) { + WordRange wr(begin + i, begin + nextoffset); + res.push_back(wr); + } + } + maxIdx = uIdx + wordLen > maxIdx ? uIdx + wordLen : maxIdx; + } + uIdx++; + } + } +private: + const DictTrie* dictTrie_; + bool isNeedDestroy_; }; } diff --git a/libchinese-segmentation/cppjieba/HMMModel.hpp b/libchinese-segmentation/cppjieba/HMMModel.hpp index 0bd5e70..5491a0c 100644 --- a/libchinese-segmentation/cppjieba/HMMModel.hpp +++ b/libchinese-segmentation/cppjieba/HMMModel.hpp @@ -28,118 +28,118 @@ using namespace limonp; typedef unordered_map EmitProbMap; struct HMMModel { - /* - * STATUS: - * 0: HMMModel::B, 1: HMMModel::E, 2: HMMModel::M, 3:HMMModel::S - * */ - enum {B = 0, E = 1, M = 2, S = 3, STATUS_SUM = 4}; + /* + * STATUS: + * 0: HMMModel::B, 1: HMMModel::E, 2: HMMModel::M, 3:HMMModel::S + * */ + enum {B = 0, E = 1, M = 2, S = 3, STATUS_SUM = 4}; - HMMModel(const string& modelPath) { - memset(startProb, 0, sizeof(startProb)); - memset(transProb, 0, sizeof(transProb)); - statMap[0] = 'B'; - statMap[1] = 'E'; - statMap[2] = 'M'; - statMap[3] = 'S'; - emitProbVec.push_back(&emitProbB); - emitProbVec.push_back(&emitProbE); - emitProbVec.push_back(&emitProbM); - emitProbVec.push_back(&emitProbS); - LoadModel(modelPath); - } - ~HMMModel() { - } - void LoadModel(const string& filePath) { - ifstream ifile(filePath.c_str()); - XCHECK(ifile.is_open()) << "open " << filePath << " failed"; - string line; - vector tmp; - vector tmp2; - //Load startProb - XCHECK(GetLine(ifile, line)); - Split(line, tmp, " "); - XCHECK(tmp.size() == STATUS_SUM); - for (size_t j = 0; j< tmp.size(); j++) { - startProb[j] = atof(tmp[j].c_str()); + HMMModel(const string& modelPath) { + memset(startProb, 0, sizeof(startProb)); + memset(transProb, 0, sizeof(transProb)); + statMap[0] = 'B'; + statMap[1] = 'E'; + statMap[2] = 'M'; + statMap[3] = 'S'; + emitProbVec.push_back(&emitProbB); + emitProbVec.push_back(&emitProbE); + emitProbVec.push_back(&emitProbM); + emitProbVec.push_back(&emitProbS); + LoadModel(modelPath); } - - //Load transProb - for (size_t i = 0; i < STATUS_SUM; i++) { - XCHECK(GetLine(ifile, line)); - Split(line, tmp, " "); - XCHECK(tmp.size() == STATUS_SUM); - for (size_t j =0; j < STATUS_SUM; j++) { - transProb[i][j] = atof(tmp[j].c_str()); - } + ~HMMModel() { } + void LoadModel(const string& filePath) { + ifstream ifile(filePath.c_str()); + XCHECK(ifile.is_open()) << "open " << filePath << " failed"; + string line; + vector tmp; + vector tmp2; + //Load startProb + XCHECK(GetLine(ifile, line)); + Split(line, tmp, " "); + XCHECK(tmp.size() == STATUS_SUM); + for(size_t j = 0; j < tmp.size(); j++) { + startProb[j] = atof(tmp[j].c_str()); + } - //Load emitProbB - XCHECK(GetLine(ifile, line)); - XCHECK(LoadEmitProb(line, emitProbB)); + //Load transProb + for(size_t i = 0; i < STATUS_SUM; i++) { + XCHECK(GetLine(ifile, line)); + Split(line, tmp, " "); + XCHECK(tmp.size() == STATUS_SUM); + for(size_t j = 0; j < STATUS_SUM; j++) { + transProb[i][j] = atof(tmp[j].c_str()); + } + } - //Load emitProbE - XCHECK(GetLine(ifile, line)); - XCHECK(LoadEmitProb(line, emitProbE)); + //Load emitProbB + XCHECK(GetLine(ifile, line)); + XCHECK(LoadEmitProb(line, emitProbB)); - //Load emitProbM - XCHECK(GetLine(ifile, line)); - XCHECK(LoadEmitProb(line, emitProbM)); + //Load emitProbE + XCHECK(GetLine(ifile, line)); + XCHECK(LoadEmitProb(line, emitProbE)); - //Load emitProbS - XCHECK(GetLine(ifile, line)); - XCHECK(LoadEmitProb(line, emitProbS)); - } - double GetEmitProb(const EmitProbMap* ptMp, Rune key, - double defVal)const { - EmitProbMap::const_iterator cit = ptMp->find(key); - if (cit == ptMp->end()) { - return defVal; + //Load emitProbM + XCHECK(GetLine(ifile, line)); + XCHECK(LoadEmitProb(line, emitProbM)); + + //Load emitProbS + XCHECK(GetLine(ifile, line)); + XCHECK(LoadEmitProb(line, emitProbS)); } - return cit->second; - } - bool GetLine(ifstream& ifile, string& line) { - while (getline(ifile, line)) { - Trim(line); - if (line.empty()) { - continue; - } - if (StartsWith(line, "#")) { - continue; - } - return true; + double GetEmitProb(const EmitProbMap* ptMp, Rune key, + double defVal)const { + EmitProbMap::const_iterator cit = ptMp->find(key); + if(cit == ptMp->end()) { + return defVal; + } + return cit->second; } - return false; - } - bool LoadEmitProb(const string& line, EmitProbMap& mp) { - if (line.empty()) { - return false; - } - vector tmp, tmp2; - Unicode unicode; - Split(line, tmp, ","); - for (size_t i = 0; i < tmp.size(); i++) { - Split(tmp[i], tmp2, ":"); - if (2 != tmp2.size()) { - XLOG(ERROR) << "emitProb illegal."; + bool GetLine(ifstream& ifile, string& line) { + while(getline(ifile, line)) { + Trim(line); + if(line.empty()) { + continue; + } + if(StartsWith(line, "#")) { + continue; + } + return true; + } return false; - } - if (!DecodeRunesInString(tmp2[0], unicode) || unicode.size() != 1) { - XLOG(ERROR) << "TransCode failed."; - return false; - } - mp[unicode[0]] = atof(tmp2[1].c_str()); } - return true; - } + bool LoadEmitProb(const string& line, EmitProbMap& mp) { + if(line.empty()) { + return false; + } + vector tmp, tmp2; + Unicode unicode; + Split(line, tmp, ","); + for(size_t i = 0; i < tmp.size(); i++) { + Split(tmp[i], tmp2, ":"); + if(2 != tmp2.size()) { + XLOG(ERROR) << "emitProb illegal."; + return false; + } + if(!DecodeRunesInString(tmp2[0], unicode) || unicode.size() != 1) { + XLOG(ERROR) << "TransCode failed."; + return false; + } + mp[unicode[0]] = atof(tmp2[1].c_str()); + } + return true; + } - char statMap[STATUS_SUM]; - double startProb[STATUS_SUM]; - double transProb[STATUS_SUM][STATUS_SUM]; - EmitProbMap emitProbB; - EmitProbMap emitProbE; - EmitProbMap emitProbM; - EmitProbMap emitProbS; - vector emitProbVec; + char statMap[STATUS_SUM]; + double startProb[STATUS_SUM]; + double transProb[STATUS_SUM][STATUS_SUM]; + EmitProbMap emitProbB; + EmitProbMap emitProbE; + EmitProbMap emitProbM; + EmitProbMap emitProbS; + vector emitProbVec; }; // struct HMMModel } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/HMMSegment.hpp b/libchinese-segmentation/cppjieba/HMMSegment.hpp index cb95230..8168ac3 100644 --- a/libchinese-segmentation/cppjieba/HMMSegment.hpp +++ b/libchinese-segmentation/cppjieba/HMMSegment.hpp @@ -28,179 +28,179 @@ namespace cppjieba { class HMMSegment: public SegmentBase { - public: - HMMSegment(const string& filePath) - : model_(new HMMModel(filePath)), isNeedDestroy_(true) { - } - HMMSegment(const HMMModel* model) - : model_(model), isNeedDestroy_(false) { - } - ~HMMSegment() { - if (isNeedDestroy_) { - delete model_; +public: + HMMSegment(const string& filePath) + : model_(new HMMModel(filePath)), isNeedDestroy_(true) { } - } - - void Cut(const string& sentence, - vector& words) const { - vector tmp; - Cut(sentence, tmp); - GetStringsFromWords(tmp, words); - } - void Cut(const string& sentence, - vector& words) const { - PreFilter pre_filter(symbols_, sentence); - PreFilter::Range range; - vector wrs; - wrs.reserve(sentence.size()/2); - while (pre_filter.HasNext()) { - range = pre_filter.Next(); - Cut(range.begin, range.end, wrs); + HMMSegment(const HMMModel* model) + : model_(model), isNeedDestroy_(false) { } - words.clear(); - words.reserve(wrs.size()); - GetWordsFromWordRanges(sentence, wrs, words); - } - void Cut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res) const { - RuneStrArray::const_iterator left = begin; - RuneStrArray::const_iterator right = begin; - while (right != end) { - if (right->rune < 0x80) { - if (left != right) { - InternalCut(left, right, res); + ~HMMSegment() { + if(isNeedDestroy_) { + delete model_; } - left = right; - do { - right = SequentialLetterRule(left, end); - if (right != left) { - break; - } - right = NumbersRule(left, end); - if (right != left) { - break; - } - right ++; - } while (false); - WordRange wr(left, right - 1); - res.push_back(wr); - left = right; - } else { - right++; - } - } - if (left != right) { - InternalCut(left, right, res); - } - } - private: - // sequential letters rule - RuneStrArray::const_iterator SequentialLetterRule(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { - Rune x = begin->rune; - if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z')) { - begin ++; - } else { - return begin; - } - while (begin != end) { - x = begin->rune; - if (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9')) { - begin ++; - } else { - break; - } - } - return begin; - } - // - RuneStrArray::const_iterator NumbersRule(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { - Rune x = begin->rune; - if ('0' <= x && x <= '9') { - begin ++; - } else { - return begin; - } - while (begin != end) { - x = begin->rune; - if ( ('0' <= x && x <= '9') || x == '.') { - begin++; - } else { - break; - } - } - return begin; - } - void InternalCut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res) const { - vector status; - Viterbi(begin, end, status); - - RuneStrArray::const_iterator left = begin; - RuneStrArray::const_iterator right; - for (size_t i = 0; i < status.size(); i++) { - if (status[i] % 2) { //if (HMMModel::E == status[i] || HMMModel::S == status[i]) - right = begin + i + 1; - WordRange wr(left, right - 1); - res.push_back(wr); - left = right; - } - } - } - - void Viterbi(RuneStrArray::const_iterator begin, - RuneStrArray::const_iterator end, - vector& status) const { - size_t Y = HMMModel::STATUS_SUM; - size_t X = end - begin; - - size_t XYSize = X * Y; - size_t now, old, stat; - double tmp, endE, endS; - - vector path(XYSize); - vector weight(XYSize); - - //start - for (size_t y = 0; y < Y; y++) { - weight[0 + y * X] = model_->startProb[y] + model_->GetEmitProb(model_->emitProbVec[y], begin->rune, MIN_DOUBLE); - path[0 + y * X] = -1; } - double emitProb; - - for (size_t x = 1; x < X; x++) { - for (size_t y = 0; y < Y; y++) { - now = x + y*X; - weight[now] = MIN_DOUBLE; - path[now] = HMMModel::E; // warning - emitProb = model_->GetEmitProb(model_->emitProbVec[y], (begin+x)->rune, MIN_DOUBLE); - for (size_t preY = 0; preY < Y; preY++) { - old = x - 1 + preY * X; - tmp = weight[old] + model_->transProb[preY][y] + emitProb; - if (tmp > weight[now]) { - weight[now] = tmp; - path[now] = preY; - } + void Cut(const string& sentence, + vector& words) const { + vector tmp; + Cut(sentence, tmp); + GetStringsFromWords(tmp, words); + } + void Cut(const string& sentence, + vector& words) const { + PreFilter pre_filter(symbols_, sentence); + PreFilter::Range range; + vector wrs; + wrs.reserve(sentence.size() / 2); + while(pre_filter.HasNext()) { + range = pre_filter.Next(); + Cut(range.begin, range.end, wrs); + } + words.clear(); + words.reserve(wrs.size()); + GetWordsFromWordRanges(sentence, wrs, words); + } + void Cut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res) const { + RuneStrArray::const_iterator left = begin; + RuneStrArray::const_iterator right = begin; + while(right != end) { + if(right->rune < 0x80) { + if(left != right) { + InternalCut(left, right, res); + } + left = right; + do { + right = SequentialLetterRule(left, end); + if(right != left) { + break; + } + right = NumbersRule(left, end); + if(right != left) { + break; + } + right ++; + } while(false); + WordRange wr(left, right - 1); + res.push_back(wr); + left = right; + } else { + right++; + } + } + if(left != right) { + InternalCut(left, right, res); + } + } +private: + // sequential letters rule + RuneStrArray::const_iterator SequentialLetterRule(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { + Rune x = begin->rune; + if(('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z')) { + begin ++; + } else { + return begin; + } + while(begin != end) { + x = begin->rune; + if(('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z') || ('0' <= x && x <= '9')) { + begin ++; + } else { + break; + } + } + return begin; + } + // + RuneStrArray::const_iterator NumbersRule(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { + Rune x = begin->rune; + if('0' <= x && x <= '9') { + begin ++; + } else { + return begin; + } + while(begin != end) { + x = begin->rune; + if(('0' <= x && x <= '9') || x == '.') { + begin++; + } else { + break; + } + } + return begin; + } + void InternalCut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res) const { + vector status; + Viterbi(begin, end, status); + + RuneStrArray::const_iterator left = begin; + RuneStrArray::const_iterator right; + for(size_t i = 0; i < status.size(); i++) { + if(status[i] % 2) { //if (HMMModel::E == status[i] || HMMModel::S == status[i]) + right = begin + i + 1; + WordRange wr(left, right - 1); + res.push_back(wr); + left = right; + } } - } } - endE = weight[X-1+HMMModel::E*X]; - endS = weight[X-1+HMMModel::S*X]; - stat = 0; - if (endE >= endS) { - stat = HMMModel::E; - } else { - stat = HMMModel::S; + void Viterbi(RuneStrArray::const_iterator begin, + RuneStrArray::const_iterator end, + vector& status) const { + size_t Y = HMMModel::STATUS_SUM; + size_t X = end - begin; + + size_t XYSize = X * Y; + size_t now, old, stat; + double tmp, endE, endS; + + vector path(XYSize); + vector weight(XYSize); + + //start + for(size_t y = 0; y < Y; y++) { + weight[0 + y * X] = model_->startProb[y] + model_->GetEmitProb(model_->emitProbVec[y], begin->rune, MIN_DOUBLE); + path[0 + y * X] = -1; + } + + double emitProb; + + for(size_t x = 1; x < X; x++) { + for(size_t y = 0; y < Y; y++) { + now = x + y * X; + weight[now] = MIN_DOUBLE; + path[now] = HMMModel::E; // warning + emitProb = model_->GetEmitProb(model_->emitProbVec[y], (begin + x)->rune, MIN_DOUBLE); + for(size_t preY = 0; preY < Y; preY++) { + old = x - 1 + preY * X; + tmp = weight[old] + model_->transProb[preY][y] + emitProb; + if(tmp > weight[now]) { + weight[now] = tmp; + path[now] = preY; + } + } + } + } + + endE = weight[X - 1 + HMMModel::E * X]; + endS = weight[X - 1 + HMMModel::S * X]; + stat = 0; + if(endE >= endS) { + stat = HMMModel::E; + } else { + stat = HMMModel::S; + } + + status.resize(X); + for(int x = X - 1 ; x >= 0; x--) { + status[x] = stat; + stat = path[x + stat * X]; + } } - status.resize(X); - for (int x = X -1 ; x >= 0; x--) { - status[x] = stat; - stat = path[x + stat*X]; - } - } - - const HMMModel* model_; - bool isNeedDestroy_; + const HMMModel* model_; + bool isNeedDestroy_; }; // class HMMSegment } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/Jieba.hpp b/libchinese-segmentation/cppjieba/Jieba.hpp index b0ac87c..bc93b17 100644 --- a/libchinese-segmentation/cppjieba/Jieba.hpp +++ b/libchinese-segmentation/cppjieba/Jieba.hpp @@ -25,123 +25,122 @@ namespace cppjieba { class Jieba { - public: - Jieba(const string& dict_path, - const string& model_path, - const string& user_dict_path, - const string& idfPath, - const string& stopWordPath) - : dict_trie_(dict_path, user_dict_path), - model_(model_path), - mp_seg_(&dict_trie_), - hmm_seg_(&model_), - mix_seg_(&dict_trie_, &model_), - full_seg_(&dict_trie_), - query_seg_(&dict_trie_, &model_), - extractor(&dict_trie_, &model_, idfPath, stopWordPath) { +public: + Jieba(const string& dict_path, + const string& model_path, + const string& user_dict_path, + const string& idfPath, + const string& stopWordPath) + : dict_trie_(dict_path, user_dict_path), + model_(model_path), + mp_seg_(&dict_trie_), + hmm_seg_(&model_), + mix_seg_(&dict_trie_, &model_), + full_seg_(&dict_trie_), + query_seg_(&dict_trie_, &model_), + extractor(&dict_trie_, &model_, idfPath, stopWordPath) { - } - ~Jieba() { - } + } + ~Jieba() { + } - struct LocWord { - string word; - size_t begin; - size_t end; - }; // struct LocWord + struct LocWord { + string word; + size_t begin; + size_t end; + }; // struct LocWord - void Cut(const string& sentence, vector& words, bool hmm = true) const { - mix_seg_.Cut(sentence, words, hmm); - } - void Cut(const string& sentence, vector& words, bool hmm = true) const { - mix_seg_.Cut(sentence, words, hmm); - } - void CutAll(const string& sentence, vector& words) const { - full_seg_.Cut(sentence, words); - } - void CutAll(const string& sentence, vector& words) const { - full_seg_.Cut(sentence, words); - } - void CutForSearch(const string& sentence, vector& words, bool hmm = true) const { - query_seg_.Cut(sentence, words, hmm); - } - void CutForSearch(const string& sentence, vector& words, bool hmm = true) const { - query_seg_.Cut(sentence, words, hmm); - } - void CutHMM(const string& sentence, vector& words) const { - hmm_seg_.Cut(sentence, words); - } - void CutHMM(const string& sentence, vector& words) const { - hmm_seg_.Cut(sentence, words); - } - void CutSmall(const string& sentence, vector& words, size_t max_word_len) const { - mp_seg_.Cut(sentence, words, max_word_len); - } - void CutSmall(const string& sentence, vector& words, size_t max_word_len) const { - mp_seg_.Cut(sentence, words, max_word_len); - } - - void Tag(const string& sentence, vector >& words) const { - mix_seg_.Tag(sentence, words); - } - string LookupTag(const string &str) const { - return mix_seg_.LookupTag(str); - } - bool InsertUserWord(const string& word, const string& tag = UNKNOWN_TAG) { - return dict_trie_.InsertUserWord(word, tag); - } + void Cut(const string& sentence, vector& words, bool hmm = true) const { + mix_seg_.Cut(sentence, words, hmm); + } + void Cut(const string& sentence, vector& words, bool hmm = true) const { + mix_seg_.Cut(sentence, words, hmm); + } + void CutAll(const string& sentence, vector& words) const { + full_seg_.Cut(sentence, words); + } + void CutAll(const string& sentence, vector& words) const { + full_seg_.Cut(sentence, words); + } + void CutForSearch(const string& sentence, vector& words, bool hmm = true) const { + query_seg_.Cut(sentence, words, hmm); + } + void CutForSearch(const string& sentence, vector& words, bool hmm = true) const { + query_seg_.Cut(sentence, words, hmm); + } + void CutHMM(const string& sentence, vector& words) const { + hmm_seg_.Cut(sentence, words); + } + void CutHMM(const string& sentence, vector& words) const { + hmm_seg_.Cut(sentence, words); + } + void CutSmall(const string& sentence, vector& words, size_t max_word_len) const { + mp_seg_.Cut(sentence, words, max_word_len); + } + void CutSmall(const string& sentence, vector& words, size_t max_word_len) const { + mp_seg_.Cut(sentence, words, max_word_len); + } - bool InsertUserWord(const string& word,int freq, const string& tag = UNKNOWN_TAG) { - return dict_trie_.InsertUserWord(word,freq, tag); - } + void Tag(const string& sentence, vector >& words) const { + mix_seg_.Tag(sentence, words); + } + string LookupTag(const string &str) const { + return mix_seg_.LookupTag(str); + } + bool InsertUserWord(const string& word, const string& tag = UNKNOWN_TAG) { + return dict_trie_.InsertUserWord(word, tag); + } - bool Find(const string& word) - { - return dict_trie_.Find(word); - } + bool InsertUserWord(const string& word, int freq, const string& tag = UNKNOWN_TAG) { + return dict_trie_.InsertUserWord(word, freq, tag); + } - void ResetSeparators(const string& s) { - //TODO - mp_seg_.ResetSeparators(s); - hmm_seg_.ResetSeparators(s); - mix_seg_.ResetSeparators(s); - full_seg_.ResetSeparators(s); - query_seg_.ResetSeparators(s); - } + bool Find(const string& word) { + return dict_trie_.Find(word); + } - const DictTrie* GetDictTrie() const { - return &dict_trie_; - } - - const HMMModel* GetHMMModel() const { - return &model_; - } + void ResetSeparators(const string& s) { + //TODO + mp_seg_.ResetSeparators(s); + hmm_seg_.ResetSeparators(s); + mix_seg_.ResetSeparators(s); + full_seg_.ResetSeparators(s); + query_seg_.ResetSeparators(s); + } - void LoadUserDict(const vector& buf) { - dict_trie_.LoadUserDict(buf); - } + const DictTrie* GetDictTrie() const { + return &dict_trie_; + } - void LoadUserDict(const set& buf) { - dict_trie_.LoadUserDict(buf); - } + const HMMModel* GetHMMModel() const { + return &model_; + } - void LoadUserDict(const string& path) { - dict_trie_.LoadUserDict(path); - } + void LoadUserDict(const vector& buf) { + dict_trie_.LoadUserDict(buf); + } - private: - DictTrie dict_trie_; - HMMModel model_; - - // They share the same dict trie and model - MPSegment mp_seg_; - HMMSegment hmm_seg_; - MixSegment mix_seg_; - FullSegment full_seg_; - QuerySegment query_seg_; + void LoadUserDict(const set& buf) { + dict_trie_.LoadUserDict(buf); + } - public: - KeywordExtractor extractor; + void LoadUserDict(const string& path) { + dict_trie_.LoadUserDict(path); + } + +private: + DictTrie dict_trie_; + HMMModel model_; + + // They share the same dict trie and model + MPSegment mp_seg_; + HMMSegment hmm_seg_; + MixSegment mix_seg_; + FullSegment full_seg_; + QuerySegment query_seg_; + +public: + KeywordExtractor extractor; }; // class Jieba } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/KeywordExtractor.hpp b/libchinese-segmentation/cppjieba/KeywordExtractor.hpp index 291f3b8..a8b3600 100644 --- a/libchinese-segmentation/cppjieba/KeywordExtractor.hpp +++ b/libchinese-segmentation/cppjieba/KeywordExtractor.hpp @@ -30,138 +30,138 @@ using namespace std; /*utf8*/ class KeywordExtractor { - public: - struct Word { - string word; - vector offsets; - double weight; - }; // struct Word +public: + struct Word { + string word; + vector offsets; + double weight; + }; // struct Word - KeywordExtractor(const string& dictPath, - const string& hmmFilePath, - const string& idfPath, - const string& stopWordPath, - const string& userDict = "") - : segment_(dictPath, hmmFilePath, userDict) { - LoadIdfDict(idfPath); - LoadStopWordDict(stopWordPath); - } - KeywordExtractor(const DictTrie* dictTrie, - const HMMModel* model, - const string& idfPath, - const string& stopWordPath) - : segment_(dictTrie, model) { - LoadIdfDict(idfPath); - LoadStopWordDict(stopWordPath); - } - ~KeywordExtractor() { - } - - void Extract(const string& sentence, vector& keywords, size_t topN) const { - vector topWords; - Extract(sentence, topWords, topN); - for (size_t i = 0; i < topWords.size(); i++) { - keywords.push_back(topWords[i].word); + KeywordExtractor(const string& dictPath, + const string& hmmFilePath, + const string& idfPath, + const string& stopWordPath, + const string& userDict = "") + : segment_(dictPath, hmmFilePath, userDict) { + LoadIdfDict(idfPath); + LoadStopWordDict(stopWordPath); } - } - - void Extract(const string& sentence, vector >& keywords, size_t topN) const { - vector topWords; - Extract(sentence, topWords, topN); - for (size_t i = 0; i < topWords.size(); i++) { - keywords.push_back(pair(topWords[i].word, topWords[i].weight)); + KeywordExtractor(const DictTrie* dictTrie, + const HMMModel* model, + const string& idfPath, + const string& stopWordPath) + : segment_(dictTrie, model) { + LoadIdfDict(idfPath); + LoadStopWordDict(stopWordPath); } - } - - void Extract(const string& sentence, vector& keywords, size_t topN) const { - vector words; - segment_.Cut(sentence, words); - - map wordmap; - size_t offset = 0; - for (size_t i = 0; i < words.size(); ++i) { - size_t t = offset; - offset += words[i].size(); - if (IsSingleWord(words[i]) || stopWords_.find(words[i]) != stopWords_.end()) { - continue; - } - wordmap[words[i]].offsets.push_back(t); - wordmap[words[i]].weight += 1.0; - } - if (offset != sentence.size()) { - XLOG(ERROR) << "words illegal"; - return; + ~KeywordExtractor() { } - keywords.clear(); - keywords.reserve(wordmap.size()); - for (map::iterator itr = wordmap.begin(); itr != wordmap.end(); ++itr) { - unordered_map::const_iterator cit = idfMap_.find(itr->first); - if (cit != idfMap_.end()) { - itr->second.weight *= cit->second; - } else { - itr->second.weight *= idfAverage_; - } - itr->second.word = itr->first; - keywords.push_back(itr->second); - } - topN = min(topN, keywords.size()); - partial_sort(keywords.begin(), keywords.begin() + topN, keywords.end(), Compare); - keywords.resize(topN); - } - private: - void LoadIdfDict(const string& idfPath) { - ifstream ifs(idfPath.c_str()); - XCHECK(ifs.is_open()) << "open " << idfPath << " failed"; - string line ; - vector buf; - double idf = 0.0; - double idfSum = 0.0; - size_t lineno = 0; - for (; getline(ifs, line); lineno++) { - buf.clear(); - if (line.empty()) { - XLOG(ERROR) << "lineno: " << lineno << " empty. skipped."; - continue; - } - Split(line, buf, " "); - if (buf.size() != 2) { - XLOG(ERROR) << "line: " << line << ", lineno: " << lineno << " empty. skipped."; - continue; - } - idf = atof(buf[1].c_str()); - idfMap_[buf[0]] = idf; - idfSum += idf; - + void Extract(const string& sentence, vector& keywords, size_t topN) const { + vector topWords; + Extract(sentence, topWords, topN); + for(size_t i = 0; i < topWords.size(); i++) { + keywords.push_back(topWords[i].word); + } } - assert(lineno); - idfAverage_ = idfSum / lineno; - assert(idfAverage_ > 0.0); - } - void LoadStopWordDict(const string& filePath) { - ifstream ifs(filePath.c_str()); - XCHECK(ifs.is_open()) << "open " << filePath << " failed"; - string line ; - while (getline(ifs, line)) { - stopWords_.insert(line); + void Extract(const string& sentence, vector >& keywords, size_t topN) const { + vector topWords; + Extract(sentence, topWords, topN); + for(size_t i = 0; i < topWords.size(); i++) { + keywords.push_back(pair(topWords[i].word, topWords[i].weight)); + } } - assert(stopWords_.size()); - } - static bool Compare(const Word& lhs, const Word& rhs) { - return lhs.weight > rhs.weight; - } + void Extract(const string& sentence, vector& keywords, size_t topN) const { + vector words; + segment_.Cut(sentence, words); - MixSegment segment_; - unordered_map idfMap_; - double idfAverage_; + map wordmap; + size_t offset = 0; + for(size_t i = 0; i < words.size(); ++i) { + size_t t = offset; + offset += words[i].size(); + if(IsSingleWord(words[i]) || stopWords_.find(words[i]) != stopWords_.end()) { + continue; + } + wordmap[words[i]].offsets.push_back(t); + wordmap[words[i]].weight += 1.0; + } + if(offset != sentence.size()) { + XLOG(ERROR) << "words illegal"; + return; + } - unordered_set stopWords_; + keywords.clear(); + keywords.reserve(wordmap.size()); + for(map::iterator itr = wordmap.begin(); itr != wordmap.end(); ++itr) { + unordered_map::const_iterator cit = idfMap_.find(itr->first); + if(cit != idfMap_.end()) { + itr->second.weight *= cit->second; + } else { + itr->second.weight *= idfAverage_; + } + itr->second.word = itr->first; + keywords.push_back(itr->second); + } + topN = min(topN, keywords.size()); + partial_sort(keywords.begin(), keywords.begin() + topN, keywords.end(), Compare); + keywords.resize(topN); + } +private: + void LoadIdfDict(const string& idfPath) { + ifstream ifs(idfPath.c_str()); + XCHECK(ifs.is_open()) << "open " << idfPath << " failed"; + string line ; + vector buf; + double idf = 0.0; + double idfSum = 0.0; + size_t lineno = 0; + for(; getline(ifs, line); lineno++) { + buf.clear(); + if(line.empty()) { + XLOG(ERROR) << "lineno: " << lineno << " empty. skipped."; + continue; + } + Split(line, buf, " "); + if(buf.size() != 2) { + XLOG(ERROR) << "line: " << line << ", lineno: " << lineno << " empty. skipped."; + continue; + } + idf = atof(buf[1].c_str()); + idfMap_[buf[0]] = idf; + idfSum += idf; + + } + + assert(lineno); + idfAverage_ = idfSum / lineno; + assert(idfAverage_ > 0.0); + } + void LoadStopWordDict(const string& filePath) { + ifstream ifs(filePath.c_str()); + XCHECK(ifs.is_open()) << "open " << filePath << " failed"; + string line ; + while(getline(ifs, line)) { + stopWords_.insert(line); + } + assert(stopWords_.size()); + } + + static bool Compare(const Word& lhs, const Word& rhs) { + return lhs.weight > rhs.weight; + } + + MixSegment segment_; + unordered_map idfMap_; + double idfAverage_; + + unordered_set stopWords_; }; // class KeywordExtractor inline ostream& operator << (ostream& os, const KeywordExtractor::Word& word) { - return os << "{\"word\": \"" << word.word << "\", \"offset\": " << word.offsets << ", \"weight\": " << word.weight << "}"; + return os << "{\"word\": \"" << word.word << "\", \"offset\": " << word.offsets << ", \"weight\": " << word.weight << "}"; } } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/MPSegment.hpp b/libchinese-segmentation/cppjieba/MPSegment.hpp index fe42bea..76744a8 100644 --- a/libchinese-segmentation/cppjieba/MPSegment.hpp +++ b/libchinese-segmentation/cppjieba/MPSegment.hpp @@ -30,123 +30,123 @@ namespace cppjieba { class MPSegment: public SegmentTagged { - public: - MPSegment(const string& dictPath, const string& userDictPath = "") - : dictTrie_(new DictTrie(dictPath, userDictPath)), isNeedDestroy_(true) { - } - MPSegment(const DictTrie* dictTrie) - : dictTrie_(dictTrie), isNeedDestroy_(false) { - assert(dictTrie_); - } - ~MPSegment() { - if (isNeedDestroy_) { - delete dictTrie_; +public: + MPSegment(const string& dictPath, const string& userDictPath = "") + : dictTrie_(new DictTrie(dictPath, userDictPath)), isNeedDestroy_(true) { } - } - - void Cut(const string& sentence, vector& words) const { - Cut(sentence, words, MAX_WORD_LENGTH); - } - - void Cut(const string& sentence, - vector& words, - size_t max_word_len) const { - vector tmp; - Cut(sentence, tmp, max_word_len); - GetStringsFromWords(tmp, words); - } - void Cut(const string& sentence, - vector& words, - size_t max_word_len = MAX_WORD_LENGTH) const { - PreFilter pre_filter(symbols_, sentence); - PreFilter::Range range; - vector wrs; - wrs.reserve(sentence.size()/2); - while (pre_filter.HasNext()) { - range = pre_filter.Next(); - Cut(range.begin, range.end, wrs, max_word_len); + MPSegment(const DictTrie* dictTrie) + : dictTrie_(dictTrie), isNeedDestroy_(false) { + assert(dictTrie_); } - words.clear(); - words.reserve(wrs.size()); - GetWordsFromWordRanges(sentence, wrs, words); - } - void Cut(RuneStrArray::const_iterator begin, - RuneStrArray::const_iterator end, - vector& words, - size_t max_word_len = MAX_WORD_LENGTH) const { - vector dags; - dictTrie_->Find(begin, - end, - dags, - max_word_len); - CalcDP(dags); - CutByDag(begin, end, dags, words); - } - - const DictTrie* GetDictTrie() const { - return dictTrie_; - } - - bool Tag(const string& src, vector >& res) const { - return tagger_.Tag(src, res, *this); - } - - bool IsUserDictSingleChineseWord(const Rune& value) const { - return dictTrie_->IsUserDictSingleChineseWord(value); - } - private: - void CalcDP(vector& dags) const { - size_t nextPos; - const DictUnit* p; - double val; - - for (vector::reverse_iterator rit = dags.rbegin(); rit != dags.rend(); rit++) { - rit->pInfo = NULL; - rit->weight = MIN_DOUBLE; - assert(!rit->nexts.empty()); - for (LocalVector >::const_iterator it = rit->nexts.begin(); it != rit->nexts.end(); it++) { - nextPos = it->first; - p = it->second; - val = 0.0; - if (nextPos + 1 < dags.size()) { - val += dags[nextPos + 1].weight; + ~MPSegment() { + if(isNeedDestroy_) { + delete dictTrie_; } - - if (p) { - val += p->weight; - } else { - val += dictTrie_->GetMinWeight(); - } - if (val > rit->weight) { - rit->pInfo = p; - rit->weight = val; - } - } } - } - void CutByDag(RuneStrArray::const_iterator begin, - RuneStrArray::const_iterator end, - const vector& dags, - vector& words) const { - size_t i = 0; - while (i < dags.size()) { - const DictUnit* p = dags[i].pInfo; - if (p) { - assert(p->word.size() >= 1); - WordRange wr(begin + i, begin + i + p->word.size() - 1); - words.push_back(wr); - i += p->word.size(); - } else { //single chinese word - WordRange wr(begin + i, begin + i); - words.push_back(wr); - i++; - } - } - } - const DictTrie* dictTrie_; - bool isNeedDestroy_; - PosTagger tagger_; + void Cut(const string& sentence, vector& words) const { + Cut(sentence, words, MAX_WORD_LENGTH); + } + + void Cut(const string& sentence, + vector& words, + size_t max_word_len) const { + vector tmp; + Cut(sentence, tmp, max_word_len); + GetStringsFromWords(tmp, words); + } + void Cut(const string& sentence, + vector& words, + size_t max_word_len = MAX_WORD_LENGTH) const { + PreFilter pre_filter(symbols_, sentence); + PreFilter::Range range; + vector wrs; + wrs.reserve(sentence.size() / 2); + while(pre_filter.HasNext()) { + range = pre_filter.Next(); + Cut(range.begin, range.end, wrs, max_word_len); + } + words.clear(); + words.reserve(wrs.size()); + GetWordsFromWordRanges(sentence, wrs, words); + } + void Cut(RuneStrArray::const_iterator begin, + RuneStrArray::const_iterator end, + vector& words, + size_t max_word_len = MAX_WORD_LENGTH) const { + vector dags; + dictTrie_->Find(begin, + end, + dags, + max_word_len); + CalcDP(dags); + CutByDag(begin, end, dags, words); + } + + const DictTrie* GetDictTrie() const { + return dictTrie_; + } + + bool Tag(const string& src, vector >& res) const { + return tagger_.Tag(src, res, *this); + } + + bool IsUserDictSingleChineseWord(const Rune& value) const { + return dictTrie_->IsUserDictSingleChineseWord(value); + } +private: + void CalcDP(vector& dags) const { + size_t nextPos; + const DictUnit* p; + double val; + + for(vector::reverse_iterator rit = dags.rbegin(); rit != dags.rend(); rit++) { + rit->pInfo = NULL; + rit->weight = MIN_DOUBLE; + assert(!rit->nexts.empty()); + for(LocalVector >::const_iterator it = rit->nexts.begin(); it != rit->nexts.end(); it++) { + nextPos = it->first; + p = it->second; + val = 0.0; + if(nextPos + 1 < dags.size()) { + val += dags[nextPos + 1].weight; + } + + if(p) { + val += p->weight; + } else { + val += dictTrie_->GetMinWeight(); + } + if(val > rit->weight) { + rit->pInfo = p; + rit->weight = val; + } + } + } + } + void CutByDag(RuneStrArray::const_iterator begin, + RuneStrArray::const_iterator end, + const vector& dags, + vector& words) const { + size_t i = 0; + while(i < dags.size()) { + const DictUnit* p = dags[i].pInfo; + if(p) { + assert(p->word.size() >= 1); + WordRange wr(begin + i, begin + i + p->word.size() - 1); + words.push_back(wr); + i += p->word.size(); + } else { //single chinese word + WordRange wr(begin + i, begin + i); + words.push_back(wr); + i++; + } + } + } + + const DictTrie* dictTrie_; + bool isNeedDestroy_; + PosTagger tagger_; }; // class MPSegment diff --git a/libchinese-segmentation/cppjieba/MixSegment.hpp b/libchinese-segmentation/cppjieba/MixSegment.hpp index 9357a66..b96309d 100644 --- a/libchinese-segmentation/cppjieba/MixSegment.hpp +++ b/libchinese-segmentation/cppjieba/MixSegment.hpp @@ -27,98 +27,98 @@ namespace cppjieba { class MixSegment: public SegmentTagged { - public: - MixSegment(const string& mpSegDict, const string& hmmSegDict, - const string& userDict = "") - : mpSeg_(mpSegDict, userDict), - hmmSeg_(hmmSegDict) { - } - MixSegment(const DictTrie* dictTrie, const HMMModel* model) - : mpSeg_(dictTrie), hmmSeg_(model) { - } - ~MixSegment() { - } - - void Cut(const string& sentence, vector& words) const { - Cut(sentence, words, true); - } - void Cut(const string& sentence, vector& words, bool hmm) const { - vector tmp; - Cut(sentence, tmp, hmm); - GetStringsFromWords(tmp, words); - } - void Cut(const string& sentence, vector& words, bool hmm = true) const { - PreFilter pre_filter(symbols_, sentence); - PreFilter::Range range; - vector wrs; - wrs.reserve(sentence.size() / 2); - while (pre_filter.HasNext()) { - range = pre_filter.Next(); - Cut(range.begin, range.end, wrs, hmm); +public: + MixSegment(const string& mpSegDict, const string& hmmSegDict, + const string& userDict = "") + : mpSeg_(mpSegDict, userDict), + hmmSeg_(hmmSegDict) { } - words.clear(); - words.reserve(wrs.size()); - GetWordsFromWordRanges(sentence, wrs, words); - } - - void Cut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res, bool hmm) const { - if (!hmm) { - mpSeg_.Cut(begin, end, res); - return; + MixSegment(const DictTrie* dictTrie, const HMMModel* model) + : mpSeg_(dictTrie), hmmSeg_(model) { } - vector words; - assert(end >= begin); - words.reserve(end - begin); - mpSeg_.Cut(begin, end, words); - - vector hmmRes; - hmmRes.reserve(end - begin); - for (size_t i = 0; i < words.size(); i++) { - //if mp Get a word, it's ok, put it into result - if (words[i].left != words[i].right || (words[i].left == words[i].right && mpSeg_.IsUserDictSingleChineseWord(words[i].left->rune))) { - res.push_back(words[i]); - continue; - } - - // if mp Get a single one and it is not in userdict, collect it in sequence - size_t j = i; - while (j < words.size() && words[j].left == words[j].right && !mpSeg_.IsUserDictSingleChineseWord(words[j].left->rune)) { - j++; - } - - // Cut the sequence with hmm - assert(j - 1 >= i); - // TODO - hmmSeg_.Cut(words[i].left, words[j - 1].left + 1, hmmRes); - //put hmm result to result - for (size_t k = 0; k < hmmRes.size(); k++) { - res.push_back(hmmRes[k]); - } - - //clear tmp vars - hmmRes.clear(); - - //let i jump over this piece - i = j - 1; + ~MixSegment() { } - } - const DictTrie* GetDictTrie() const { - return mpSeg_.GetDictTrie(); - } + void Cut(const string& sentence, vector& words) const { + Cut(sentence, words, true); + } + void Cut(const string& sentence, vector& words, bool hmm) const { + vector tmp; + Cut(sentence, tmp, hmm); + GetStringsFromWords(tmp, words); + } + void Cut(const string& sentence, vector& words, bool hmm = true) const { + PreFilter pre_filter(symbols_, sentence); + PreFilter::Range range; + vector wrs; + wrs.reserve(sentence.size() / 2); + while(pre_filter.HasNext()) { + range = pre_filter.Next(); + Cut(range.begin, range.end, wrs, hmm); + } + words.clear(); + words.reserve(wrs.size()); + GetWordsFromWordRanges(sentence, wrs, words); + } - bool Tag(const string& src, vector >& res) const { - return tagger_.Tag(src, res, *this); - } + void Cut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res, bool hmm) const { + if(!hmm) { + mpSeg_.Cut(begin, end, res); + return; + } + vector words; + assert(end >= begin); + words.reserve(end - begin); + mpSeg_.Cut(begin, end, words); - string LookupTag(const string &str) const { - return tagger_.LookupTag(str, *this); - } + vector hmmRes; + hmmRes.reserve(end - begin); + for(size_t i = 0; i < words.size(); i++) { + //if mp Get a word, it's ok, put it into result + if(words[i].left != words[i].right || (words[i].left == words[i].right && mpSeg_.IsUserDictSingleChineseWord(words[i].left->rune))) { + res.push_back(words[i]); + continue; + } - private: - MPSegment mpSeg_; - HMMSegment hmmSeg_; - PosTagger tagger_; + // if mp Get a single one and it is not in userdict, collect it in sequence + size_t j = i; + while(j < words.size() && words[j].left == words[j].right && !mpSeg_.IsUserDictSingleChineseWord(words[j].left->rune)) { + j++; + } + + // Cut the sequence with hmm + assert(j - 1 >= i); + // TODO + hmmSeg_.Cut(words[i].left, words[j - 1].left + 1, hmmRes); + //put hmm result to result + for(size_t k = 0; k < hmmRes.size(); k++) { + res.push_back(hmmRes[k]); + } + + //clear tmp vars + hmmRes.clear(); + + //let i jump over this piece + i = j - 1; + } + } + + const DictTrie* GetDictTrie() const { + return mpSeg_.GetDictTrie(); + } + + bool Tag(const string& src, vector >& res) const { + return tagger_.Tag(src, res, *this); + } + + string LookupTag(const string &str) const { + return tagger_.LookupTag(str, *this); + } + +private: + MPSegment mpSeg_; + HMMSegment hmmSeg_; + PosTagger tagger_; }; // class MixSegment diff --git a/libchinese-segmentation/cppjieba/PosTagger.hpp b/libchinese-segmentation/cppjieba/PosTagger.hpp index 38d512f..aae39ba 100644 --- a/libchinese-segmentation/cppjieba/PosTagger.hpp +++ b/libchinese-segmentation/cppjieba/PosTagger.hpp @@ -31,62 +31,62 @@ static const char* const POS_ENG = "eng"; static const char* const POS_X = "x"; class PosTagger { - public: - PosTagger() { - } - ~PosTagger() { - } - - bool Tag(const string& src, vector >& res, const SegmentTagged& segment) const { - vector CutRes; - segment.Cut(src, CutRes); - - for (vector::iterator itr = CutRes.begin(); itr != CutRes.end(); ++itr) { - res.push_back(make_pair(*itr, LookupTag(*itr, segment))); +public: + PosTagger() { + } + ~PosTagger() { } - return !res.empty(); - } - string LookupTag(const string &str, const SegmentTagged& segment) const { - const DictUnit *tmp = NULL; - RuneStrArray runes; - const DictTrie * dict = segment.GetDictTrie(); - assert(dict != NULL); - if (!DecodeRunesInString(str, runes)) { - XLOG(ERROR) << "Decode failed."; - return POS_X; - } - tmp = dict->Find(runes.begin(), runes.end()); - if (tmp == NULL || tmp->tag.empty()) { - return SpecialRule(runes); - } else { - return tmp->tag; - } - } + bool Tag(const string& src, vector >& res, const SegmentTagged& segment) const { + vector CutRes; + segment.Cut(src, CutRes); - private: - const char* SpecialRule(const RuneStrArray& unicode) const { - size_t m = 0; - size_t eng = 0; - for (size_t i = 0; i < unicode.size() && eng < unicode.size() / 2; i++) { - if (unicode[i].rune < 0x80) { - eng ++; - if ('0' <= unicode[i].rune && unicode[i].rune <= '9') { - m++; + for(vector::iterator itr = CutRes.begin(); itr != CutRes.end(); ++itr) { + res.push_back(make_pair(*itr, LookupTag(*itr, segment))); } - } + return !res.empty(); } - // ascii char is not found - if (eng == 0) { - return POS_X; + + string LookupTag(const string &str, const SegmentTagged& segment) const { + const DictUnit *tmp = NULL; + RuneStrArray runes; + const DictTrie * dict = segment.GetDictTrie(); + assert(dict != NULL); + if(!DecodeRunesInString(str, runes)) { + XLOG(ERROR) << "Decode failed."; + return POS_X; + } + tmp = dict->Find(runes.begin(), runes.end()); + if(tmp == NULL || tmp->tag.empty()) { + return SpecialRule(runes); + } else { + return tmp->tag; + } } - // all the ascii is number char - if (m == eng) { - return POS_M; + +private: + const char* SpecialRule(const RuneStrArray& unicode) const { + size_t m = 0; + size_t eng = 0; + for(size_t i = 0; i < unicode.size() && eng < unicode.size() / 2; i++) { + if(unicode[i].rune < 0x80) { + eng ++; + if('0' <= unicode[i].rune && unicode[i].rune <= '9') { + m++; + } + } + } + // ascii char is not found + if(eng == 0) { + return POS_X; + } + // all the ascii is number char + if(m == eng) { + return POS_M; + } + // the ascii chars contain english letter + return POS_ENG; } - // the ascii chars contain english letter - return POS_ENG; - } }; // class PosTagger diff --git a/libchinese-segmentation/cppjieba/PreFilter.hpp b/libchinese-segmentation/cppjieba/PreFilter.hpp index c7c97db..848d43c 100644 --- a/libchinese-segmentation/cppjieba/PreFilter.hpp +++ b/libchinese-segmentation/cppjieba/PreFilter.hpp @@ -25,46 +25,46 @@ namespace cppjieba { class PreFilter { - public: - //TODO use WordRange instead of Range - struct Range { - RuneStrArray::const_iterator begin; - RuneStrArray::const_iterator end; - }; // struct Range +public: + //TODO use WordRange instead of Range + struct Range { + RuneStrArray::const_iterator begin; + RuneStrArray::const_iterator end; + }; // struct Range - PreFilter(const unordered_set& symbols, - const string& sentence) - : symbols_(symbols) { - if (!DecodeRunesInString(sentence, sentence_)) { - XLOG(ERROR) << "decode failed. "; - } - cursor_ = sentence_.begin(); - } - ~PreFilter() { - } - bool HasNext() const { - return cursor_ != sentence_.end(); - } - Range Next() { - Range range; - range.begin = cursor_; - while (cursor_ != sentence_.end()) { - if (IsIn(symbols_, cursor_->rune)) { - if (range.begin == cursor_) { - cursor_ ++; + PreFilter(const unordered_set& symbols, + const string& sentence) + : symbols_(symbols) { + if(!DecodeRunesInString(sentence, sentence_)) { + XLOG(ERROR) << "decode failed. "; } - range.end = cursor_; - return range; - } - cursor_ ++; + cursor_ = sentence_.begin(); } - range.end = sentence_.end(); - return range; - } - private: - RuneStrArray::const_iterator cursor_; - RuneStrArray sentence_; - const unordered_set& symbols_; + ~PreFilter() { + } + bool HasNext() const { + return cursor_ != sentence_.end(); + } + Range Next() { + Range range; + range.begin = cursor_; + while(cursor_ != sentence_.end()) { + if(IsIn(symbols_, cursor_->rune)) { + if(range.begin == cursor_) { + cursor_ ++; + } + range.end = cursor_; + return range; + } + cursor_ ++; + } + range.end = sentence_.end(); + return range; + } +private: + RuneStrArray::const_iterator cursor_; + RuneStrArray sentence_; + const unordered_set& symbols_; }; // class PreFilter } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/QuerySegment.hpp b/libchinese-segmentation/cppjieba/QuerySegment.hpp index c118053..08a9a15 100644 --- a/libchinese-segmentation/cppjieba/QuerySegment.hpp +++ b/libchinese-segmentation/cppjieba/QuerySegment.hpp @@ -31,75 +31,75 @@ namespace cppjieba { class QuerySegment: public SegmentBase { - public: - QuerySegment(const string& dict, const string& model, const string& userDict = "") - : mixSeg_(dict, model, userDict), - trie_(mixSeg_.GetDictTrie()) { - } - QuerySegment(const DictTrie* dictTrie, const HMMModel* model) - : mixSeg_(dictTrie, model), trie_(dictTrie) { - } - ~QuerySegment() { - } - - void Cut(const string& sentence, vector& words) const { - Cut(sentence, words, true); - } - void Cut(const string& sentence, vector& words, bool hmm) const { - vector tmp; - Cut(sentence, tmp, hmm); - GetStringsFromWords(tmp, words); - } - void Cut(const string& sentence, vector& words, bool hmm = true) const { - PreFilter pre_filter(symbols_, sentence); - PreFilter::Range range; - vector wrs; - wrs.reserve(sentence.size()/2); - while (pre_filter.HasNext()) { - range = pre_filter.Next(); - Cut(range.begin, range.end, wrs, hmm); +public: + QuerySegment(const string& dict, const string& model, const string& userDict = "") + : mixSeg_(dict, model, userDict), + trie_(mixSeg_.GetDictTrie()) { } - words.clear(); - words.reserve(wrs.size()); - GetWordsFromWordRanges(sentence, wrs, words); - } - void Cut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res, bool hmm) const { - //use mix Cut first - vector mixRes; - mixSeg_.Cut(begin, end, mixRes, hmm); - - vector fullRes; - for (vector::const_iterator mixResItr = mixRes.begin(); mixResItr != mixRes.end(); mixResItr++) { - if (mixResItr->Length() > 2) { - for (size_t i = 0; i + 1 < mixResItr->Length(); i++) { - WordRange wr(mixResItr->left + i, mixResItr->left + i + 1); - if (trie_->Find(wr.left, wr.right + 1) != NULL) { - res.push_back(wr); - } - } - } - if (mixResItr->Length() > 3) { - for (size_t i = 0; i + 2 < mixResItr->Length(); i++) { - WordRange wr(mixResItr->left + i, mixResItr->left + i + 2); - if (trie_->Find(wr.left, wr.right + 1) != NULL) { - res.push_back(wr); - } - } - } - res.push_back(*mixResItr); + QuerySegment(const DictTrie* dictTrie, const HMMModel* model) + : mixSeg_(dictTrie, model), trie_(dictTrie) { } - } - private: - bool IsAllAscii(const Unicode& s) const { - for(size_t i = 0; i < s.size(); i++) { - if (s[i] >= 0x80) { - return false; - } - } - return true; - } - MixSegment mixSeg_; - const DictTrie* trie_; + ~QuerySegment() { + } + + void Cut(const string& sentence, vector& words) const { + Cut(sentence, words, true); + } + void Cut(const string& sentence, vector& words, bool hmm) const { + vector tmp; + Cut(sentence, tmp, hmm); + GetStringsFromWords(tmp, words); + } + void Cut(const string& sentence, vector& words, bool hmm = true) const { + PreFilter pre_filter(symbols_, sentence); + PreFilter::Range range; + vector wrs; + wrs.reserve(sentence.size() / 2); + while(pre_filter.HasNext()) { + range = pre_filter.Next(); + Cut(range.begin, range.end, wrs, hmm); + } + words.clear(); + words.reserve(wrs.size()); + GetWordsFromWordRanges(sentence, wrs, words); + } + void Cut(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end, vector& res, bool hmm) const { + //use mix Cut first + vector mixRes; + mixSeg_.Cut(begin, end, mixRes, hmm); + + vector fullRes; + for(vector::const_iterator mixResItr = mixRes.begin(); mixResItr != mixRes.end(); mixResItr++) { + if(mixResItr->Length() > 2) { + for(size_t i = 0; i + 1 < mixResItr->Length(); i++) { + WordRange wr(mixResItr->left + i, mixResItr->left + i + 1); + if(trie_->Find(wr.left, wr.right + 1) != NULL) { + res.push_back(wr); + } + } + } + if(mixResItr->Length() > 3) { + for(size_t i = 0; i + 2 < mixResItr->Length(); i++) { + WordRange wr(mixResItr->left + i, mixResItr->left + i + 2); + if(trie_->Find(wr.left, wr.right + 1) != NULL) { + res.push_back(wr); + } + } + } + res.push_back(*mixResItr); + } + } +private: + bool IsAllAscii(const Unicode& s) const { + for(size_t i = 0; i < s.size(); i++) { + if(s[i] >= 0x80) { + return false; + } + } + return true; + } + MixSegment mixSeg_; + const DictTrie* trie_; }; // QuerySegment } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/SegmentBase.hpp b/libchinese-segmentation/cppjieba/SegmentBase.hpp index 93d831a..ce06baf 100644 --- a/libchinese-segmentation/cppjieba/SegmentBase.hpp +++ b/libchinese-segmentation/cppjieba/SegmentBase.hpp @@ -31,32 +31,32 @@ const char* const SPECIAL_SEPARATORS = " \t\n\xEF\xBC\x8C\xE3\x80\x82"; using namespace limonp; class SegmentBase { - public: - SegmentBase() { - XCHECK(ResetSeparators(SPECIAL_SEPARATORS)); - } - virtual ~SegmentBase() { - } - - virtual void Cut(const string& sentence, vector& words) const = 0; - - bool ResetSeparators(const string& s) { - symbols_.clear(); - RuneStrArray runes; - if (!DecodeRunesInString(s, runes)) { - XLOG(ERROR) << "decode " << s << " failed"; - return false; +public: + SegmentBase() { + XCHECK(ResetSeparators(SPECIAL_SEPARATORS)); } - for (size_t i = 0; i < runes.size(); i++) { - if (!symbols_.insert(runes[i].rune).second) { - XLOG(ERROR) << s.substr(runes[i].offset, runes[i].len) << " already exists"; - return false; - } + virtual ~SegmentBase() { } - return true; - } - protected: - unordered_set symbols_; + + virtual void Cut(const string& sentence, vector& words) const = 0; + + bool ResetSeparators(const string& s) { + symbols_.clear(); + RuneStrArray runes; + if(!DecodeRunesInString(s, runes)) { + XLOG(ERROR) << "decode " << s << " failed"; + return false; + } + for(size_t i = 0; i < runes.size(); i++) { + if(!symbols_.insert(runes[i].rune).second) { + XLOG(ERROR) << s.substr(runes[i].offset, runes[i].len) << " already exists"; + return false; + } + } + return true; + } +protected: + unordered_set symbols_; }; // class SegmentBase } // cppjieba diff --git a/libchinese-segmentation/cppjieba/SegmentTagged.hpp b/libchinese-segmentation/cppjieba/SegmentTagged.hpp index 5e46b0f..0ddc259 100644 --- a/libchinese-segmentation/cppjieba/SegmentTagged.hpp +++ b/libchinese-segmentation/cppjieba/SegmentTagged.hpp @@ -23,16 +23,16 @@ namespace cppjieba { -class SegmentTagged : public SegmentBase{ - public: - SegmentTagged() { - } - virtual ~SegmentTagged() { - } +class SegmentTagged : public SegmentBase { +public: + SegmentTagged() { + } + virtual ~SegmentTagged() { + } - virtual bool Tag(const string& src, vector >& res) const = 0; + virtual bool Tag(const string& src, vector >& res) const = 0; - virtual const DictTrie* GetDictTrie() const = 0; + virtual const DictTrie* GetDictTrie() const = 0; }; // class SegmentTagged diff --git a/libchinese-segmentation/cppjieba/TextRankExtractor.hpp b/libchinese-segmentation/cppjieba/TextRankExtractor.hpp index ba92e54..cb89a02 100644 --- a/libchinese-segmentation/cppjieba/TextRankExtractor.hpp +++ b/libchinese-segmentation/cppjieba/TextRankExtractor.hpp @@ -23,100 +23,104 @@ #include "Jieba.hpp" namespace cppjieba { - using namespace limonp; - using namespace std; +using namespace limonp; +using namespace std; - class TextRankExtractor { - public: - typedef struct _Word {string word;vector offsets;double weight;} Word; // struct Word - private: - typedef std::map WordMap; - - class WordGraph{ +class TextRankExtractor { +public: + typedef struct _Word { + string word; + vector offsets; + double weight; + } Word; // struct Word +private: + typedef std::map WordMap; + + class WordGraph { private: - typedef double Score; - typedef string Node; - typedef std::set NodeSet; + typedef double Score; + typedef string Node; + typedef std::set NodeSet; - typedef std::map Edges; - typedef std::map Graph; - //typedef std::unordered_map Edges; - //typedef std::unordered_map Graph; + typedef std::map Edges; + typedef std::map Graph; + //typedef std::unordered_map Edges; + //typedef std::unordered_map Graph; - double d; - Graph graph; - NodeSet nodeSet; + double d; + Graph graph; + NodeSet nodeSet; public: - WordGraph(): d(0.85) {}; - WordGraph(double in_d): d(in_d) {}; + WordGraph(): d(0.85) {}; + WordGraph(double in_d): d(in_d) {}; - void addEdge(Node start,Node end,double weight){ - Edges temp; - Edges::iterator gotEdges; - nodeSet.insert(start); - nodeSet.insert(end); - graph[start][end]+=weight; - graph[end][start]+=weight; - } - - void rank(WordMap &ws,size_t rankTime=10){ - WordMap outSum; - Score wsdef, min_rank, max_rank; - - if( graph.size() == 0) - return; - - wsdef = 1.0 / graph.size(); - - for(Graph::iterator edges=graph.begin();edges!=graph.end();++edges){ - // edges->first start节点;edge->first end节点;edge->second 权重 - ws[edges->first].word=edges->first; - ws[edges->first].weight=wsdef; - outSum[edges->first].weight=0; - for(Edges::iterator edge=edges->second.begin();edge!=edges->second.end();++edge){ - outSum[edges->first].weight+=edge->second; - } - } - //sort(nodeSet.begin(),nodeSet.end()); 是否需要排序? - for( size_t i=0; ifirst end节点;edge->second 权重 - s += edge->second / outSum[edge->first].weight * ws[edge->first].weight; - ws[*node].weight = (1 - d) + d * s; - } + void addEdge(Node start, Node end, double weight) { + Edges temp; + Edges::iterator gotEdges; + nodeSet.insert(start); + nodeSet.insert(end); + graph[start][end] += weight; + graph[end][start] += weight; } - min_rank=max_rank=ws.begin()->second.weight; - for(WordMap::iterator i = ws.begin(); i != ws.end(); i ++){ - if( i->second.weight < min_rank ){ - min_rank = i->second.weight; - } - if( i->second.weight > max_rank ){ - max_rank = i->second.weight; - } + void rank(WordMap &ws, size_t rankTime = 10) { + WordMap outSum; + Score wsdef, min_rank, max_rank; + + if(graph.size() == 0) + return; + + wsdef = 1.0 / graph.size(); + + for(Graph::iterator edges = graph.begin(); edges != graph.end(); ++edges) { + // edges->first start节点;edge->first end节点;edge->second 权重 + ws[edges->first].word = edges->first; + ws[edges->first].weight = wsdef; + outSum[edges->first].weight = 0; + for(Edges::iterator edge = edges->second.begin(); edge != edges->second.end(); ++edge) { + outSum[edges->first].weight += edge->second; + } + } + //sort(nodeSet.begin(),nodeSet.end()); 是否需要排序? + for(size_t i = 0; i < rankTime; i++) { + for(NodeSet::iterator node = nodeSet.begin(); node != nodeSet.end(); node++) { + double s = 0; + for(Edges::iterator edge = graph[*node].begin(); edge != graph[*node].end(); edge++) + // edge->first end节点;edge->second 权重 + s += edge->second / outSum[edge->first].weight * ws[edge->first].weight; + ws[*node].weight = (1 - d) + d * s; + } + } + + min_rank = max_rank = ws.begin()->second.weight; + for(WordMap::iterator i = ws.begin(); i != ws.end(); i ++) { + if(i->second.weight < min_rank) { + min_rank = i->second.weight; + } + if(i->second.weight > max_rank) { + max_rank = i->second.weight; + } + } + for(WordMap::iterator i = ws.begin(); i != ws.end(); i ++) { + ws[i->first].weight = (i->second.weight - min_rank / 10.0) / (max_rank - min_rank / 10.0); + } } - for(WordMap::iterator i = ws.begin(); i != ws.end(); i ++){ - ws[i->first].weight = (i->second.weight - min_rank / 10.0) / (max_rank - min_rank / 10.0); - } - } }; - public: - TextRankExtractor(const string& dictPath, - const string& hmmFilePath, - const string& stopWordPath, - const string& userDict = "") - : segment_(dictPath, hmmFilePath, userDict) { - LoadStopWordDict(stopWordPath); - } - TextRankExtractor(const DictTrie* dictTrie, - const HMMModel* model, - const string& stopWordPath) - : segment_(dictTrie, model) { - LoadStopWordDict(stopWordPath); - } +public: + TextRankExtractor(const string& dictPath, + const string& hmmFilePath, + const string& stopWordPath, + const string& userDict = "") + : segment_(dictPath, hmmFilePath, userDict) { + LoadStopWordDict(stopWordPath); + } + TextRankExtractor(const DictTrie* dictTrie, + const HMMModel* model, + const string& stopWordPath) + : segment_(dictTrie, model) { + LoadStopWordDict(stopWordPath); + } TextRankExtractor(const Jieba& jieba, const string& stopWordPath) : segment_(jieba.GetDictTrie(), jieba.GetHMMModel()) { LoadStopWordDict(stopWordPath); } @@ -124,83 +128,83 @@ namespace cppjieba { } void Extract(const string& sentence, vector& keywords, size_t topN) const { - vector topWords; - Extract(sentence, topWords, topN); - for (size_t i = 0; i < topWords.size(); i++) { - keywords.push_back(topWords[i].word); - } + vector topWords; + Extract(sentence, topWords, topN); + for(size_t i = 0; i < topWords.size(); i++) { + keywords.push_back(topWords[i].word); + } } void Extract(const string& sentence, vector >& keywords, size_t topN) const { - vector topWords; - Extract(sentence, topWords, topN); - for (size_t i = 0; i < topWords.size(); i++) { - keywords.push_back(pair(topWords[i].word, topWords[i].weight)); - } + vector topWords; + Extract(sentence, topWords, topN); + for(size_t i = 0; i < topWords.size(); i++) { + keywords.push_back(pair(topWords[i].word, topWords[i].weight)); + } } - void Extract(const string& sentence, vector& keywords, size_t topN, size_t span=5,size_t rankTime=10) const { - vector words; - segment_.Cut(sentence, words); + void Extract(const string& sentence, vector& keywords, size_t topN, size_t span = 5, size_t rankTime = 10) const { + vector words; + segment_.Cut(sentence, words); - TextRankExtractor::WordGraph graph; - WordMap wordmap; - size_t offset = 0; + TextRankExtractor::WordGraph graph; + WordMap wordmap; + size_t offset = 0; - for(size_t i=0; i < words.size(); i++){ - size_t t = offset; - offset += words[i].size(); - if (IsSingleWord(words[i]) || stopWords_.find(words[i]) != stopWords_.end()) { - continue; + for(size_t i = 0; i < words.size(); i++) { + size_t t = offset; + offset += words[i].size(); + if(IsSingleWord(words[i]) || stopWords_.find(words[i]) != stopWords_.end()) { + continue; + } + for(size_t j = i + 1, skip = 0; j < i + span + skip && j < words.size(); j++) { + if(IsSingleWord(words[j]) || stopWords_.find(words[j]) != stopWords_.end()) { + skip++; + continue; + } + graph.addEdge(words[i], words[j], 1); + } + wordmap[words[i]].offsets.push_back(t); } - for(size_t j=i+1,skip=0;jsecond); - } - - topN = min(topN, keywords.size()); - partial_sort(keywords.begin(), keywords.begin() + topN, keywords.end(), Compare); - keywords.resize(topN); + graph.rank(wordmap, rankTime); + + keywords.clear(); + keywords.reserve(wordmap.size()); + for(WordMap::iterator itr = wordmap.begin(); itr != wordmap.end(); ++itr) { + keywords.push_back(itr->second); + } + + topN = min(topN, keywords.size()); + partial_sort(keywords.begin(), keywords.begin() + topN, keywords.end(), Compare); + keywords.resize(topN); } - private: +private: void LoadStopWordDict(const string& filePath) { - ifstream ifs(filePath.c_str()); - XCHECK(ifs.is_open()) << "open " << filePath << " failed"; - string line ; - while (getline(ifs, line)) { - stopWords_.insert(line); - } - assert(stopWords_.size()); + ifstream ifs(filePath.c_str()); + XCHECK(ifs.is_open()) << "open " << filePath << " failed"; + string line ; + while(getline(ifs, line)) { + stopWords_.insert(line); + } + assert(stopWords_.size()); } - static bool Compare(const Word &x,const Word &y){ - return x.weight > y.weight; + static bool Compare(const Word &x, const Word &y) { + return x.weight > y.weight; } MixSegment segment_; unordered_set stopWords_; - }; // class TextRankExtractor - - inline ostream& operator << (ostream& os, const TextRankExtractor::Word& word) { - return os << "{\"word\": \"" << word.word << "\", \"offset\": " << word.offsets << ", \"weight\": " << word.weight << "}"; - } +}; // class TextRankExtractor + +inline ostream& operator << (ostream& os, const TextRankExtractor::Word& word) { + return os << "{\"word\": \"" << word.word << "\", \"offset\": " << word.offsets << ", \"weight\": " << word.weight << "}"; +} } // namespace cppjieba #endif diff --git a/libchinese-segmentation/cppjieba/Trie.hpp b/libchinese-segmentation/cppjieba/Trie.hpp index ae4a4bd..3f1fc69 100644 --- a/libchinese-segmentation/cppjieba/Trie.hpp +++ b/libchinese-segmentation/cppjieba/Trie.hpp @@ -31,9 +31,9 @@ using namespace std; const size_t MAX_WORD_LENGTH = 512; struct DictUnit { - Unicode word; - double weight; - string tag; + Unicode word; + double weight; + string tag; }; // struct DictUnit // for debugging @@ -44,148 +44,148 @@ struct DictUnit { // } struct Dag { - RuneStr runestr; - // [offset, nexts.first] - limonp::LocalVector > nexts; - const DictUnit * pInfo; - double weight; - size_t nextPos; // TODO - Dag():runestr(), pInfo(NULL), weight(0.0), nextPos(0) { - } + RuneStr runestr; + // [offset, nexts.first] + limonp::LocalVector > nexts; + const DictUnit * pInfo; + double weight; + size_t nextPos; // TODO + Dag(): runestr(), pInfo(NULL), weight(0.0), nextPos(0) { + } }; // struct Dag typedef Rune TrieKey; class TrieNode { - public : - TrieNode(): next(NULL), ptValue(NULL) { - } - public: - typedef unordered_map NextMap; - NextMap *next; - const DictUnit *ptValue; +public : + TrieNode(): next(NULL), ptValue(NULL) { + } +public: + typedef unordered_map NextMap; + NextMap *next; + const DictUnit *ptValue; }; class Trie { - public: - Trie(const vector& keys, const vector& valuePointers) - : root_(new TrieNode) { - CreateTrie(keys, valuePointers); - } - ~Trie() { - DeleteNode(root_); - } - - const DictUnit* Find(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { - if (begin == end) { - return NULL; +public: + Trie(const vector& keys, const vector& valuePointers) + : root_(new TrieNode) { + CreateTrie(keys, valuePointers); + } + ~Trie() { + DeleteNode(root_); } - const TrieNode* ptNode = root_; - TrieNode::NextMap::const_iterator citer; - for (RuneStrArray::const_iterator it = begin; it != end; it++) { - if (NULL == ptNode->next) { - return NULL; - } - citer = ptNode->next->find(it->rune); - if (ptNode->next->end() == citer) { - return NULL; - } - ptNode = citer->second; - } - return ptNode->ptValue; - } - - void Find(RuneStrArray::const_iterator begin, - RuneStrArray::const_iterator end, - vector&res, - size_t max_word_len = MAX_WORD_LENGTH) const { - assert(root_ != NULL); - res.resize(end - begin); - - const TrieNode *ptNode = NULL; - TrieNode::NextMap::const_iterator citer; - for (size_t i = 0; i < size_t(end - begin); i++) { - res[i].runestr = *(begin + i); - - if (root_->next != NULL && root_->next->end() != (citer = root_->next->find(res[i].runestr.rune))) { - ptNode = citer->second; - } else { - ptNode = NULL; - } - if (ptNode != NULL) { - res[i].nexts.push_back(pair(i, ptNode->ptValue)); - } else { - res[i].nexts.push_back(pair(i, static_cast(NULL))); - } - - for (size_t j = i + 1; j < size_t(end - begin) && (j - i + 1) <= max_word_len; j++) { - if (ptNode == NULL || ptNode->next == NULL) { - break; + const DictUnit* Find(RuneStrArray::const_iterator begin, RuneStrArray::const_iterator end) const { + if(begin == end) { + return NULL; } - citer = ptNode->next->find((begin + j)->rune); - if (ptNode->next->end() == citer) { - break; + + const TrieNode* ptNode = root_; + TrieNode::NextMap::const_iterator citer; + for(RuneStrArray::const_iterator it = begin; it != end; it++) { + if(NULL == ptNode->next) { + return NULL; + } + citer = ptNode->next->find(it->rune); + if(ptNode->next->end() == citer) { + return NULL; + } + ptNode = citer->second; } - ptNode = citer->second; - if (NULL != ptNode->ptValue) { - res[i].nexts.push_back(pair(j, ptNode->ptValue)); + return ptNode->ptValue; + } + + void Find(RuneStrArray::const_iterator begin, + RuneStrArray::const_iterator end, + vector&res, + size_t max_word_len = MAX_WORD_LENGTH) const { + assert(root_ != NULL); + res.resize(end - begin); + + const TrieNode *ptNode = NULL; + TrieNode::NextMap::const_iterator citer; + for(size_t i = 0; i < size_t(end - begin); i++) { + res[i].runestr = *(begin + i); + + if(root_->next != NULL && root_->next->end() != (citer = root_->next->find(res[i].runestr.rune))) { + ptNode = citer->second; + } else { + ptNode = NULL; + } + if(ptNode != NULL) { + res[i].nexts.push_back(pair(i, ptNode->ptValue)); + } else { + res[i].nexts.push_back(pair(i, static_cast(NULL))); + } + + for(size_t j = i + 1; j < size_t(end - begin) && (j - i + 1) <= max_word_len; j++) { + if(ptNode == NULL || ptNode->next == NULL) { + break; + } + citer = ptNode->next->find((begin + j)->rune); + if(ptNode->next->end() == citer) { + break; + } + ptNode = citer->second; + if(NULL != ptNode->ptValue) { + res[i].nexts.push_back(pair(j, ptNode->ptValue)); + } + } } - } - } - } - - void InsertNode(const Unicode& key, const DictUnit* ptValue) { - if (key.begin() == key.end()) { - return; } - TrieNode::NextMap::const_iterator kmIter; - TrieNode *ptNode = root_; - for (Unicode::const_iterator citer = key.begin(); citer != key.end(); ++citer) { - if (NULL == ptNode->next) { - ptNode->next = new TrieNode::NextMap; - } - kmIter = ptNode->next->find(*citer); - if (ptNode->next->end() == kmIter) { - TrieNode *nextNode = new TrieNode; + void InsertNode(const Unicode& key, const DictUnit* ptValue) { + if(key.begin() == key.end()) { + return; + } - ptNode->next->insert(make_pair(*citer, nextNode)); - ptNode = nextNode; - } else { - ptNode = kmIter->second; - } - } - assert(ptNode != NULL); - ptNode->ptValue = ptValue; - } + TrieNode::NextMap::const_iterator kmIter; + TrieNode *ptNode = root_; + for(Unicode::const_iterator citer = key.begin(); citer != key.end(); ++citer) { + if(NULL == ptNode->next) { + ptNode->next = new TrieNode::NextMap; + } + kmIter = ptNode->next->find(*citer); + if(ptNode->next->end() == kmIter) { + TrieNode *nextNode = new TrieNode; - private: - void CreateTrie(const vector& keys, const vector& valuePointers) { - if (valuePointers.empty() || keys.empty()) { - return; + ptNode->next->insert(make_pair(*citer, nextNode)); + ptNode = nextNode; + } else { + ptNode = kmIter->second; + } + } + assert(ptNode != NULL); + ptNode->ptValue = ptValue; } - assert(keys.size() == valuePointers.size()); - for (size_t i = 0; i < keys.size(); i++) { - InsertNode(keys[i], valuePointers[i]); - } - } +private: + void CreateTrie(const vector& keys, const vector& valuePointers) { + if(valuePointers.empty() || keys.empty()) { + return; + } + assert(keys.size() == valuePointers.size()); - void DeleteNode(TrieNode* node) { - if (NULL == node) { - return; + for(size_t i = 0; i < keys.size(); i++) { + InsertNode(keys[i], valuePointers[i]); + } } - if (NULL != node->next) { - for (TrieNode::NextMap::iterator it = node->next->begin(); it != node->next->end(); ++it) { - DeleteNode(it->second); - } - delete node->next; - } - delete node; - } - TrieNode* root_; + void DeleteNode(TrieNode* node) { + if(NULL == node) { + return; + } + if(NULL != node->next) { + for(TrieNode::NextMap::iterator it = node->next->begin(); it != node->next->end(); ++it) { + DeleteNode(it->second); + } + delete node->next; + } + delete node; + } + + TrieNode* root_; }; // class Trie } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/Unicode.hpp b/libchinese-segmentation/cppjieba/Unicode.hpp index 63517a5..64408a2 100644 --- a/libchinese-segmentation/cppjieba/Unicode.hpp +++ b/libchinese-segmentation/cppjieba/Unicode.hpp @@ -34,40 +34,40 @@ using std::vector; typedef uint32_t Rune; struct Word { - string word; - uint32_t offset; - uint32_t unicode_offset; - uint32_t unicode_length; - Word(const string& w, uint32_t o) - : word(w), offset(o) { - } - Word(const string& w, uint32_t o, uint32_t unicode_offset, uint32_t unicode_length) - : word(w), offset(o), unicode_offset(unicode_offset), unicode_length(unicode_length) { - } + string word; + uint32_t offset; + uint32_t unicode_offset; + uint32_t unicode_length; + Word(const string& w, uint32_t o) + : word(w), offset(o) { + } + Word(const string& w, uint32_t o, uint32_t unicode_offset, uint32_t unicode_length) + : word(w), offset(o), unicode_offset(unicode_offset), unicode_length(unicode_length) { + } }; // struct Word inline std::ostream& operator << (std::ostream& os, const Word& w) { - return os << "{\"word\": \"" << w.word << "\", \"offset\": " << w.offset << "}"; + return os << "{\"word\": \"" << w.word << "\", \"offset\": " << w.offset << "}"; } struct RuneStr { - Rune rune; - uint32_t offset; - uint32_t len; - uint32_t unicode_offset; - uint32_t unicode_length; - RuneStr(): rune(0), offset(0), len(0), unicode_offset(0), unicode_length(0) { - } - RuneStr(Rune r, uint32_t o, uint32_t l) - : rune(r), offset(o), len(l), unicode_offset(0), unicode_length(0) { - } - RuneStr(Rune r, uint32_t o, uint32_t l, uint32_t unicode_offset, uint32_t unicode_length) - : rune(r), offset(o), len(l), unicode_offset(unicode_offset), unicode_length(unicode_length) { - } + Rune rune; + uint32_t offset; + uint32_t len; + uint32_t unicode_offset; + uint32_t unicode_length; + RuneStr(): rune(0), offset(0), len(0), unicode_offset(0), unicode_length(0) { + } + RuneStr(Rune r, uint32_t o, uint32_t l) + : rune(r), offset(o), len(l), unicode_offset(0), unicode_length(0) { + } + RuneStr(Rune r, uint32_t o, uint32_t l, uint32_t unicode_offset, uint32_t unicode_length) + : rune(r), offset(o), len(l), unicode_offset(unicode_offset), unicode_length(unicode_length) { + } }; // struct RuneStr inline std::ostream& operator << (std::ostream& os, const RuneStr& r) { - return os << "{\"rune\": \"" << r.rune << "\", \"offset\": " << r.offset << ", \"len\": " << r.len << "}"; + return os << "{\"rune\": \"" << r.rune << "\", \"offset\": " << r.offset << ", \"len\": " << r.len << "}"; } typedef limonp::LocalVector Unicode; @@ -75,169 +75,169 @@ typedef limonp::LocalVector RuneStrArray; // [left, right] struct WordRange { - RuneStrArray::const_iterator left; - RuneStrArray::const_iterator right; - WordRange(RuneStrArray::const_iterator l, RuneStrArray::const_iterator r) - : left(l), right(r) { - } - size_t Length() const { - return right - left + 1; - } - bool IsAllAscii() const { - for (RuneStrArray::const_iterator iter = left; iter <= right; ++iter) { - if (iter->rune >= 0x80) { - return false; - } + RuneStrArray::const_iterator left; + RuneStrArray::const_iterator right; + WordRange(RuneStrArray::const_iterator l, RuneStrArray::const_iterator r) + : left(l), right(r) { + } + size_t Length() const { + return right - left + 1; + } + bool IsAllAscii() const { + for(RuneStrArray::const_iterator iter = left; iter <= right; ++iter) { + if(iter->rune >= 0x80) { + return false; + } + } + return true; } - return true; - } }; // struct WordRange struct RuneStrLite { - uint32_t rune; - uint32_t len; - RuneStrLite(): rune(0), len(0) { - } - RuneStrLite(uint32_t r, uint32_t l): rune(r), len(l) { - } + uint32_t rune; + uint32_t len; + RuneStrLite(): rune(0), len(0) { + } + RuneStrLite(uint32_t r, uint32_t l): rune(r), len(l) { + } }; // struct RuneStrLite inline RuneStrLite DecodeRuneInString(const char* str, size_t len) { - RuneStrLite rp(0, 0); - if (str == NULL || len == 0) { + RuneStrLite rp(0, 0); + if(str == NULL || len == 0) { + return rp; + } + if(!(str[0] & 0x80)) { // 0xxxxxxx + // 7bit, total 7bit + rp.rune = (uint8_t)(str[0]) & 0x7f; + rp.len = 1; + } else if((uint8_t)str[0] <= 0xdf && 1 < len) { + // 110xxxxxx + // 5bit, total 5bit + rp.rune = (uint8_t)(str[0]) & 0x1f; + + // 6bit, total 11bit + rp.rune <<= 6; + rp.rune |= (uint8_t)(str[1]) & 0x3f; + rp.len = 2; + } else if((uint8_t)str[0] <= 0xef && 2 < len) { // 1110xxxxxx + // 4bit, total 4bit + rp.rune = (uint8_t)(str[0]) & 0x0f; + + // 6bit, total 10bit + rp.rune <<= 6; + rp.rune |= (uint8_t)(str[1]) & 0x3f; + + // 6bit, total 16bit + rp.rune <<= 6; + rp.rune |= (uint8_t)(str[2]) & 0x3f; + + rp.len = 3; + } else if((uint8_t)str[0] <= 0xf7 && 3 < len) { // 11110xxxx + // 3bit, total 3bit + rp.rune = (uint8_t)(str[0]) & 0x07; + + // 6bit, total 9bit + rp.rune <<= 6; + rp.rune |= (uint8_t)(str[1]) & 0x3f; + + // 6bit, total 15bit + rp.rune <<= 6; + rp.rune |= (uint8_t)(str[2]) & 0x3f; + + // 6bit, total 21bit + rp.rune <<= 6; + rp.rune |= (uint8_t)(str[3]) & 0x3f; + + rp.len = 4; + } else { + rp.rune = 0; + rp.len = 0; + } return rp; - } - if (!(str[0] & 0x80)) { // 0xxxxxxx - // 7bit, total 7bit - rp.rune = (uint8_t)(str[0]) & 0x7f; - rp.len = 1; - } else if ((uint8_t)str[0] <= 0xdf && 1 < len) { - // 110xxxxxx - // 5bit, total 5bit - rp.rune = (uint8_t)(str[0]) & 0x1f; - - // 6bit, total 11bit - rp.rune <<= 6; - rp.rune |= (uint8_t)(str[1]) & 0x3f; - rp.len = 2; - } else if((uint8_t)str[0] <= 0xef && 2 < len) { // 1110xxxxxx - // 4bit, total 4bit - rp.rune = (uint8_t)(str[0]) & 0x0f; - - // 6bit, total 10bit - rp.rune <<= 6; - rp.rune |= (uint8_t)(str[1]) & 0x3f; - - // 6bit, total 16bit - rp.rune <<= 6; - rp.rune |= (uint8_t)(str[2]) & 0x3f; - - rp.len = 3; - } else if((uint8_t)str[0] <= 0xf7 && 3 < len) { // 11110xxxx - // 3bit, total 3bit - rp.rune = (uint8_t)(str[0]) & 0x07; - - // 6bit, total 9bit - rp.rune <<= 6; - rp.rune |= (uint8_t)(str[1]) & 0x3f; - - // 6bit, total 15bit - rp.rune <<= 6; - rp.rune |= (uint8_t)(str[2]) & 0x3f; - - // 6bit, total 21bit - rp.rune <<= 6; - rp.rune |= (uint8_t)(str[3]) & 0x3f; - - rp.len = 4; - } else { - rp.rune = 0; - rp.len = 0; - } - return rp; } inline bool DecodeRunesInString(const char* s, size_t len, RuneStrArray& runes) { - runes.clear(); - runes.reserve(len / 2); - for (uint32_t i = 0, j = 0; i < len;) { - RuneStrLite rp = DecodeRuneInString(s + i, len - i); - if (rp.len == 0) { - runes.clear(); - return false; + runes.clear(); + runes.reserve(len / 2); + for(uint32_t i = 0, j = 0; i < len;) { + RuneStrLite rp = DecodeRuneInString(s + i, len - i); + if(rp.len == 0) { + runes.clear(); + return false; + } + RuneStr x(rp.rune, i, rp.len, j, 1); + runes.push_back(x); + i += rp.len; + ++j; } - RuneStr x(rp.rune, i, rp.len, j, 1); - runes.push_back(x); - i += rp.len; - ++j; - } - return true; + return true; } inline bool DecodeRunesInString(const string& s, RuneStrArray& runes) { - return DecodeRunesInString(s.c_str(), s.size(), runes); + return DecodeRunesInString(s.c_str(), s.size(), runes); } inline bool DecodeRunesInString(const char* s, size_t len, Unicode& unicode) { - unicode.clear(); - RuneStrArray runes; - if (!DecodeRunesInString(s, len, runes)) { - return false; - } - unicode.reserve(runes.size()); - for (size_t i = 0; i < runes.size(); i++) { - unicode.push_back(runes[i].rune); - } - return true; + unicode.clear(); + RuneStrArray runes; + if(!DecodeRunesInString(s, len, runes)) { + return false; + } + unicode.reserve(runes.size()); + for(size_t i = 0; i < runes.size(); i++) { + unicode.push_back(runes[i].rune); + } + return true; } inline bool IsSingleWord(const string& str) { - RuneStrLite rp = DecodeRuneInString(str.c_str(), str.size()); - return rp.len == str.size(); + RuneStrLite rp = DecodeRuneInString(str.c_str(), str.size()); + return rp.len == str.size(); } inline bool DecodeRunesInString(const string& s, Unicode& unicode) { - return DecodeRunesInString(s.c_str(), s.size(), unicode); + return DecodeRunesInString(s.c_str(), s.size(), unicode); } inline Unicode DecodeRunesInString(const string& s) { - Unicode result; - DecodeRunesInString(s, result); - return result; + Unicode result; + DecodeRunesInString(s, result); + return result; } // [left, right] inline Word GetWordFromRunes(const string& s, RuneStrArray::const_iterator left, RuneStrArray::const_iterator right) { - assert(right->offset >= left->offset); - uint32_t len = right->offset - left->offset + right->len; - uint32_t unicode_length = right->unicode_offset - left->unicode_offset + right->unicode_length; - return Word(s.substr(left->offset, len), left->offset, left->unicode_offset, unicode_length); + assert(right->offset >= left->offset); + uint32_t len = right->offset - left->offset + right->len; + uint32_t unicode_length = right->unicode_offset - left->unicode_offset + right->unicode_length; + return Word(s.substr(left->offset, len), left->offset, left->unicode_offset, unicode_length); } inline string GetStringFromRunes(const string& s, RuneStrArray::const_iterator left, RuneStrArray::const_iterator right) { - assert(right->offset >= left->offset); - uint32_t len = right->offset - left->offset + right->len; - return s.substr(left->offset, len); + assert(right->offset >= left->offset); + uint32_t len = right->offset - left->offset + right->len; + return s.substr(left->offset, len); } inline void GetWordsFromWordRanges(const string& s, const vector& wrs, vector& words) { - for (size_t i = 0; i < wrs.size(); i++) { - words.push_back(GetWordFromRunes(s, wrs[i].left, wrs[i].right)); - } + for(size_t i = 0; i < wrs.size(); i++) { + words.push_back(GetWordFromRunes(s, wrs[i].left, wrs[i].right)); + } } inline vector GetWordsFromWordRanges(const string& s, const vector& wrs) { - vector result; - GetWordsFromWordRanges(s, wrs, result); - return result; + vector result; + GetWordsFromWordRanges(s, wrs, result); + return result; } inline void GetStringsFromWords(const vector& words, vector& strs) { - strs.resize(words.size()); - for (size_t i = 0; i < words.size(); ++i) { - strs[i] = words[i].word; - } + strs.resize(words.size()); + for(size_t i = 0; i < words.size(); ++i) { + strs[i] = words[i].word; + } } } // namespace cppjieba diff --git a/libchinese-segmentation/cppjieba/limonp/ArgvContext.hpp b/libchinese-segmentation/cppjieba/limonp/ArgvContext.hpp index 32dbb4d..c6c55d5 100644 --- a/libchinese-segmentation/cppjieba/limonp/ArgvContext.hpp +++ b/libchinese-segmentation/cppjieba/limonp/ArgvContext.hpp @@ -33,54 +33,54 @@ namespace limonp { using namespace std; class ArgvContext { - public : - ArgvContext(int argc, const char* const * argv) { - for(int i = 0; i < argc; i++) { - if(StartsWith(argv[i], "-")) { - if(i + 1 < argc && !StartsWith(argv[i + 1], "-")) { - mpss_[argv[i]] = argv[i+1]; - i++; - } else { - sset_.insert(argv[i]); +public : + ArgvContext(int argc, const char* const * argv) { + for(int i = 0; i < argc; i++) { + if(StartsWith(argv[i], "-")) { + if(i + 1 < argc && !StartsWith(argv[i + 1], "-")) { + mpss_[argv[i]] = argv[i + 1]; + i++; + } else { + sset_.insert(argv[i]); + } + } else { + args_.push_back(argv[i]); + } } - } else { - args_.push_back(argv[i]); - } } - } - ~ArgvContext() { - } + ~ArgvContext() { + } - friend ostream& operator << (ostream& os, const ArgvContext& args); - string operator [](size_t i) const { - if(i < args_.size()) { - return args_[i]; + friend ostream& operator << (ostream& os, const ArgvContext& args); + string operator [](size_t i) const { + if(i < args_.size()) { + return args_[i]; + } + return ""; } - return ""; - } - string operator [](const string& key) const { - map::const_iterator it = mpss_.find(key); - if(it != mpss_.end()) { - return it->second; + string operator [](const string& key) const { + map::const_iterator it = mpss_.find(key); + if(it != mpss_.end()) { + return it->second; + } + return ""; } - return ""; - } - bool HasKey(const string& key) const { - if(mpss_.find(key) != mpss_.end() || sset_.find(key) != sset_.end()) { - return true; + bool HasKey(const string& key) const { + if(mpss_.find(key) != mpss_.end() || sset_.find(key) != sset_.end()) { + return true; + } + return false; } - return false; - } - private: - vector args_; - map mpss_; - set sset_; +private: + vector args_; + map mpss_; + set sset_; }; // class ArgvContext inline ostream& operator << (ostream& os, const ArgvContext& args) { - return os< class BlockingQueue: NonCopyable { - public: - BlockingQueue() - : mutex_(), notEmpty_(mutex_), queue_() { - } - - void Push(const T& x) { - MutexLockGuard lock(mutex_); - queue_.push(x); - notEmpty_.Notify(); // Wait morphing saves us - } - - T Pop() { - MutexLockGuard lock(mutex_); - // always use a while-loop, due to spurious wakeup - while (queue_.empty()) { - notEmpty_.Wait(); +public: + BlockingQueue() + : mutex_(), notEmpty_(mutex_), queue_() { } - assert(!queue_.empty()); - T front(queue_.front()); - queue_.pop(); - return front; - } - size_t Size() const { - MutexLockGuard lock(mutex_); - return queue_.size(); - } - bool Empty() const { - return Size() == 0; - } + void Push(const T& x) { + MutexLockGuard lock(mutex_); + queue_.push(x); + notEmpty_.Notify(); // Wait morphing saves us + } - private: - mutable MutexLock mutex_; - Condition notEmpty_; - std::queue queue_; + T Pop() { + MutexLockGuard lock(mutex_); + // always use a while-loop, due to spurious wakeup + while(queue_.empty()) { + notEmpty_.Wait(); + } + assert(!queue_.empty()); + T front(queue_.front()); + queue_.pop(); + return front; + } + + size_t Size() const { + MutexLockGuard lock(mutex_); + return queue_.size(); + } + bool Empty() const { + return Size() == 0; + } + +private: + mutable MutexLock mutex_; + Condition notEmpty_; + std::queue queue_; }; // class BlockingQueue } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/BoundedBlockingQueue.hpp b/libchinese-segmentation/cppjieba/limonp/BoundedBlockingQueue.hpp index fc523d5..41a5ef9 100644 --- a/libchinese-segmentation/cppjieba/limonp/BoundedBlockingQueue.hpp +++ b/libchinese-segmentation/cppjieba/limonp/BoundedBlockingQueue.hpp @@ -25,59 +25,59 @@ namespace limonp { template class BoundedBlockingQueue : NonCopyable { - public: - explicit BoundedBlockingQueue(size_t maxSize) - : mutex_(), - notEmpty_(mutex_), - notFull_(mutex_), - queue_(maxSize) { - } - - void Push(const T& x) { - MutexLockGuard lock(mutex_); - while (queue_.Full()) { - notFull_.Wait(); +public: + explicit BoundedBlockingQueue(size_t maxSize) + : mutex_(), + notEmpty_(mutex_), + notFull_(mutex_), + queue_(maxSize) { } - assert(!queue_.Full()); - queue_.Push(x); - notEmpty_.Notify(); - } - T Pop() { - MutexLockGuard lock(mutex_); - while (queue_.Empty()) { - notEmpty_.Wait(); + void Push(const T& x) { + MutexLockGuard lock(mutex_); + while(queue_.Full()) { + notFull_.Wait(); + } + assert(!queue_.Full()); + queue_.Push(x); + notEmpty_.Notify(); } - assert(!queue_.Empty()); - T res = queue_.Pop(); - notFull_.Notify(); - return res; - } - bool Empty() const { - MutexLockGuard lock(mutex_); - return queue_.Empty(); - } + T Pop() { + MutexLockGuard lock(mutex_); + while(queue_.Empty()) { + notEmpty_.Wait(); + } + assert(!queue_.Empty()); + T res = queue_.Pop(); + notFull_.Notify(); + return res; + } - bool Full() const { - MutexLockGuard lock(mutex_); - return queue_.Full(); - } + bool Empty() const { + MutexLockGuard lock(mutex_); + return queue_.Empty(); + } - size_t size() const { - MutexLockGuard lock(mutex_); - return queue_.size(); - } + bool Full() const { + MutexLockGuard lock(mutex_); + return queue_.Full(); + } - size_t capacity() const { - return queue_.capacity(); - } + size_t size() const { + MutexLockGuard lock(mutex_); + return queue_.size(); + } - private: - mutable MutexLock mutex_; - Condition notEmpty_; - Condition notFull_; - BoundedQueue queue_; + size_t capacity() const { + return queue_.capacity(); + } + +private: + mutable MutexLock mutex_; + Condition notEmpty_; + Condition notFull_; + BoundedQueue queue_; }; // class BoundedBlockingQueue } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/BoundedQueue.hpp b/libchinese-segmentation/cppjieba/limonp/BoundedQueue.hpp index f625c18..ef86e26 100644 --- a/libchinese-segmentation/cppjieba/limonp/BoundedQueue.hpp +++ b/libchinese-segmentation/cppjieba/limonp/BoundedQueue.hpp @@ -27,55 +27,55 @@ namespace limonp { using namespace std; template class BoundedQueue { - public: - explicit BoundedQueue(size_t capacity): capacity_(capacity), circular_buffer_(capacity) { - head_ = 0; - tail_ = 0; - size_ = 0; - assert(capacity_); - } - ~BoundedQueue() { - } +public: + explicit BoundedQueue(size_t capacity): capacity_(capacity), circular_buffer_(capacity) { + head_ = 0; + tail_ = 0; + size_ = 0; + assert(capacity_); + } + ~BoundedQueue() { + } - void Clear() { - head_ = 0; - tail_ = 0; - size_ = 0; - } - bool Empty() const { - return !size_; - } - bool Full() const { - return capacity_ == size_; - } - size_t Size() const { - return size_; - } - size_t Capacity() const { - return capacity_; - } + void Clear() { + head_ = 0; + tail_ = 0; + size_ = 0; + } + bool Empty() const { + return !size_; + } + bool Full() const { + return capacity_ == size_; + } + size_t Size() const { + return size_; + } + size_t Capacity() const { + return capacity_; + } - void Push(const T& t) { - assert(!Full()); - circular_buffer_[tail_] = t; - tail_ = (tail_ + 1) % capacity_; - size_ ++; - } + void Push(const T& t) { + assert(!Full()); + circular_buffer_[tail_] = t; + tail_ = (tail_ + 1) % capacity_; + size_ ++; + } - T Pop() { - assert(!Empty()); - size_t oldPos = head_; - head_ = (head_ + 1) % capacity_; - size_ --; - return circular_buffer_[oldPos]; - } + T Pop() { + assert(!Empty()); + size_t oldPos = head_; + head_ = (head_ + 1) % capacity_; + size_ --; + return circular_buffer_[oldPos]; + } - private: - size_t head_; - size_t tail_; - size_t size_; - const size_t capacity_; - vector circular_buffer_; +private: + size_t head_; + size_t tail_; + size_t size_; + const size_t capacity_; + vector circular_buffer_; }; // class BoundedQueue } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/Closure.hpp b/libchinese-segmentation/cppjieba/limonp/Closure.hpp index d9207fe..9fab60f 100644 --- a/libchinese-segmentation/cppjieba/limonp/Closure.hpp +++ b/libchinese-segmentation/cppjieba/limonp/Closure.hpp @@ -22,201 +22,201 @@ namespace limonp { class ClosureInterface { - public: - virtual ~ClosureInterface() { - } - virtual void Run() = 0; +public: + virtual ~ClosureInterface() { + } + virtual void Run() = 0; }; template class Closure0: public ClosureInterface { - public: - Closure0(Funct fun) { - fun_ = fun; - } - virtual ~Closure0() { - } - virtual void Run() { - (*fun_)(); - } - private: - Funct fun_; -}; +public: + Closure0(Funct fun) { + fun_ = fun; + } + virtual ~Closure0() { + } + virtual void Run() { + (*fun_)(); + } +private: + Funct fun_; +}; template class Closure1: public ClosureInterface { - public: - Closure1(Funct fun, Arg1 arg1) { - fun_ = fun; - arg1_ = arg1; - } - virtual ~Closure1() { - } - virtual void Run() { - (*fun_)(arg1_); - } - private: - Funct fun_; - Arg1 arg1_; -}; +public: + Closure1(Funct fun, Arg1 arg1) { + fun_ = fun; + arg1_ = arg1; + } + virtual ~Closure1() { + } + virtual void Run() { + (*fun_)(arg1_); + } +private: + Funct fun_; + Arg1 arg1_; +}; template class Closure2: public ClosureInterface { - public: - Closure2(Funct fun, Arg1 arg1, Arg2 arg2) { - fun_ = fun; - arg1_ = arg1; - arg2_ = arg2; - } - virtual ~Closure2() { - } - virtual void Run() { - (*fun_)(arg1_, arg2_); - } - private: - Funct fun_; - Arg1 arg1_; - Arg2 arg2_; -}; +public: + Closure2(Funct fun, Arg1 arg1, Arg2 arg2) { + fun_ = fun; + arg1_ = arg1; + arg2_ = arg2; + } + virtual ~Closure2() { + } + virtual void Run() { + (*fun_)(arg1_, arg2_); + } +private: + Funct fun_; + Arg1 arg1_; + Arg2 arg2_; +}; template class Closure3: public ClosureInterface { - public: - Closure3(Funct fun, Arg1 arg1, Arg2 arg2, Arg3 arg3) { - fun_ = fun; - arg1_ = arg1; - arg2_ = arg2; - arg3_ = arg3; - } - virtual ~Closure3() { - } - virtual void Run() { - (*fun_)(arg1_, arg2_, arg3_); - } - private: - Funct fun_; - Arg1 arg1_; - Arg2 arg2_; - Arg3 arg3_; -}; +public: + Closure3(Funct fun, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + fun_ = fun; + arg1_ = arg1; + arg2_ = arg2; + arg3_ = arg3; + } + virtual ~Closure3() { + } + virtual void Run() { + (*fun_)(arg1_, arg2_, arg3_); + } +private: + Funct fun_; + Arg1 arg1_; + Arg2 arg2_; + Arg3 arg3_; +}; -template +template class ObjClosure0: public ClosureInterface { - public: - ObjClosure0(Obj* p, Funct fun) { - p_ = p; - fun_ = fun; - } - virtual ~ObjClosure0() { - } - virtual void Run() { - (p_->*fun_)(); - } - private: - Obj* p_; - Funct fun_; -}; +public: + ObjClosure0(Obj* p, Funct fun) { + p_ = p; + fun_ = fun; + } + virtual ~ObjClosure0() { + } + virtual void Run() { + (p_->*fun_)(); + } +private: + Obj* p_; + Funct fun_; +}; -template +template class ObjClosure1: public ClosureInterface { - public: - ObjClosure1(Obj* p, Funct fun, Arg1 arg1) { - p_ = p; - fun_ = fun; - arg1_ = arg1; - } - virtual ~ObjClosure1() { - } - virtual void Run() { - (p_->*fun_)(arg1_); - } - private: - Obj* p_; - Funct fun_; - Arg1 arg1_; -}; +public: + ObjClosure1(Obj* p, Funct fun, Arg1 arg1) { + p_ = p; + fun_ = fun; + arg1_ = arg1; + } + virtual ~ObjClosure1() { + } + virtual void Run() { + (p_->*fun_)(arg1_); + } +private: + Obj* p_; + Funct fun_; + Arg1 arg1_; +}; -template +template class ObjClosure2: public ClosureInterface { - public: - ObjClosure2(Obj* p, Funct fun, Arg1 arg1, Arg2 arg2) { - p_ = p; - fun_ = fun; - arg1_ = arg1; - arg2_ = arg2; - } - virtual ~ObjClosure2() { - } - virtual void Run() { - (p_->*fun_)(arg1_, arg2_); - } - private: - Obj* p_; - Funct fun_; - Arg1 arg1_; - Arg2 arg2_; -}; -template +public: + ObjClosure2(Obj* p, Funct fun, Arg1 arg1, Arg2 arg2) { + p_ = p; + fun_ = fun; + arg1_ = arg1; + arg2_ = arg2; + } + virtual ~ObjClosure2() { + } + virtual void Run() { + (p_->*fun_)(arg1_, arg2_); + } +private: + Obj* p_; + Funct fun_; + Arg1 arg1_; + Arg2 arg2_; +}; +template class ObjClosure3: public ClosureInterface { - public: - ObjClosure3(Obj* p, Funct fun, Arg1 arg1, Arg2 arg2, Arg3 arg3) { - p_ = p; - fun_ = fun; - arg1_ = arg1; - arg2_ = arg2; - arg3_ = arg3; - } - virtual ~ObjClosure3() { - } - virtual void Run() { - (p_->*fun_)(arg1_, arg2_, arg3_); - } - private: - Obj* p_; - Funct fun_; - Arg1 arg1_; - Arg2 arg2_; - Arg3 arg3_; -}; +public: + ObjClosure3(Obj* p, Funct fun, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + p_ = p; + fun_ = fun; + arg1_ = arg1; + arg2_ = arg2; + arg3_ = arg3; + } + virtual ~ObjClosure3() { + } + virtual void Run() { + (p_->*fun_)(arg1_, arg2_, arg3_); + } +private: + Obj* p_; + Funct fun_; + Arg1 arg1_; + Arg2 arg2_; + Arg3 arg3_; +}; template -ClosureInterface* NewClosure(R (*fun)()) { - return new Closure0(fun); +ClosureInterface* NewClosure(R(*fun)()) { + return new Closure0(fun); } template -ClosureInterface* NewClosure(R (*fun)(Arg1), Arg1 arg1) { - return new Closure1(fun, arg1); +ClosureInterface* NewClosure(R(*fun)(Arg1), Arg1 arg1) { + return new Closure1(fun, arg1); } template -ClosureInterface* NewClosure(R (*fun)(Arg1, Arg2), Arg1 arg1, Arg2 arg2) { - return new Closure2(fun, arg1, arg2); +ClosureInterface* NewClosure(R(*fun)(Arg1, Arg2), Arg1 arg1, Arg2 arg2) { + return new Closure2(fun, arg1, arg2); } template -ClosureInterface* NewClosure(R (*fun)(Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) { - return new Closure3(fun, arg1, arg2, arg3); +ClosureInterface* NewClosure(R(*fun)(Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return new Closure3(fun, arg1, arg2, arg3); } template -ClosureInterface* NewClosure(Obj* obj, R (Obj::* fun)()) { - return new ObjClosure0(obj, fun); +ClosureInterface* NewClosure(Obj* obj, R(Obj::* fun)()) { + return new ObjClosure0(obj, fun); } template -ClosureInterface* NewClosure(Obj* obj, R (Obj::* fun)(Arg1), Arg1 arg1) { - return new ObjClosure1(obj, fun, arg1); +ClosureInterface* NewClosure(Obj* obj, R(Obj::* fun)(Arg1), Arg1 arg1) { + return new ObjClosure1(obj, fun, arg1); } template -ClosureInterface* NewClosure(Obj* obj, R (Obj::* fun)(Arg1, Arg2), Arg1 arg1, Arg2 arg2) { - return new ObjClosure2(obj, fun, arg1, arg2); +ClosureInterface* NewClosure(Obj* obj, R(Obj::* fun)(Arg1, Arg2), Arg1 arg1, Arg2 arg2) { + return new ObjClosure2(obj, fun, arg1, arg2); } template -ClosureInterface* NewClosure(Obj* obj, R (Obj::* fun)(Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) { - return new ObjClosure3(obj, fun, arg1, arg2, arg3); +ClosureInterface* NewClosure(Obj* obj, R(Obj::* fun)(Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return new ObjClosure3(obj, fun, arg1, arg2, arg3); } } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/Colors.hpp b/libchinese-segmentation/cppjieba/limonp/Colors.hpp index b5db631..e097921 100644 --- a/libchinese-segmentation/cppjieba/limonp/Colors.hpp +++ b/libchinese-segmentation/cppjieba/limonp/Colors.hpp @@ -27,21 +27,21 @@ namespace limonp { using std::string; enum Color { - BLACK = 30, - RED, - GREEN, - YELLOW, - BLUE, - PURPLE + BLACK = 30, + RED, + GREEN, + YELLOW, + BLUE, + PURPLE }; // enum Color static void ColorPrintln(enum Color color, const char * fmt, ...) { - va_list ap; - printf("\033[0;%dm", color); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - printf("\033[0m\n"); // if not \n , in some situation , the next lines will be set the same color unexpectedly + va_list ap; + printf("\033[0;%dm", color); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\033[0m\n"); // if not \n , in some situation , the next lines will be set the same color unexpectedly } } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/Condition.hpp b/libchinese-segmentation/cppjieba/limonp/Condition.hpp index 25920dc..c25abbf 100644 --- a/libchinese-segmentation/cppjieba/limonp/Condition.hpp +++ b/libchinese-segmentation/cppjieba/limonp/Condition.hpp @@ -24,31 +24,31 @@ namespace limonp { class Condition : NonCopyable { - public: - explicit Condition(MutexLock& mutex) - : mutex_(mutex) { - XCHECK(!pthread_cond_init(&pcond_, NULL)); - } +public: + explicit Condition(MutexLock& mutex) + : mutex_(mutex) { + XCHECK(!pthread_cond_init(&pcond_, NULL)); + } - ~Condition() { - XCHECK(!pthread_cond_destroy(&pcond_)); - } + ~Condition() { + XCHECK(!pthread_cond_destroy(&pcond_)); + } - void Wait() { - XCHECK(!pthread_cond_wait(&pcond_, mutex_.GetPthreadMutex())); - } + void Wait() { + XCHECK(!pthread_cond_wait(&pcond_, mutex_.GetPthreadMutex())); + } - void Notify() { - XCHECK(!pthread_cond_signal(&pcond_)); - } + void Notify() { + XCHECK(!pthread_cond_signal(&pcond_)); + } - void NotifyAll() { - XCHECK(!pthread_cond_broadcast(&pcond_)); - } + void NotifyAll() { + XCHECK(!pthread_cond_broadcast(&pcond_)); + } - private: - MutexLock& mutex_; - pthread_cond_t pcond_; +private: + MutexLock& mutex_; + pthread_cond_t pcond_; }; // class Condition } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/Config.hpp b/libchinese-segmentation/cppjieba/limonp/Config.hpp index 6f752ee..101b24e 100644 --- a/libchinese-segmentation/cppjieba/limonp/Config.hpp +++ b/libchinese-segmentation/cppjieba/limonp/Config.hpp @@ -34,86 +34,86 @@ namespace limonp { using namespace std; class Config { - public: - explicit Config(const string& filePath) { - LoadFile(filePath); - } - - operator bool () { - return !map_.empty(); - } - - string Get(const string& key, const string& defaultvalue) const { - map::const_iterator it = map_.find(key); - if(map_.end() != it) { - return it->second; +public: + explicit Config(const string& filePath) { + LoadFile(filePath); } - return defaultvalue; - } - int Get(const string& key, int defaultvalue) const { - string str = Get(key, ""); - if("" == str) { - return defaultvalue; - } - return atoi(str.c_str()); - } - const char* operator [] (const char* key) const { - if(NULL == key) { - return NULL; - } - map::const_iterator it = map_.find(key); - if(map_.end() != it) { - return it->second.c_str(); - } - return NULL; - } - string GetConfigInfo() const { - string res; - res << *this; - return res; - } - - private: - void LoadFile(const string& filePath) { - ifstream ifs(filePath.c_str()); - assert(ifs); - string line; - vector vecBuf; - size_t lineno = 0; - while(getline(ifs, line)) { - lineno ++; - Trim(line); - if(line.empty() || StartsWith(line, "#")) { - continue; - } - vecBuf.clear(); - Split(line, vecBuf, "="); - if(2 != vecBuf.size()) { - fprintf(stderr, "line[%s] illegal.\n", line.c_str()); - assert(false); - continue; - } - string& key = vecBuf[0]; - string& value = vecBuf[1]; - Trim(key); - Trim(value); - if(!map_.insert(make_pair(key, value)).second) { - fprintf(stderr, "key[%s] already exits.\n", key.c_str()); - assert(false); - continue; - } + operator bool () { + return !map_.empty(); } - ifs.close(); - } - friend ostream& operator << (ostream& os, const Config& config); + string Get(const string& key, const string& defaultvalue) const { + map::const_iterator it = map_.find(key); + if(map_.end() != it) { + return it->second; + } + return defaultvalue; + } + int Get(const string& key, int defaultvalue) const { + string str = Get(key, ""); + if("" == str) { + return defaultvalue; + } + return atoi(str.c_str()); + } + const char* operator [](const char* key) const { + if(NULL == key) { + return NULL; + } + map::const_iterator it = map_.find(key); + if(map_.end() != it) { + return it->second.c_str(); + } + return NULL; + } - map map_; + string GetConfigInfo() const { + string res; + res << *this; + return res; + } + +private: + void LoadFile(const string& filePath) { + ifstream ifs(filePath.c_str()); + assert(ifs); + string line; + vector vecBuf; + size_t lineno = 0; + while(getline(ifs, line)) { + lineno ++; + Trim(line); + if(line.empty() || StartsWith(line, "#")) { + continue; + } + vecBuf.clear(); + Split(line, vecBuf, "="); + if(2 != vecBuf.size()) { + fprintf(stderr, "line[%s] illegal.\n", line.c_str()); + assert(false); + continue; + } + string& key = vecBuf[0]; + string& value = vecBuf[1]; + Trim(key); + Trim(value); + if(!map_.insert(make_pair(key, value)).second) { + fprintf(stderr, "key[%s] already exits.\n", key.c_str()); + assert(false); + continue; + } + } + ifs.close(); + } + + friend ostream& operator << (ostream& os, const Config& config); + + map map_; }; // class Config inline ostream& operator << (ostream& os, const Config& config) { - return os << config.map_; + return os << config.map_; } } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/FileLock.hpp b/libchinese-segmentation/cppjieba/limonp/FileLock.hpp index 56b1bae..3cfe5e1 100644 --- a/libchinese-segmentation/cppjieba/limonp/FileLock.hpp +++ b/libchinese-segmentation/cppjieba/limonp/FileLock.hpp @@ -33,58 +33,58 @@ namespace limonp { using std::string; class FileLock { - public: - FileLock() : fd_(-1), ok_(true) { - } - ~FileLock() { - if(fd_ > 0) { - Close(); +public: + FileLock() : fd_(-1), ok_(true) { } - } - void Open(const string& fname) { - assert(fd_ == -1); - fd_ = open(fname.c_str(), O_RDWR | O_CREAT, 0644); - if(fd_ < 0) { - ok_ = false; - err_ = strerror(errno); + ~FileLock() { + if(fd_ > 0) { + Close(); + } } - } - void Close() { - ::close(fd_); - } - void Lock() { - if(LockOrUnlock(fd_, true) < 0) { - ok_ = false; - err_ = strerror(errno); + void Open(const string& fname) { + assert(fd_ == -1); + fd_ = open(fname.c_str(), O_RDWR | O_CREAT, 0644); + if(fd_ < 0) { + ok_ = false; + err_ = strerror(errno); + } } - } - void UnLock() { - if(LockOrUnlock(fd_, false) < 0) { - ok_ = false; - err_ = strerror(errno); + void Close() { + ::close(fd_); + } + void Lock() { + if(LockOrUnlock(fd_, true) < 0) { + ok_ = false; + err_ = strerror(errno); + } + } + void UnLock() { + if(LockOrUnlock(fd_, false) < 0) { + ok_ = false; + err_ = strerror(errno); + } + } + bool Ok() const { + return ok_; + } + string Error() const { + return err_; + } +private: + static int LockOrUnlock(int fd, bool lock) { + errno = 0; + struct flock f; + memset(&f, 0, sizeof(f)); + f.l_type = (lock ? F_WRLCK : F_UNLCK); + f.l_whence = SEEK_SET; + f.l_start = 0; + f.l_len = 0; // Lock/unlock entire file + return fcntl(fd, F_SETLK, &f); } - } - bool Ok() const { - return ok_; - } - string Error() const { - return err_; - } - private: - static int LockOrUnlock(int fd, bool lock) { - errno = 0; - struct flock f; - memset(&f, 0, sizeof(f)); - f.l_type = (lock ? F_WRLCK : F_UNLCK); - f.l_whence = SEEK_SET; - f.l_start = 0; - f.l_len = 0; // Lock/unlock entire file - return fcntl(fd, F_SETLK, &f); - } - int fd_; - bool ok_; - string err_; + int fd_; + bool ok_; + string err_; }; // class FileLock }// namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/LocalVector.hpp b/libchinese-segmentation/cppjieba/limonp/LocalVector.hpp index 8ab1ef4..0eba40b 100644 --- a/libchinese-segmentation/cppjieba/limonp/LocalVector.hpp +++ b/libchinese-segmentation/cppjieba/limonp/LocalVector.hpp @@ -33,123 +33,123 @@ using namespace std; const size_t LOCAL_VECTOR_BUFFER_SIZE = 16; template class LocalVector { - public: - typedef const T* const_iterator ; - typedef T value_type; - typedef size_t size_type; - private: - T buffer_[LOCAL_VECTOR_BUFFER_SIZE]; - T * ptr_; - size_t size_; - size_t capacity_; - public: - LocalVector() { - init_(); - }; - LocalVector(const LocalVector& vec) { - init_(); - *this = vec; - } - LocalVector(const_iterator begin, const_iterator end) { // TODO: make it faster - init_(); - while(begin != end) { - push_back(*begin++); +public: + typedef const T* const_iterator ; + typedef T value_type; + typedef size_t size_type; +private: + T buffer_[LOCAL_VECTOR_BUFFER_SIZE]; + T * ptr_; + size_t size_; + size_t capacity_; +public: + LocalVector() { + init_(); + }; + LocalVector(const LocalVector& vec) { + init_(); + *this = vec; } - } - LocalVector(size_t size, const T& t) { // TODO: make it faster - init_(); - while(size--) { - push_back(t); + LocalVector(const_iterator begin, const_iterator end) { // TODO: make it faster + init_(); + while(begin != end) { + push_back(*begin++); + } } - } - ~LocalVector() { - if(ptr_ != buffer_) { - free(ptr_); + LocalVector(size_t size, const T& t) { // TODO: make it faster + init_(); + while(size--) { + push_back(t); + } } - }; - public: - LocalVector& operator = (const LocalVector& vec) { - clear(); - size_ = vec.size(); - capacity_ = vec.capacity(); - if(vec.buffer_ == vec.ptr_) { - memcpy(buffer_, vec.buffer_, sizeof(T) * size_); - ptr_ = buffer_; - } else { - ptr_ = (T*) malloc(vec.capacity() * sizeof(T)); - assert(ptr_); - memcpy(ptr_, vec.ptr_, vec.size() * sizeof(T)); + ~LocalVector() { + if(ptr_ != buffer_) { + free(ptr_); + } + }; +public: + LocalVector& operator = (const LocalVector& vec) { + clear(); + size_ = vec.size(); + capacity_ = vec.capacity(); + if(vec.buffer_ == vec.ptr_) { + memcpy(buffer_, vec.buffer_, sizeof(T) * size_); + ptr_ = buffer_; + } else { + ptr_ = (T*) malloc(vec.capacity() * sizeof(T)); + assert(ptr_); + memcpy(ptr_, vec.ptr_, vec.size() * sizeof(T)); + } + return *this; } - return *this; - } - private: - void init_() { - ptr_ = buffer_; - size_ = 0; - capacity_ = LOCAL_VECTOR_BUFFER_SIZE; - } - public: - T& operator [] (size_t i) { - return ptr_[i]; - } - const T& operator [] (size_t i) const { - return ptr_[i]; - } - void push_back(const T& t) { - if(size_ == capacity_) { - assert(capacity_); - reserve(capacity_ * 2); +private: + void init_() { + ptr_ = buffer_; + size_ = 0; + capacity_ = LOCAL_VECTOR_BUFFER_SIZE; } - ptr_[size_ ++ ] = t; - } - void reserve(size_t size) { - if(size <= capacity_) { - return; +public: + T& operator [](size_t i) { + return ptr_[i]; } - T * next = (T*)malloc(sizeof(T) * size); - assert(next); - T * old = ptr_; - ptr_ = next; - memcpy(ptr_, old, sizeof(T) * capacity_); - capacity_ = size; - if(old != buffer_) { - free(old); + const T& operator [](size_t i) const { + return ptr_[i]; } - } - bool empty() const { - return 0 == size(); - } - size_t size() const { - return size_; - } - size_t capacity() const { - return capacity_; - } - const_iterator begin() const { - return ptr_; - } - const_iterator end() const { - return ptr_ + size_; - } - void clear() { - if(ptr_ != buffer_) { - free(ptr_); + void push_back(const T& t) { + if(size_ == capacity_) { + assert(capacity_); + reserve(capacity_ * 2); + } + ptr_[size_ ++ ] = t; + } + void reserve(size_t size) { + if(size <= capacity_) { + return; + } + T * next = (T*)malloc(sizeof(T) * size); + assert(next); + T * old = ptr_; + ptr_ = next; + memcpy(ptr_, old, sizeof(T) * capacity_); + capacity_ = size; + if(old != buffer_) { + free(old); + } + } + bool empty() const { + return 0 == size(); + } + size_t size() const { + return size_; + } + size_t capacity() const { + return capacity_; + } + const_iterator begin() const { + return ptr_; + } + const_iterator end() const { + return ptr_ + size_; + } + void clear() { + if(ptr_ != buffer_) { + free(ptr_); + } + init_(); } - init_(); - } }; template ostream & operator << (ostream& os, const LocalVector& vec) { - if(vec.empty()) { - return os << "[]"; - } - os<<"[\""<> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); + // Zeroize sensitive information. + memset((POINTER)x, 0, sizeof(x)); } - } - // Decodes input (unsigned char) into output (UINT4). Assumes len is - // a multiple of 4. - static void Decode( UINT4 *output, unsigned char *input, unsigned int len ) { - unsigned int i, j; + // Encodes input (UINT4) into output (unsigned char). Assumes len is + // a multiple of 4. + static void Encode(unsigned char *output, UINT4 *input, unsigned int len) { + unsigned int i, j; - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | - (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); - } - //#pragma endregion - - - public: - // MAIN FUNCTIONS - MD5() { - Init() ; - } - - // MD5 initialization. Begins an MD5 operation, writing a new context. - void Init() { - context.count[0] = context.count[1] = 0; - - // Load magic initialization constants. - context.state[0] = 0x67452301; - context.state[1] = 0xefcdab89; - context.state[2] = 0x98badcfe; - context.state[3] = 0x10325476; - } - - // MD5 block update operation. Continues an MD5 message-digest - // operation, processing another message block, and updating the - // context. - void Update( - unsigned char *input, // input block - unsigned int inputLen ) { // length of input block - unsigned int i, index, partLen; - - // Compute number of bytes mod 64 - index = (unsigned int)((context.count[0] >> 3) & 0x3F); - - // Update number of bits - if ((context.count[0] += ((UINT4)inputLen << 3)) - < ((UINT4)inputLen << 3)) - context.count[1]++; - context.count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - // Transform as many times as possible. - if (inputLen >= partLen) { - memcpy((POINTER)&context.buffer[index], (POINTER)input, partLen); - MD5Transform (context.state, context.buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform (context.state, &input[i]); - - index = 0; - } else - i = 0; - - /* Buffer remaining input */ - memcpy((POINTER)&context.buffer[index], (POINTER)&input[i], inputLen-i); - } - - // MD5 finalization. Ends an MD5 message-digest operation, writing the - // the message digest and zeroizing the context. - // Writes to digestRaw - void Final() { - unsigned char bits[8]; - unsigned int index, padLen; - - // Save number of bits - Encode( bits, context.count, 8 ); - - // Pad out to 56 mod 64. - index = (unsigned int)((context.count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - Update( PADDING, padLen ); - - // Append length (before padding) - Update( bits, 8 ); - - // Store state in digest - Encode( digestRaw, context.state, 16); - - // Zeroize sensitive information. - memset((POINTER)&context, 0, sizeof (context)); - - writeToString() ; - } - - /// Buffer must be 32+1 (nul) = 33 chars long at least - void writeToString() { - int pos ; - - for( pos = 0 ; pos < 16 ; pos++ ) - sprintf( digestChars+(pos*2), "%02x", digestRaw[pos] ) ; - } - - - public: - // an MD5 digest is a 16-byte number (32 hex digits) - BYTE digestRaw[ 16 ] ; - - // This version of the digest is actually - // a "printf'd" version of the digest. - char digestChars[ 33 ] ; - - /// Load a file from disk and digest it - // Digests a file and returns the result. - const char* digestFile( const char *filename ) { - if (NULL == filename || strcmp(filename, "") == 0) - return NULL; - - Init() ; - - FILE *file; - - unsigned char buffer[1024] ; - - if((file = fopen (filename, "rb")) == NULL) { - return NULL; + for(i = 0, j = 0; j < len; i++, j += 4) { + output[j] = (unsigned char)(input[i] & 0xff); + output[j + 1] = (unsigned char)((input[i] >> 8) & 0xff); + output[j + 2] = (unsigned char)((input[i] >> 16) & 0xff); + output[j + 3] = (unsigned char)((input[i] >> 24) & 0xff); + } } - int len; - while( (len = fread( buffer, 1, 1024, file )) ) - Update( buffer, len ) ; - Final(); - fclose( file ); + // Decodes input (unsigned char) into output (UINT4). Assumes len is + // a multiple of 4. + static void Decode(UINT4 *output, unsigned char *input, unsigned int len) { + unsigned int i, j; - return digestChars ; - } + for(i = 0, j = 0; j < len; i++, j += 4) + output[i] = ((UINT4)input[j]) | (((UINT4)input[j + 1]) << 8) | + (((UINT4)input[j + 2]) << 16) | (((UINT4)input[j + 3]) << 24); + } + //#pragma endregion - /// Digests a byte-array already in memory - const char* digestMemory( BYTE *memchunk, int len ) { - if (NULL == memchunk) - return NULL; - Init() ; - Update( memchunk, len ) ; - Final() ; +public: + // MAIN FUNCTIONS + MD5() { + Init() ; + } - return digestChars ; - } + // MD5 initialization. Begins an MD5 operation, writing a new context. + void Init() { + context.count[0] = context.count[1] = 0; - // Digests a string and prints the result. - const char* digestString(const char *string ) { - if (string == NULL) - return NULL; + // Load magic initialization constants. + context.state[0] = 0x67452301; + context.state[1] = 0xefcdab89; + context.state[2] = 0x98badcfe; + context.state[3] = 0x10325476; + } - Init() ; - Update( (unsigned char*)string, strlen(string) ) ; - Final() ; + // MD5 block update operation. Continues an MD5 message-digest + // operation, processing another message block, and updating the + // context. + void Update( + unsigned char *input, // input block + unsigned int inputLen) { // length of input block + unsigned int i, index, partLen; - return digestChars ; - } + // Compute number of bytes mod 64 + index = (unsigned int)((context.count[0] >> 3) & 0x3F); + + // Update number of bits + if((context.count[0] += ((UINT4)inputLen << 3)) + < ((UINT4)inputLen << 3)) + context.count[1]++; + context.count[1] += ((UINT4)inputLen >> 29); + + partLen = 64 - index; + + // Transform as many times as possible. + if(inputLen >= partLen) { + memcpy((POINTER)&context.buffer[index], (POINTER)input, partLen); + MD5Transform(context.state, context.buffer); + + for(i = partLen; i + 63 < inputLen; i += 64) + MD5Transform(context.state, &input[i]); + + index = 0; + } else + i = 0; + + /* Buffer remaining input */ + memcpy((POINTER)&context.buffer[index], (POINTER)&input[i], inputLen - i); + } + + // MD5 finalization. Ends an MD5 message-digest operation, writing the + // the message digest and zeroizing the context. + // Writes to digestRaw + void Final() { + unsigned char bits[8]; + unsigned int index, padLen; + + // Save number of bits + Encode(bits, context.count, 8); + + // Pad out to 56 mod 64. + index = (unsigned int)((context.count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + Update(PADDING, padLen); + + // Append length (before padding) + Update(bits, 8); + + // Store state in digest + Encode(digestRaw, context.state, 16); + + // Zeroize sensitive information. + memset((POINTER)&context, 0, sizeof(context)); + + writeToString() ; + } + + /// Buffer must be 32+1 (nul) = 33 chars long at least + void writeToString() { + int pos ; + + for(pos = 0 ; pos < 16 ; pos++) + sprintf(digestChars + (pos * 2), "%02x", digestRaw[pos]) ; + } + + +public: + // an MD5 digest is a 16-byte number (32 hex digits) + BYTE digestRaw[ 16 ] ; + + // This version of the digest is actually + // a "printf'd" version of the digest. + char digestChars[ 33 ] ; + + /// Load a file from disk and digest it + // Digests a file and returns the result. + const char* digestFile(const char *filename) { + if(NULL == filename || strcmp(filename, "") == 0) + return NULL; + + Init() ; + + FILE *file; + + unsigned char buffer[1024] ; + + if((file = fopen(filename, "rb")) == NULL) { + return NULL; + } + int len; + while((len = fread(buffer, 1, 1024, file))) + Update(buffer, len) ; + Final(); + + fclose(file); + + return digestChars ; + } + + /// Digests a byte-array already in memory + const char* digestMemory(BYTE *memchunk, int len) { + if(NULL == memchunk) + return NULL; + + Init() ; + Update(memchunk, len) ; + Final() ; + + return digestChars ; + } + + // Digests a string and prints the result. + const char* digestString(const char *string) { + if(string == NULL) + return NULL; + + Init() ; + Update((unsigned char*)string, strlen(string)) ; + Final() ; + + return digestChars ; + } }; inline bool md5String(const char* str, std::string& res) { - if (NULL == str) { - res = ""; - return false; - } + if(NULL == str) { + res = ""; + return false; + } - MD5 md5; - const char *pRes = md5.digestString(str); - if (NULL == pRes) { - res = ""; - return false; - } + MD5 md5; + const char *pRes = md5.digestString(str); + if(NULL == pRes) { + res = ""; + return false; + } - res = pRes; - return true; + res = pRes; + return true; } inline bool md5File(const char* filepath, std::string& res) { - if (NULL == filepath || strcmp(filepath, "") == 0) { - res = ""; - return false; - } + if(NULL == filepath || strcmp(filepath, "") == 0) { + res = ""; + return false; + } - MD5 md5; - const char *pRes = md5.digestFile(filepath); + MD5 md5; + const char *pRes = md5.digestFile(filepath); - if (NULL == pRes) { - res = ""; - return false; - } + if(NULL == pRes) { + res = ""; + return false; + } - res = pRes; - return true; + res = pRes; + return true; } } #endif diff --git a/libchinese-segmentation/cppjieba/limonp/MutexLock.hpp b/libchinese-segmentation/cppjieba/limonp/MutexLock.hpp index c303943..ebe8a07 100644 --- a/libchinese-segmentation/cppjieba/limonp/MutexLock.hpp +++ b/libchinese-segmentation/cppjieba/limonp/MutexLock.hpp @@ -26,40 +26,40 @@ namespace limonp { class MutexLock: NonCopyable { - public: - MutexLock() { - XCHECK(!pthread_mutex_init(&mutex_, NULL)); - } - ~MutexLock() { - XCHECK(!pthread_mutex_destroy(&mutex_)); - } - pthread_mutex_t* GetPthreadMutex() { - return &mutex_; - } +public: + MutexLock() { + XCHECK(!pthread_mutex_init(&mutex_, NULL)); + } + ~MutexLock() { + XCHECK(!pthread_mutex_destroy(&mutex_)); + } + pthread_mutex_t* GetPthreadMutex() { + return &mutex_; + } - private: - void Lock() { - XCHECK(!pthread_mutex_lock(&mutex_)); - } - void Unlock() { - XCHECK(!pthread_mutex_unlock(&mutex_)); - } - friend class MutexLockGuard; +private: + void Lock() { + XCHECK(!pthread_mutex_lock(&mutex_)); + } + void Unlock() { + XCHECK(!pthread_mutex_unlock(&mutex_)); + } + friend class MutexLockGuard; - pthread_mutex_t mutex_; + pthread_mutex_t mutex_; }; // class MutexLock class MutexLockGuard: NonCopyable { - public: - explicit MutexLockGuard(MutexLock & mutex) - : mutex_(mutex) { - mutex_.Lock(); - } - ~MutexLockGuard() { - mutex_.Unlock(); - } - private: - MutexLock & mutex_; +public: + explicit MutexLockGuard(MutexLock & mutex) + : mutex_(mutex) { + mutex_.Lock(); + } + ~MutexLockGuard() { + mutex_.Unlock(); + } +private: + MutexLock & mutex_; }; // class MutexLockGuard #define MutexLockGuard(x) XCHECK(false); diff --git a/libchinese-segmentation/cppjieba/limonp/NonCopyable.hpp b/libchinese-segmentation/cppjieba/limonp/NonCopyable.hpp index 1718890..b224f2c 100644 --- a/libchinese-segmentation/cppjieba/limonp/NonCopyable.hpp +++ b/libchinese-segmentation/cppjieba/limonp/NonCopyable.hpp @@ -22,14 +22,14 @@ namespace limonp { class NonCopyable { - protected: - NonCopyable() { - } - ~NonCopyable() { - } - private: - NonCopyable(const NonCopyable& ); - const NonCopyable& operator=(const NonCopyable& ); +protected: + NonCopyable() { + } + ~NonCopyable() { + } +private: + NonCopyable(const NonCopyable&); + const NonCopyable& operator=(const NonCopyable&); }; // class NonCopyable } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/StdExtension.hpp b/libchinese-segmentation/cppjieba/limonp/StdExtension.hpp index 3d0aac0..173bcb2 100644 --- a/libchinese-segmentation/cppjieba/limonp/StdExtension.hpp +++ b/libchinese-segmentation/cppjieba/limonp/StdExtension.hpp @@ -51,123 +51,123 @@ namespace std { template ostream& operator << (ostream& os, const vector& v) { - if(v.empty()) { - return os << "[]"; - } - os<<"["< inline ostream& operator << (ostream& os, const vector& v) { - if(v.empty()) { - return os << "[]"; - } - os<<"[\""< ostream& operator << (ostream& os, const deque& dq) { - if(dq.empty()) { - return os << "[]"; - } - os<<"[\""< ostream& operator << (ostream& os, const pair& pr) { - os << pr.first << ":" << pr.second ; - return os; + os << pr.first << ":" << pr.second ; + return os; } template string& operator << (string& str, const T& obj) { - stringstream ss; - ss << obj; // call ostream& operator << (ostream& os, - return str = ss.str(); + stringstream ss; + ss << obj; // call ostream& operator << (ostream& os, + return str = ss.str(); } template ostream& operator << (ostream& os, const map& mp) { - if(mp.empty()) { - os<<"{}"; - return os; - } - os<<'{'; - typename map::const_iterator it = mp.begin(); - os<<*it; - it++; - while(it != mp.end()) { - os<<", "<<*it; + if(mp.empty()) { + os << "{}"; + return os; + } + os << '{'; + typename map::const_iterator it = mp.begin(); + os << *it; it++; - } - os<<'}'; - return os; + while(it != mp.end()) { + os << ", " << *it; + it++; + } + os << '}'; + return os; } template ostream& operator << (ostream& os, const std::unordered_map& mp) { - if(mp.empty()) { - return os << "{}"; - } - os<<'{'; - typename std::unordered_map::const_iterator it = mp.begin(); - os<<*it; - it++; - while(it != mp.end()) { - os<<", "<<*it++; - } - return os<<'}'; + if(mp.empty()) { + return os << "{}"; + } + os << '{'; + typename std::unordered_map::const_iterator it = mp.begin(); + os << *it; + it++; + while(it != mp.end()) { + os << ", " << *it++; + } + return os << '}'; } template ostream& operator << (ostream& os, const set& st) { - if(st.empty()) { - os << "{}"; - return os; - } - os<<'{'; - typename set::const_iterator it = st.begin(); - os<<*it; - it++; - while(it != st.end()) { - os<<", "<<*it; + if(st.empty()) { + os << "{}"; + return os; + } + os << '{'; + typename set::const_iterator it = st.begin(); + os << *it; it++; - } - os<<'}'; - return os; + while(it != st.end()) { + os << ", " << *it; + it++; + } + os << '}'; + return os; } template bool IsIn(const ContainType& contain, const KeyType& key) { - return contain.end() != contain.find(key); + return contain.end() != contain.find(key); } template basic_string & operator << (basic_string & s, ifstream & ifs) { - return s.assign((istreambuf_iterator(ifs)), istreambuf_iterator()); + return s.assign((istreambuf_iterator(ifs)), istreambuf_iterator()); } template ofstream & operator << (ofstream & ofs, const basic_string& s) { - ostreambuf_iterator itr (ofs); - copy(s.begin(), s.end(), itr); - return ofs; + ostreambuf_iterator itr(ofs); + copy(s.begin(), s.end(), itr); + return ofs; } } // namespace std diff --git a/libchinese-segmentation/cppjieba/limonp/StringUtil.hpp b/libchinese-segmentation/cppjieba/limonp/StringUtil.hpp index 43c8c69..c785193 100644 --- a/libchinese-segmentation/cppjieba/limonp/StringUtil.hpp +++ b/libchinese-segmentation/cppjieba/limonp/StringUtil.hpp @@ -44,339 +44,339 @@ namespace limonp { using namespace std; inline string StringFormat(const char* fmt, ...) { - int size = 256; - std::string str; - va_list ap; - while (1) { - str.resize(size); - va_start(ap, fmt); - int n = vsnprintf((char *)str.c_str(), size, fmt, ap); - va_end(ap); - if (n > -1 && n < size) { - str.resize(n); - return str; + int size = 256; + std::string str; + va_list ap; + while(1) { + str.resize(size); + va_start(ap, fmt); + int n = vsnprintf((char *)str.c_str(), size, fmt, ap); + va_end(ap); + if(n > -1 && n < size) { + str.resize(n); + return str; + } + if(n > -1) + size = n + 1; + else + size *= 2; } - if (n > -1) - size = n + 1; - else - size *= 2; - } - return str; + return str; } template void Join(T begin, T end, string& res, const string& connector) { - if(begin == end) { - return; - } - stringstream ss; - ss<<*begin; - begin++; - while(begin != end) { - ss << connector << *begin; - begin ++; - } - res = ss.str(); + if(begin == end) { + return; + } + stringstream ss; + ss << *begin; + begin++; + while(begin != end) { + ss << connector << *begin; + begin ++; + } + res = ss.str(); } template string Join(T begin, T end, const string& connector) { - string res; - Join(begin ,end, res, connector); - return res; + string res; + Join(begin, end, res, connector); + return res; } inline string& Upper(string& str) { - transform(str.begin(), str.end(), str.begin(), (int (*)(int))toupper); - return str; + transform(str.begin(), str.end(), str.begin(), (int (*)(int))toupper); + return str; } inline string& Lower(string& str) { - transform(str.begin(), str.end(), str.begin(), (int (*)(int))tolower); - return str; + transform(str.begin(), str.end(), str.begin(), (int (*)(int))tolower); + return str; } inline bool IsSpace(unsigned c) { - // when passing large int as the argument of isspace, it core dump, so here need a type cast. - return c > 0xff ? false : std::isspace(c & 0xff) != 0; + // when passing large int as the argument of isspace, it core dump, so here need a type cast. + return c > 0xff ? false : std::isspace(c & 0xff) != 0; } inline std::string& LTrim(std::string &s) { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(IsSpace)))); - return s; + s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(IsSpace)))); + return s; } inline std::string& RTrim(std::string &s) { - s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(IsSpace))).base(), s.end()); - return s; + s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(IsSpace))).base(), s.end()); + return s; } inline std::string& Trim(std::string &s) { - return LTrim(RTrim(s)); + return LTrim(RTrim(s)); } inline std::string& LTrim(std::string & s, char x) { - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::bind2nd(std::equal_to(), x)))); - return s; + s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::bind2nd(std::equal_to(), x)))); + return s; } inline std::string& RTrim(std::string & s, char x) { - s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::bind2nd(std::equal_to(), x))).base(), s.end()); - return s; + s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::bind2nd(std::equal_to(), x))).base(), s.end()); + return s; } inline std::string& Trim(std::string &s, char x) { - return LTrim(RTrim(s, x), x); + return LTrim(RTrim(s, x), x); } inline void Split(const string& src, vector& res, const string& pattern, size_t maxsplit = string::npos) { - res.clear(); - size_t Start = 0; - size_t end = 0; - string sub; - while(Start < src.size()) { - end = src.find_first_of(pattern, Start); - if(string::npos == end || res.size() >= maxsplit) { - sub = src.substr(Start); - res.push_back(sub); - return; + res.clear(); + size_t Start = 0; + size_t end = 0; + string sub; + while(Start < src.size()) { + end = src.find_first_of(pattern, Start); + if(string::npos == end || res.size() >= maxsplit) { + sub = src.substr(Start); + res.push_back(sub); + return; + } + sub = src.substr(Start, end - Start); + res.push_back(sub); + Start = end + 1; } - sub = src.substr(Start, end - Start); - res.push_back(sub); - Start = end + 1; - } - return; + return; } inline vector Split(const string& src, const string& pattern, size_t maxsplit = string::npos) { - vector res; - Split(src, res, pattern, maxsplit); - return res; + vector res; + Split(src, res, pattern, maxsplit); + return res; } inline bool StartsWith(const string& str, const string& prefix) { - if(prefix.length() > str.length()) { - return false; - } - return 0 == str.compare(0, prefix.length(), prefix); + if(prefix.length() > str.length()) { + return false; + } + return 0 == str.compare(0, prefix.length(), prefix); } inline bool EndsWith(const string& str, const string& suffix) { - if(suffix.length() > str.length()) { - return false; - } - return 0 == str.compare(str.length() - suffix.length(), suffix.length(), suffix); + if(suffix.length() > str.length()) { + return false; + } + return 0 == str.compare(str.length() - suffix.length(), suffix.length(), suffix); } inline bool IsInStr(const string& str, char ch) { - return str.find(ch) != string::npos; + return str.find(ch) != string::npos; } inline uint16_t TwocharToUint16(char high, char low) { - return (((uint16_t(high) & 0x00ff ) << 8) | (uint16_t(low) & 0x00ff)); + return (((uint16_t(high) & 0x00ff) << 8) | (uint16_t(low) & 0x00ff)); } template bool Utf8ToUnicode(const char * const str, size_t len, Uint16Container& vec) { - if(!str) { - return false; - } - char ch1, ch2; - uint16_t tmp; - vec.clear(); - for(size_t i = 0; i < len;) { - if(!(str[i] & 0x80)) { // 0xxxxxxx - vec.push_back(str[i]); - i++; - } else if ((uint8_t)str[i] <= 0xdf && i + 1 < len) { // 110xxxxxx - ch1 = (str[i] >> 2) & 0x07; - ch2 = (str[i+1] & 0x3f) | ((str[i] & 0x03) << 6 ); - tmp = (((uint16_t(ch1) & 0x00ff ) << 8) | (uint16_t(ch2) & 0x00ff)); - vec.push_back(tmp); - i += 2; - } else if((uint8_t)str[i] <= 0xef && i + 2 < len) { - ch1 = ((uint8_t)str[i] << 4) | ((str[i+1] >> 2) & 0x0f ); - ch2 = (((uint8_t)str[i+1]<<6) & 0xc0) | (str[i+2] & 0x3f); - tmp = (((uint16_t(ch1) & 0x00ff ) << 8) | (uint16_t(ch2) & 0x00ff)); - vec.push_back(tmp); - i += 3; - } else { - return false; + if(!str) { + return false; } - } - return true; + char ch1, ch2; + uint16_t tmp; + vec.clear(); + for(size_t i = 0; i < len;) { + if(!(str[i] & 0x80)) { // 0xxxxxxx + vec.push_back(str[i]); + i++; + } else if((uint8_t)str[i] <= 0xdf && i + 1 < len) { // 110xxxxxx + ch1 = (str[i] >> 2) & 0x07; + ch2 = (str[i + 1] & 0x3f) | ((str[i] & 0x03) << 6); + tmp = (((uint16_t(ch1) & 0x00ff) << 8) | (uint16_t(ch2) & 0x00ff)); + vec.push_back(tmp); + i += 2; + } else if((uint8_t)str[i] <= 0xef && i + 2 < len) { + ch1 = ((uint8_t)str[i] << 4) | ((str[i + 1] >> 2) & 0x0f); + ch2 = (((uint8_t)str[i + 1] << 6) & 0xc0) | (str[i + 2] & 0x3f); + tmp = (((uint16_t(ch1) & 0x00ff) << 8) | (uint16_t(ch2) & 0x00ff)); + vec.push_back(tmp); + i += 3; + } else { + return false; + } + } + return true; } template bool Utf8ToUnicode(const string& str, Uint16Container& vec) { - return Utf8ToUnicode(str.c_str(), str.size(), vec); + return Utf8ToUnicode(str.c_str(), str.size(), vec); } template bool Utf8ToUnicode32(const string& str, Uint32Container& vec) { - uint32_t tmp; - vec.clear(); - for(size_t i = 0; i < str.size();) { - if(!(str[i] & 0x80)) { // 0xxxxxxx - // 7bit, total 7bit - tmp = (uint8_t)(str[i]) & 0x7f; - i++; - } else if ((uint8_t)str[i] <= 0xdf && i + 1 < str.size()) { // 110xxxxxx - // 5bit, total 5bit - tmp = (uint8_t)(str[i]) & 0x1f; + uint32_t tmp; + vec.clear(); + for(size_t i = 0; i < str.size();) { + if(!(str[i] & 0x80)) { // 0xxxxxxx + // 7bit, total 7bit + tmp = (uint8_t)(str[i]) & 0x7f; + i++; + } else if((uint8_t)str[i] <= 0xdf && i + 1 < str.size()) { // 110xxxxxx + // 5bit, total 5bit + tmp = (uint8_t)(str[i]) & 0x1f; - // 6bit, total 11bit - tmp <<= 6; - tmp |= (uint8_t)(str[i+1]) & 0x3f; - i += 2; - } else if((uint8_t)str[i] <= 0xef && i + 2 < str.size()) { // 1110xxxxxx - // 4bit, total 4bit - tmp = (uint8_t)(str[i]) & 0x0f; + // 6bit, total 11bit + tmp <<= 6; + tmp |= (uint8_t)(str[i + 1]) & 0x3f; + i += 2; + } else if((uint8_t)str[i] <= 0xef && i + 2 < str.size()) { // 1110xxxxxx + // 4bit, total 4bit + tmp = (uint8_t)(str[i]) & 0x0f; - // 6bit, total 10bit - tmp <<= 6; - tmp |= (uint8_t)(str[i+1]) & 0x3f; + // 6bit, total 10bit + tmp <<= 6; + tmp |= (uint8_t)(str[i + 1]) & 0x3f; - // 6bit, total 16bit - tmp <<= 6; - tmp |= (uint8_t)(str[i+2]) & 0x3f; + // 6bit, total 16bit + tmp <<= 6; + tmp |= (uint8_t)(str[i + 2]) & 0x3f; - i += 3; - } else if((uint8_t)str[i] <= 0xf7 && i + 3 < str.size()) { // 11110xxxx - // 3bit, total 3bit - tmp = (uint8_t)(str[i]) & 0x07; + i += 3; + } else if((uint8_t)str[i] <= 0xf7 && i + 3 < str.size()) { // 11110xxxx + // 3bit, total 3bit + tmp = (uint8_t)(str[i]) & 0x07; - // 6bit, total 9bit - tmp <<= 6; - tmp |= (uint8_t)(str[i+1]) & 0x3f; + // 6bit, total 9bit + tmp <<= 6; + tmp |= (uint8_t)(str[i + 1]) & 0x3f; - // 6bit, total 15bit - tmp <<= 6; - tmp |= (uint8_t)(str[i+2]) & 0x3f; + // 6bit, total 15bit + tmp <<= 6; + tmp |= (uint8_t)(str[i + 2]) & 0x3f; - // 6bit, total 21bit - tmp <<= 6; - tmp |= (uint8_t)(str[i+3]) & 0x3f; + // 6bit, total 21bit + tmp <<= 6; + tmp |= (uint8_t)(str[i + 3]) & 0x3f; - i += 4; - } else { - return false; + i += 4; + } else { + return false; + } + vec.push_back(tmp); } - vec.push_back(tmp); - } - return true; + return true; } template void Unicode32ToUtf8(Uint32ContainerConIter begin, Uint32ContainerConIter end, string& res) { - res.clear(); - uint32_t ui; - while(begin != end) { - ui = *begin; - if(ui <= 0x7f) { - res += char(ui); - } else if(ui <= 0x7ff) { - res += char(((ui >> 6) & 0x1f) | 0xc0); - res += char((ui & 0x3f) | 0x80); - } else if(ui <= 0xffff) { - res += char(((ui >> 12) & 0x0f) | 0xe0); - res += char(((ui >> 6) & 0x3f) | 0x80); - res += char((ui & 0x3f) | 0x80); - } else { - res += char(((ui >> 18) & 0x03) | 0xf0); - res += char(((ui >> 12) & 0x3f) | 0x80); - res += char(((ui >> 6) & 0x3f) | 0x80); - res += char((ui & 0x3f) | 0x80); + res.clear(); + uint32_t ui; + while(begin != end) { + ui = *begin; + if(ui <= 0x7f) { + res += char(ui); + } else if(ui <= 0x7ff) { + res += char(((ui >> 6) & 0x1f) | 0xc0); + res += char((ui & 0x3f) | 0x80); + } else if(ui <= 0xffff) { + res += char(((ui >> 12) & 0x0f) | 0xe0); + res += char(((ui >> 6) & 0x3f) | 0x80); + res += char((ui & 0x3f) | 0x80); + } else { + res += char(((ui >> 18) & 0x03) | 0xf0); + res += char(((ui >> 12) & 0x3f) | 0x80); + res += char(((ui >> 6) & 0x3f) | 0x80); + res += char((ui & 0x3f) | 0x80); + } + begin ++; } - begin ++; - } } template void UnicodeToUtf8(Uint16ContainerConIter begin, Uint16ContainerConIter end, string& res) { - res.clear(); - uint16_t ui; - while(begin != end) { - ui = *begin; - if(ui <= 0x7f) { - res += char(ui); - } else if(ui <= 0x7ff) { - res += char(((ui>>6) & 0x1f) | 0xc0); - res += char((ui & 0x3f) | 0x80); - } else { - res += char(((ui >> 12) & 0x0f )| 0xe0); - res += char(((ui>>6) & 0x3f )| 0x80 ); - res += char((ui & 0x3f) | 0x80); + res.clear(); + uint16_t ui; + while(begin != end) { + ui = *begin; + if(ui <= 0x7f) { + res += char(ui); + } else if(ui <= 0x7ff) { + res += char(((ui >> 6) & 0x1f) | 0xc0); + res += char((ui & 0x3f) | 0x80); + } else { + res += char(((ui >> 12) & 0x0f) | 0xe0); + res += char(((ui >> 6) & 0x3f) | 0x80); + res += char((ui & 0x3f) | 0x80); + } + begin ++; } - begin ++; - } } template bool GBKTrans(const char* const str, size_t len, Uint16Container& vec) { - vec.clear(); - if(!str) { - return true; - } - size_t i = 0; - while(i < len) { - if(0 == (str[i] & 0x80)) { - vec.push_back(uint16_t(str[i])); - i++; - } else { - if(i + 1 < len) { //&& (str[i+1] & 0x80)) - uint16_t tmp = (((uint16_t(str[i]) & 0x00ff ) << 8) | (uint16_t(str[i+1]) & 0x00ff)); - vec.push_back(tmp); - i += 2; - } else { - return false; - } + vec.clear(); + if(!str) { + return true; } - } - return true; + size_t i = 0; + while(i < len) { + if(0 == (str[i] & 0x80)) { + vec.push_back(uint16_t(str[i])); + i++; + } else { + if(i + 1 < len) { //&& (str[i+1] & 0x80)) + uint16_t tmp = (((uint16_t(str[i]) & 0x00ff) << 8) | (uint16_t(str[i + 1]) & 0x00ff)); + vec.push_back(tmp); + i += 2; + } else { + return false; + } + } + } + return true; } template bool GBKTrans(const string& str, Uint16Container& vec) { - return GBKTrans(str.c_str(), str.size(), vec); + return GBKTrans(str.c_str(), str.size(), vec); } template void GBKTrans(Uint16ContainerConIter begin, Uint16ContainerConIter end, string& res) { - res.clear(); - //pair pa; - char first, second; - while(begin != end) { - //pa = uint16ToChar2(*begin); - first = ((*begin)>>8) & 0x00ff; - second = (*begin) & 0x00ff; - if(first & 0x80) { - res += first; - res += second; - } else { - res += second; + res.clear(); + //pair pa; + char first, second; + while(begin != end) { + //pa = uint16ToChar2(*begin); + first = ((*begin) >> 8) & 0x00ff; + second = (*begin) & 0x00ff; + if(first & 0x80) { + res += first; + res += second; + } else { + res += second; + } + begin++; } - begin++; - } } /* * format example: "%Y-%m-%d %H:%M:%S" */ inline void GetTime(const string& format, string& timeStr) { - time_t timeNow; - time(&timeNow); - timeStr.resize(64); - size_t len = strftime((char*)timeStr.c_str(), timeStr.size(), format.c_str(), localtime(&timeNow)); - timeStr.resize(len); + time_t timeNow; + time(&timeNow); + timeStr.resize(64); + size_t len = strftime((char*)timeStr.c_str(), timeStr.size(), format.c_str(), localtime(&timeNow)); + timeStr.resize(len); } inline string PathJoin(const string& path1, const string& path2) { - if(EndsWith(path1, "/")) { - return path1 + path2; - } - return path1 + "/" + path2; + if(EndsWith(path1, "/")) { + return path1 + path2; + } + return path1 + "/" + path2; } } diff --git a/libchinese-segmentation/cppjieba/limonp/Thread.hpp b/libchinese-segmentation/cppjieba/limonp/Thread.hpp index b140adf..4db0a3c 100644 --- a/libchinese-segmentation/cppjieba/limonp/Thread.hpp +++ b/libchinese-segmentation/cppjieba/limonp/Thread.hpp @@ -25,36 +25,36 @@ namespace limonp { class IThread: NonCopyable { - public: - IThread(): isStarted(false), isJoined(false) { - } - virtual ~IThread() { - if(isStarted && !isJoined) { - XCHECK(!pthread_detach(thread_)); +public: + IThread(): isStarted(false), isJoined(false) { } - }; + virtual ~IThread() { + if(isStarted && !isJoined) { + XCHECK(!pthread_detach(thread_)); + } + }; - virtual void Run() = 0; - void Start() { - XCHECK(!isStarted); - XCHECK(!pthread_create(&thread_, NULL, Worker, this)); - isStarted = true; - } - void Join() { - XCHECK(!isJoined); - XCHECK(!pthread_join(thread_, NULL)); - isJoined = true; - } - private: - static void * Worker(void * data) { - IThread * ptr = (IThread* ) data; - ptr->Run(); - return NULL; - } + virtual void Run() = 0; + void Start() { + XCHECK(!isStarted); + XCHECK(!pthread_create(&thread_, NULL, Worker, this)); + isStarted = true; + } + void Join() { + XCHECK(!isJoined); + XCHECK(!pthread_join(thread_, NULL)); + isJoined = true; + } +private: + static void * Worker(void * data) { + IThread * ptr = (IThread*) data; + ptr->Run(); + return NULL; + } - pthread_t thread_; - bool isStarted; - bool isJoined; + pthread_t thread_; + bool isStarted; + bool isJoined; }; // class IThread } // namespace limonp diff --git a/libchinese-segmentation/cppjieba/limonp/ThreadPool.hpp b/libchinese-segmentation/cppjieba/limonp/ThreadPool.hpp index d9520ac..47a5c97 100644 --- a/libchinese-segmentation/cppjieba/limonp/ThreadPool.hpp +++ b/libchinese-segmentation/cppjieba/limonp/ThreadPool.hpp @@ -30,73 +30,73 @@ using namespace std; //class ThreadPool; class ThreadPool: NonCopyable { - public: - class Worker: public IThread { - public: - Worker(ThreadPool* pool): ptThreadPool_(pool) { - assert(ptThreadPool_); - } - virtual ~Worker() { - } - - virtual void Run() { - while (true) { - ClosureInterface* closure = ptThreadPool_->queue_.Pop(); - if (closure == NULL) { - break; +public: + class Worker: public IThread { + public: + Worker(ThreadPool* pool): ptThreadPool_(pool) { + assert(ptThreadPool_); } - try { - closure->Run(); - } catch(std::exception& e) { - XLOG(ERROR) << e.what(); - } catch(...) { - XLOG(ERROR) << " unknown exception."; + virtual ~Worker() { } - delete closure; - } - } - private: - ThreadPool * ptThreadPool_; - }; // class Worker - ThreadPool(size_t thread_num) - : threads_(thread_num), - queue_(thread_num) { - assert(thread_num); - for(size_t i = 0; i < threads_.size(); i ++) { - threads_[i] = new Worker(this); - } - } - ~ThreadPool() { - Stop(); - } + virtual void Run() { + while(true) { + ClosureInterface* closure = ptThreadPool_->queue_.Pop(); + if(closure == NULL) { + break; + } + try { + closure->Run(); + } catch(std::exception& e) { + XLOG(ERROR) << e.what(); + } catch(...) { + XLOG(ERROR) << " unknown exception."; + } + delete closure; + } + } + private: + ThreadPool * ptThreadPool_; + }; // class Worker - void Start() { - for(size_t i = 0; i < threads_.size(); i++) { - threads_[i]->Start(); + ThreadPool(size_t thread_num) + : threads_(thread_num), + queue_(thread_num) { + assert(thread_num); + for(size_t i = 0; i < threads_.size(); i ++) { + threads_[i] = new Worker(this); + } } - } - void Stop() { - for(size_t i = 0; i < threads_.size(); i ++) { - queue_.Push(NULL); + ~ThreadPool() { + Stop(); } - for(size_t i = 0; i < threads_.size(); i ++) { - threads_[i]->Join(); - delete threads_[i]; + + void Start() { + for(size_t i = 0; i < threads_.size(); i++) { + threads_[i]->Start(); + } + } + void Stop() { + for(size_t i = 0; i < threads_.size(); i ++) { + queue_.Push(NULL); + } + for(size_t i = 0; i < threads_.size(); i ++) { + threads_[i]->Join(); + delete threads_[i]; + } + threads_.clear(); } - threads_.clear(); - } - void Add(ClosureInterface* task) { - assert(task); - queue_.Push(task); - } + void Add(ClosureInterface* task) { + assert(task); + queue_.Push(task); + } - private: - friend class Worker; +private: + friend class Worker; - vector threads_; - BoundedBlockingQueue queue_; + vector threads_; + BoundedBlockingQueue queue_; }; // class ThreadPool } // namespace limonp diff --git a/libfriso/friso-interface.c b/libfriso/friso-interface.c index 1c4dad6..83bfd7f 100644 --- a/libfriso/friso-interface.c +++ b/libfriso/friso-interface.c @@ -30,19 +30,18 @@ break; println("+---------------------------------------------------------------+"); //read a line from a command line. -static fstring getLine( FILE *fp, fstring __dst ) -{ +static fstring getLine(FILE *fp, fstring __dst) { register int c; register fstring cs; cs = __dst; - while ( ( c = getc( fp ) ) != EOF ) { - if ( c == '\n' ) break; + while((c = getc(fp)) != EOF) { + if(c == '\n') break; *cs++ = c; } *cs = '\0'; - return ( c == EOF && cs == __dst ) ? NULL : __dst; + return (c == EOF && cs == __dst) ? NULL : __dst; } /*static void printcode( fstring str ) { @@ -56,8 +55,7 @@ static fstring getLine( FILE *fp, fstring __dst ) }*/ //int friso_test(int argc, char **argv) -int friso_test() -{ +int friso_test() { clock_t s_time, e_time; char line[__INPUT_LENGTH__] = {0}; @@ -76,7 +74,7 @@ int friso_test() // } __path__ = "/usr/share/ukui-search/res/friso.ini"; - if ( __path__ == NULL ) { + if(__path__ == NULL) { println("Usage: friso -init lexicon path"); exit(0); } @@ -90,12 +88,12 @@ int friso_test() friso_dic_load_from_ifile( dic, __path__, __LENGTH__ ); friso_set_dic( friso, dic ); friso_set_mode( friso, __FRISO_COMPLEX_MODE__ );*/ - if ( friso_init_from_ifile(friso, config, __path__) != 1 ) { + if(friso_init_from_ifile(friso, config, __path__) != 1) { printf("fail to initialize friso and config.\n"); goto err; } - switch ( config->mode ) { + switch(config->mode) { case __FRISO_SIMPLE_MODE__: mode = "Simple"; break; @@ -114,29 +112,29 @@ int friso_test() e_time = clock(); - printf("Initialized in %fsec\n", (double) ( e_time - s_time ) / CLOCKS_PER_SEC ); + printf("Initialized in %fsec\n", (double)(e_time - s_time) / CLOCKS_PER_SEC); printf("Mode: %s\n", mode); - printf("+-Version: %s (%s)\n", friso_version(), friso->charset == FRISO_UTF8 ? "UTF-8" : "GBK" ); + printf("+-Version: %s (%s)\n", friso_version(), friso->charset == FRISO_UTF8 ? "UTF-8" : "GBK"); ___ABOUT___; //set the task. task = friso_new_task(); - while ( 1 ) { + while(1) { print("friso>> "); - getLine( stdin, line ); + getLine(stdin, line); //exit the programe - if (strcasecmp( line, "quit") == 0) { + if(strcasecmp(line, "quit") == 0) { ___EXIT_INFO___ } //for ( i = 0; i < 1000000; i++ ) { //set the task text. - friso_set_text( task, line ); + friso_set_text(task, line); println("分词结果:"); s_time = clock(); - while ( ( config->next_token( friso, config, task ) ) != NULL ) { + while((config->next_token(friso, config, task)) != NULL) { printf( "%s[%d, %d, %d] ", task->token->word, @@ -148,7 +146,7 @@ int friso_test() } //} e_time = clock(); - printf("\nDone, cost < %fsec\n", ( (double)(e_time - s_time) ) / CLOCKS_PER_SEC ); + printf("\nDone, cost < %fsec\n", ((double)(e_time - s_time)) / CLOCKS_PER_SEC); } diff --git a/libfriso/friso/src/friso.c b/libfriso/friso/src/friso.c index 1dda627..8cd5821 100644 --- a/libfriso/friso/src/friso.c +++ b/libfriso/friso/src/friso.c @@ -1,7 +1,7 @@ /* * friso main source file with the the friso main functions implemented. * starts with friso_ in the friso header file "friso.h"; - * + * * @author lionsoul */ @@ -18,12 +18,11 @@ //friso instance about function /* {{{ create a new friso configuration variable. */ -FRISO_API friso_t friso_new( void ) -{ - friso_t e = ( friso_t ) FRISO_MALLOC( sizeof( friso_entry ) ); - if ( e == NULL ) { +FRISO_API friso_t friso_new(void) { + friso_t e = (friso_t) FRISO_MALLOC(sizeof(friso_entry)); + if(e == NULL) { ___ALLOCATION_ERROR___ - } + } e->dic = NULL; e->charset = FRISO_UTF8; //set default charset UTF8. @@ -33,12 +32,11 @@ FRISO_API friso_t friso_new( void ) /* }}} */ /* {{{ creat a new friso with initialize item from a configuration file. - * + * * @return 1 for successfully and 0 for failed. */ -FRISO_API int friso_init_from_ifile( - friso_t friso, friso_config_t config, fstring __ifile ) -{ +FRISO_API int friso_init_from_ifile( + friso_t friso, friso_config_t config, fstring __ifile) { FILE *__stream; char __chars__[256], __key__[128], *__line__; char __lexi__[160], lexpath[160]; @@ -48,23 +46,23 @@ FRISO_API int friso_init_from_ifile( uint_t flen = 0; //get the base part of the path of the __ifile - if ( (slimiter = strrchr(__ifile, '/')) != NULL ) { + if((slimiter = strrchr(__ifile, '/')) != NULL) { flen = slimiter - __ifile + 1; } //yat, start to parse the friso.ini configuration file - if ( ( __stream = fopen( __ifile, "rb" ) ) != NULL ) { + if((__stream = fopen(__ifile, "rb")) != NULL) { //initialize the entry with the value from the ifile. - while ( ( __line__ = file_get_line( __chars__, __stream ) ) != NULL ) { + while((__line__ = file_get_line(__chars__, __stream)) != NULL) { //comments filter. - if ( __line__[0] == '#' ) continue; - if ( __line__[0] == '\t' ) continue; - if ( __line__[0] == ' ' || __line__[0] == '\0' ) continue; + if(__line__[0] == '#') continue; + if(__line__[0] == '\t') continue; + if(__line__[0] == ' ' || __line__[0] == '\0') continue; - __length__ = strlen( __line__ ); - for ( i = 0; i < __length__; i++ ) { - if ( __line__[i] == ' ' - || __line__[i] == '\t' || __line__[i] == '=' ) { + __length__ = strlen(__line__); + for(i = 0; i < __length__; i++) { + if(__line__[i] == ' ' + || __line__[i] == '\t' || __line__[i] == '=') { break; } __key__[i] = __line__[i]; @@ -72,68 +70,68 @@ FRISO_API int friso_init_from_ifile( __key__[i] = '\0'; //position the euqals char '='. - if ( __line__[i] == ' ' || __line__[i] == '\t' ) { - for ( i++ ; i < __length__; i++ ) { - if ( __line__[i] == '=' ) { - break; + if(__line__[i] == ' ' || __line__[i] == '\t') { + for(i++ ; i < __length__; i++) { + if(__line__[i] == '=') { + break; } } - } + } //clear the left whitespace of the value. - for ( i++; i < __length__ - && ( __line__[i] == ' ' || __line__[i] == '\t' ); i++ ); - for ( t = 0; i < __length__; i++, t++ ) { - if ( __line__[i] == ' ' || __line__[i] == '\t' ) { + for(i++; i < __length__ + && (__line__[i] == ' ' || __line__[i] == '\t'); i++); + for(t = 0; i < __length__; i++, t++) { + if(__line__[i] == ' ' || __line__[i] == '\t') { break; } - __line__[t] = __line__[i]; - } + __line__[t] = __line__[i]; + } __line__[t] = '\0'; //printf("key=%s, value=%s\n", __key__, __line__ ); - if ( strcmp( __key__, "friso.lex_dir" ) == 0 ) { + if(strcmp(__key__, "friso.lex_dir") == 0) { /* * here copy the value of the lex_dir. * cause we need the value of friso.max_len to finish all * the work when we call function friso_dic_load_from_ifile to * initiliaze the friso dictionary. */ - if ( __hit__ == 0 ) { + if(__hit__ == 0) { __hit__ = t; - for ( t = 0; t < __hit__; t++ ) { + for(t = 0; t < __hit__; t++) { __lexi__[t] = __line__[t]; } __lexi__[t] = '\0'; - } - } else if ( strcmp( __key__, "friso.max_len" ) == 0 ) { - config->max_len = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.r_name" ) == 0 ) { - config->r_name = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.mix_len" ) == 0 ) { - config->mix_len = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.lna_len" ) == 0 ) { - config->lna_len = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.add_syn" ) == 0 ) { - config->add_syn = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.clr_stw" ) == 0 ) { - config->clr_stw = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.keep_urec" ) == 0 ) { - config->keep_urec = ( uint_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.spx_out" ) == 0 ) { - config->spx_out = ( ushort_t ) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.nthreshold" ) == 0 ) { - config->nthreshold = atoi( __line__ ); - } else if ( strcmp( __key__, "friso.mode" ) == 0 ) { + } + } else if(strcmp(__key__, "friso.max_len") == 0) { + config->max_len = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.r_name") == 0) { + config->r_name = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.mix_len") == 0) { + config->mix_len = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.lna_len") == 0) { + config->lna_len = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.add_syn") == 0) { + config->add_syn = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.clr_stw") == 0) { + config->clr_stw = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.keep_urec") == 0) { + config->keep_urec = (uint_t) atoi(__line__); + } else if(strcmp(__key__, "friso.spx_out") == 0) { + config->spx_out = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.nthreshold") == 0) { + config->nthreshold = atoi(__line__); + } else if(strcmp(__key__, "friso.mode") == 0) { //config->mode = ( friso_mode_t ) atoi( __line__ ); - friso_set_mode(config, (friso_mode_t) atoi( __line__ )); - } else if ( strcmp( __key__, "friso.charset" ) == 0 ) { - friso->charset = (friso_charset_t) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.en_sseg") == 0 ) { - config->en_sseg = (ushort_t) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.st_minl") == 0 ) { - config->st_minl = (ushort_t) atoi( __line__ ); - } else if ( strcmp( __key__, "friso.kpuncs") == 0 ) { + friso_set_mode(config, (friso_mode_t) atoi(__line__)); + } else if(strcmp(__key__, "friso.charset") == 0) { + friso->charset = (friso_charset_t) atoi(__line__); + } else if(strcmp(__key__, "friso.en_sseg") == 0) { + config->en_sseg = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.st_minl") == 0) { + config->st_minl = (ushort_t) atoi(__line__); + } else if(strcmp(__key__, "friso.kpuncs") == 0) { //t is the length of the __line__. memcpy(config->kpuncs, __line__, t); //printf("friso_init_from_ifile#kpuncs: %s\n", config->kpuncs); @@ -145,18 +143,18 @@ FRISO_API int friso_init_from_ifile( * use the setting from the ifile parse above * we copied the value in the __lexi__ */ - if ( __hit__ != 0 ) { + if(__hit__ != 0) { //add relative path search support //@added: 2014-05-24 //convert the relative path to absolute path base on the path of friso.ini //improved at @date: 2014-10-26 #ifdef FRISO_WINNT - if ( __lexi__[1] != ':' && flen != 0 ) { + if(__lexi__[1] != ':' && flen != 0) { #else - if ( __lexi__[0] != '/' && flen != 0 ) { + if(__lexi__[0] != '/' && flen != 0) { #endif - if ( (flen + __hit__) > sizeof(lexpath) - 1 ) { + if((flen + __hit__) > sizeof(lexpath) - 1) { fprintf(stderr, "[Error]: Buffer is not long enough to hold the final lexicon path"); fprintf(stderr, " with a length of {%d} at function friso.c#friso_init_from_ifile", flen + __hit__); return 0; @@ -166,28 +164,28 @@ FRISO_API int friso_init_from_ifile( memcpy(lexpath + flen, __lexi__, __hit__ - 1); //count the new length flen = flen + __hit__ - 1; - if ( lexpath[flen-1] != '/' ) lexpath[flen] = '/'; - lexpath[flen+1] = '\0'; + if(lexpath[flen - 1] != '/') lexpath[flen] = '/'; + lexpath[flen + 1] = '\0'; } else { memcpy(lexpath, __lexi__, __hit__); lexpath[__hit__] = '\0'; - if ( lexpath[__hit__ - 1] != '/' ) { + if(lexpath[__hit__ - 1] != '/') { lexpath[__hit__] = '/'; - lexpath[__hit__+1] = '\0'; + lexpath[__hit__ + 1] = '\0'; } } friso->dic = friso_dic_new(); //add charset check for max word length counting - friso_dic_load_from_ifile( friso, config, - lexpath, config->max_len * (friso->charset == FRISO_UTF8 ? 3 : 2) ); + friso_dic_load_from_ifile(friso, config, + lexpath, config->max_len * (friso->charset == FRISO_UTF8 ? 3 : 2)); } else { - fprintf(stderr, "[Error]: failed get lexicon path, check lex_dir in friso.ini \n"); - return 0; + fprintf(stderr, "[Error]: failed get lexicon path, check lex_dir in friso.ini \n"); + return 0; } - fclose( __stream ); + fclose(__stream); return 1; } @@ -198,24 +196,22 @@ FRISO_API int friso_init_from_ifile( /* {{{ friso free functions. * here we have to free its dictionary. */ -FRISO_API void friso_free( friso_t friso ) -{ +FRISO_API void friso_free(friso_t friso) { //free the dictionary - if ( friso->dic != NULL ) { - friso_dic_free( friso->dic ); + if(friso->dic != NULL) { + friso_dic_free(friso->dic); } - FRISO_FREE( friso ); + FRISO_FREE(friso); } /* }}} */ /* {{{ set the current split mode * view the friso.h#friso_mode_t */ -FRISO_API void friso_set_mode( friso_config_t config, friso_mode_t mode ) -{ +FRISO_API void friso_set_mode(friso_config_t config, friso_mode_t mode) { config->mode = mode; - switch ( config->mode ) { + switch(config->mode) { case __FRISO_SIMPLE_MODE__: config->next_token = next_mmseg_token; config->next_cjk = next_simple_cjk; @@ -231,13 +227,12 @@ FRISO_API void friso_set_mode( friso_config_t config, friso_mode_t mode ) } /* }}} */ -/* {{{ create a new friso configuration entry and initialize +/* {{{ create a new friso configuration entry and initialize * it with default value.*/ -FRISO_API friso_config_t friso_new_config( void ) -{ - friso_config_t cfg = (friso_config_t) - FRISO_MALLOC(sizeof(friso_config_entry)); - if ( cfg == NULL ) { +FRISO_API friso_config_t friso_new_config(void) { + friso_config_t cfg = (friso_config_t) + FRISO_MALLOC(sizeof(friso_config_entry)); + if(cfg == NULL) { ___ALLOCATION_ERROR___; } @@ -249,8 +244,7 @@ FRISO_API friso_config_t friso_new_config( void ) /* }}} */ /* {{{ initialize the specified friso config entry with default value.*/ -FRISO_API void friso_init_config( friso_config_t cfg ) -{ +FRISO_API void friso_init_config(friso_config_t cfg) { cfg->max_len = DEFAULT_SEGMENT_LENGTH; cfg->r_name = 1; cfg->mix_len = DEFAULT_MIX_LENGTH; @@ -262,7 +256,7 @@ FRISO_API void friso_init_config( friso_config_t cfg ) cfg->en_sseg = 1; //default start the secondary segmentaion. cfg->st_minl = 1; //min length for secondary split sub token. cfg->nthreshold = DEFAULT_NTHRESHOLD; - cfg->mode = ( friso_mode_t ) DEFAULT_SEGMENT_MODE; + cfg->mode = (friso_mode_t) DEFAULT_SEGMENT_MODE; friso_set_mode(cfg, cfg->mode); @@ -273,10 +267,9 @@ FRISO_API void friso_init_config( friso_config_t cfg ) /* {{{ create a new segment task entry. */ -FRISO_API friso_task_t friso_new_task() -{ - friso_task_t task = ( friso_task_t ) FRISO_MALLOC( sizeof( friso_task_entry ) ); - if ( task == NULL ) { +FRISO_API friso_task_t friso_new_task() { + friso_task_t task = (friso_task_t) FRISO_MALLOC(sizeof(friso_task_entry)); + if(task == NULL) { ___ALLOCATION_ERROR___ } @@ -296,33 +289,31 @@ FRISO_API friso_task_t friso_new_task() /* }}} */ /* {{{ free the specified task*/ -FRISO_API void friso_free_task( friso_task_t task ) -{ +FRISO_API void friso_free_task(friso_task_t task) { //free the allocation of the poll link list. - if ( task->pool != NULL ) { - free_link_list( task->pool ); + if(task->pool != NULL) { + free_link_list(task->pool); } //release the allocation of the sbuff string_buffer_t. - if ( task->sbuf != NULL ) { + if(task->sbuf != NULL) { free_string_buffer(task->sbuf); } //free the allocations of the token. - if ( task->token != NULL ) { - friso_free_token( task->token ); + if(task->token != NULL) { + friso_free_token(task->token); } - FRISO_FREE( task ); + FRISO_FREE(task); } /* }}} */ /* {{{ create a new friso token */ -FRISO_API friso_token_t friso_new_token( void ) -{ - friso_token_t token = ( friso_token_t ) - FRISO_MALLOC( sizeof( friso_token_entry ) ); - if ( token == NULL ) { +FRISO_API friso_token_t friso_new_token(void) { + friso_token_t token = (friso_token_t) + FRISO_MALLOC(sizeof(friso_token_entry)); + if(token == NULL) { ___ALLOCATION_ERROR___ } @@ -343,35 +334,33 @@ FRISO_API friso_token_t friso_new_token( void ) * also we have to reset the idx and the length of the segmentation. * and the most important one - clear the poll link list. */ -FRISO_API void friso_set_text( - friso_task_t task, fstring text ) -{ +FRISO_API void friso_set_text( + friso_task_t task, fstring text) { task->text = text; task->idx = 0; //reset the index - task->length = strlen( text ); - task->pool = link_list_clear( task->pool ); //clear the word poll - string_buffer_clear( task->sbuf ); //crear the string buffer. + task->length = strlen(text); + task->pool = link_list_clear(task->pool); //clear the word poll + string_buffer_clear(task->sbuf); //crear the string buffer. } /* }}} */ //-------------------------------------------------------------------- //friso core part 1: simple mode tokenize handler functions /* {{{ read the next word from the current position. - * + * * @return int the bytes of the readed word. */ -__STATIC_API__ uint_t readNextWord( - friso_t friso, //friso instance - friso_task_t task, //token task - uint_t *idx, //current index. - fstring __word ) //work buffer. -{ - if ( friso->charset == FRISO_UTF8 ) { +__STATIC_API__ uint_t readNextWord( + friso_t friso, //friso instance + friso_task_t task, //token task + uint_t *idx, //current index. + fstring __word) { //work buffer. + if(friso->charset == FRISO_UTF8) { //@reader: task->unicode = get_utf8_unicode(task->buffer) is moved insite // function utf8_next_word from friso 1.6.0 . - return utf8_next_word( task, idx, __word ); - } else if ( friso->charset == FRISO_GBK ) { - return gbk_next_word( task, idx, __word ); + return utf8_next_word(task, idx, __word); + } else if(friso->charset == FRISO_GBK) { + return gbk_next_word(task, idx, __word); } return 0; //unknow charset. @@ -380,14 +369,13 @@ __STATIC_API__ uint_t readNextWord( /* {{{ get the next cjk word from the current position, with simple mode. */ -FRISO_API lex_entry_t next_simple_cjk( - friso_t friso, - friso_config_t config, - friso_task_t task ) -{ +FRISO_API lex_entry_t next_simple_cjk( + friso_t friso, + friso_config_t config, + friso_task_t task) { uint_t t, idx = task->idx, __length__; - string_buffer_t sb = new_string_buffer_with_string( task->buffer ); - lex_entry_t e = friso_dic_get( friso->dic, __LEX_CJK_WORDS__, sb->buffer ); + string_buffer_t sb = new_string_buffer_with_string(task->buffer); + lex_entry_t e = friso_dic_get(friso->dic, __LEX_CJK_WORDS__, sb->buffer); /* * here bak the e->length in the task->token->type. @@ -396,35 +384,35 @@ FRISO_API lex_entry_t next_simple_cjk( */ __length__ = e->length; - for ( t = 1; t < config->max_len - && ( task->bytes = readNextWord( - friso, task, &idx, task->buffer ) ) != 0; t++ ) { - if ( friso_whitespace( friso->charset, task ) ) break; - if ( ! friso_cn_string( friso->charset, task ) ) break; + for(t = 1; t < config->max_len + && (task->bytes = readNextWord( + friso, task, &idx, task->buffer)) != 0; t++) { + if(friso_whitespace(friso->charset, task)) break; + if(! friso_cn_string(friso->charset, task)) break; - string_buffer_append( sb, task->buffer ); + string_buffer_append(sb, task->buffer); //check the existence of the word by search the dictionary. - if ( friso_dic_match( friso->dic, - __LEX_CJK_WORDS__, sb->buffer ) ) { - e = friso_dic_get( friso->dic, - __LEX_CJK_WORDS__, sb->buffer ); + if(friso_dic_match(friso->dic, + __LEX_CJK_WORDS__, sb->buffer)) { + e = friso_dic_get(friso->dic, + __LEX_CJK_WORDS__, sb->buffer); } } //correct the offset of the segment. - task->idx += ( e->length - __length__ ); - free_string_buffer( sb ); //free the buffer + task->idx += (e->length - __length__); + free_string_buffer(sb); //free the buffer /* * check the stopwords dictionary, * make sure the current tokenzier is not stopwords. * @warning: friso.clr_stw must be open in friso.ini configuration file. */ - if ( config->clr_stw - && friso_dic_match( friso->dic, - __LEX_STOPWORDS__, e->word ) ) { - return NULL; + if(config->clr_stw + && friso_dic_match(friso->dic, + __LEX_STOPWORDS__, e->word)) { + return NULL; } return e; @@ -434,7 +422,7 @@ FRISO_API lex_entry_t next_simple_cjk( //------------------------------------------------------------------- //friso core part 2: basic latin handler functions /* {{{ basic latin segmentation*/ -/*convert full-width char to half-width*/ +/*convert full-width char to half-width*/ #define convert_full_to_half( friso, task, convert ) \ do {\ if ( friso_fullwidth_en_char( friso->charset, task ) ) { \ @@ -476,11 +464,10 @@ FRISO_API lex_entry_t next_simple_cjk( //get the next latin word from the current position. -__STATIC_API__ lex_entry_t next_basic_latin( - friso_t friso, - friso_config_t config, - friso_task_t task ) -{ +__STATIC_API__ lex_entry_t next_basic_latin( + friso_t friso, + friso_config_t config, + friso_task_t task) { int __convert = 0, t = 0, blen = 0; int chkecm = 0, chkunits = 1, wspace = 0; @@ -503,51 +490,51 @@ __STATIC_API__ lex_entry_t next_basic_latin( task_ssseg_close(task); //full-half width and upper-lower case exchange. - convert_full_to_half( friso, task, __convert ); - convert_upper_to_lower( friso, task, __convert ); - convert_work_apply( friso, task, __convert ); + convert_full_to_half(friso, task, __convert); + convert_upper_to_lower(friso, task, __convert); + convert_work_apply(friso, task, __convert); //creat a new fstring buffer and append the task->buffer insite. - sb = new_string_buffer_with_string( task->buffer ); - _TYPE = friso_enchar_type( friso->charset, task ); + sb = new_string_buffer_with_string(task->buffer); + _TYPE = friso_enchar_type(friso->charset, task); //segmentation. - while ( ( task->bytes = readNextWord( - friso, task, &idx, task->buffer ) ) != 0 ) { + while((task->bytes = readNextWord( + friso, task, &idx, task->buffer)) != 0) { //convert full-width to half-width. convert_full_to_half(friso, task, __convert); - _ctype = friso_enchar_type( friso->charset, task ); + _ctype = friso_enchar_type(friso->charset, task); - if ( _ctype == FRISO_EN_WHITESPACE ) { + if(_ctype == FRISO_EN_WHITESPACE) { wspace = 1; break; } - if ( _ctype == FRISO_EN_PUNCTUATION ) { + if(_ctype == FRISO_EN_PUNCTUATION) { //clear the full-width punctuations. - if ( task->bytes > 1 ) break; - if ( ! friso_en_kpunc( config, task->buffer[0] ) ) break; + if(task->bytes > 1) break; + if(! friso_en_kpunc(config, task->buffer[0])) break; } /* check if is an FRISO_EN_NUMERIC, or FRISO_EN_LETTER. * here just need to make sure it is not FRISO_EN_UNKNOW. * */ - if ( _ctype == FRISO_EN_UNKNOW ) { - if ( friso_cn_string( friso->charset, task ) ) chkecm = 1; + if(_ctype == FRISO_EN_UNKNOW) { + if(friso_cn_string(friso->charset, task)) chkecm = 1; break; } //upper-lower case convert - convert_upper_to_lower( friso, task, __convert ); - convert_work_apply( friso, task, __convert ); + convert_upper_to_lower(friso, task, __convert); + convert_work_apply(friso, task, __convert); //sound a little crazy, i did't limit the length of this //@Added: 2015-01-16 night - if ( (wlen + task->bytes) >= __HITS_WORD_LENGTH__ ) { + if((wlen + task->bytes) >= __HITS_WORD_LENGTH__) { break; } - string_buffer_append( sb, task->buffer ); + string_buffer_append(sb, task->buffer); wlen += task->bytes; task->idx += task->bytes; @@ -556,14 +543,14 @@ __STATIC_API__ lex_entry_t next_basic_latin( * * @TODO: 2013-12-22 * */ - if ( _ctype != _TYPE ) { + if(_ctype != _TYPE) { tcount++; _TYPE = _ctype; } } /* - * 1. clear the useless english punctuation + * 1. clear the useless english punctuation * from the end of the buffer. * 2. check the english and punctuation mixed word. * @@ -572,15 +559,15 @@ __STATIC_API__ lex_entry_t next_basic_latin( * to avoid the secondary check for work like 'c+', 'chenxin.'. */ _ctype = 0; - for ( ; sb->length > 0 - && sb->buffer[ sb->length - 1 ] != '%' - && is_en_punctuation( - friso->charset, sb->buffer[ sb->length - 1 ] ); ) { + for(; sb->length > 0 + && sb->buffer[ sb->length - 1 ] != '%' + && is_en_punctuation( + friso->charset, sb->buffer[ sb->length - 1 ]);) { //check the english punctuation mixed word. - if ( friso_dic_match( friso->dic, - __LEX_ENPUN_WORDS__, sb->buffer ) ) { - e = friso_dic_get(friso->dic, - __LEX_ENPUN_WORDS__, sb->buffer); + if(friso_dic_match(friso->dic, + __LEX_ENPUN_WORDS__, sb->buffer)) { + e = friso_dic_get(friso->dic, + __LEX_ENPUN_WORDS__, sb->buffer); chkunits = 0; break; } @@ -591,7 +578,7 @@ __STATIC_API__ lex_entry_t next_basic_latin( task->idx--; /*check and plus the tcount*/ - if ( _ctype == 0 ) { + if(_ctype == 0) { tcount--; _ctype = 1; } @@ -601,49 +588,49 @@ __STATIC_API__ lex_entry_t next_basic_latin( ssseg = (tcount > 1) && (chkunits == 1); //check the tokenize loop is break by whitespace. - // no need for all the following work if it is. + // no need for all the following work if it is. //@added 2013-11-19 - if ( wspace == 1 || task->idx == task->length ) { + if(wspace == 1 || task->idx == task->length) { blen = sb->length; - e = new_lex_entry( string_buffer_devote(sb), NULL, 0, blen, __LEX_OTHER_WORDS__ ); + e = new_lex_entry(string_buffer_devote(sb), NULL, 0, blen, __LEX_OTHER_WORDS__); e->rlen = wlen; //set the secondary mask. - if ( ssseg ) task_ssseg_open(task); + if(ssseg) task_ssseg_open(task); return e; } - if ( chkecm != 1 ) { + if(chkecm != 1) { /* * check the single words unit. * not only the chinese word but also other kinds of word. * so we can recongnize the complex unit like '℉,℃'' eg.. * @date 2013-10-14 */ - if ( chkunits - && ( friso_numeric_string( friso->charset, sb->buffer ) - || friso_decimal_string( friso->charset, sb->buffer ) ) ) { + if(chkunits + && (friso_numeric_string(friso->charset, sb->buffer) + || friso_decimal_string(friso->charset, sb->buffer))) { idx = task->idx; - if ( ( task->bytes = readNextWord( - friso, task, &idx, task->buffer ) ) != 0 ) { + if((task->bytes = readNextWord( + friso, task, &idx, task->buffer)) != 0) { //check the EC dictionary. - if ( friso_dic_match( friso->dic, - __LEX_CJK_UNITS__, task->buffer ) ) { + if(friso_dic_match(friso->dic, + __LEX_CJK_UNITS__, task->buffer)) { fdunits = 1; string_buffer_append(sb, task->buffer); wlen += task->bytes; task->idx += task->bytes; } } - } + } //set the START_SS_MASK - if ( fdunits != 1 && ssseg ) { + if(fdunits != 1 && ssseg) { task_ssseg_open(task); } //creat the lexicon entry and return it. blen = sb->length; - e = new_lex_entry( string_buffer_devote(sb), NULL, 0, blen, __LEX_OTHER_WORDS__ ); + e = new_lex_entry(string_buffer_devote(sb), NULL, 0, blen, __LEX_OTHER_WORDS__); e->rlen = wlen; return e; @@ -651,40 +638,40 @@ __STATIC_API__ lex_entry_t next_basic_latin( //Try to find a english chinese mixed word. - tmp = new_string_buffer_with_string( sb->buffer ); + tmp = new_string_buffer_with_string(sb->buffer); idx = task->idx; - for ( t = 0; t < config->mix_len - && ( task->bytes = readNextWord( - friso, task, &idx, task->buffer ) ) != 0; t++ ) { + for(t = 0; t < config->mix_len + && (task->bytes = readNextWord( + friso, task, &idx, task->buffer)) != 0; t++) { //if ( ! friso_cn_string( friso->charset, task ) ) { // task->idx -= task->bytes; // break; //} //replace with the whitespace check. - //more complex mixed words could be find here. + //more complex mixed words could be find here. // (no only english and chinese mix word) //@date 2013-10-14 - if ( friso_whitespace( friso->charset, task ) ) { + if(friso_whitespace(friso->charset, task)) { break; } - string_buffer_append( tmp, task->buffer ); + string_buffer_append(tmp, task->buffer); //check the mixed word dictionary. - if ( friso_dic_match( friso->dic, - __LEX_ECM_WORDS__, tmp->buffer ) ) { - e = friso_dic_get( friso->dic, - __LEX_ECM_WORDS__, tmp->buffer ); + if(friso_dic_match(friso->dic, + __LEX_ECM_WORDS__, tmp->buffer)) { + e = friso_dic_get(friso->dic, + __LEX_ECM_WORDS__, tmp->buffer); } } - free_string_buffer( tmp ); + free_string_buffer(tmp); /* e is not NULL does't mean it must be EC mixed word. * it could be an english and punctuation mixed word, like 'c++' * But we don't need to check and set the START_SS_MASK mask here. * */ - if ( e != NULL ) { + if(e != NULL) { task->idx += (e->length - sb->length); free_string_buffer(sb); return e; @@ -692,17 +679,17 @@ __STATIC_API__ lex_entry_t next_basic_latin( //no match for mix word, try to find a single unit. - if ( chkunits - && ( friso_numeric_string( friso->charset, sb->buffer ) - || friso_decimal_string( friso->charset, sb->buffer ) ) ) { + if(chkunits + && (friso_numeric_string(friso->charset, sb->buffer) + || friso_decimal_string(friso->charset, sb->buffer))) { idx = task->idx; - if ( ( task->bytes = readNextWord( - friso, task, &idx, task->buffer ) ) != 0 ) { + if((task->bytes = readNextWord( + friso, task, &idx, task->buffer)) != 0) { //check the single chinese units dictionary. - if ( friso_dic_match( friso->dic, - __LEX_CJK_UNITS__, task->buffer ) ) { + if(friso_dic_match(friso->dic, + __LEX_CJK_UNITS__, task->buffer)) { fdunits = 1; - string_buffer_append( sb, task->buffer ); + string_buffer_append(sb, task->buffer); wlen += task->bytes; task->idx += task->bytes; } @@ -710,13 +697,13 @@ __STATIC_API__ lex_entry_t next_basic_latin( } //set the START_SS_MASK. - if ( fdunits != 1 && ssseg ) { - task_ssseg_open(task); + if(fdunits != 1 && ssseg) { + task_ssseg_open(task); } //create the lexicon entry and return it. blen = sb->length; - e = new_lex_entry( string_buffer_devote(sb), NULL, 0, blen, __LEX_OTHER_WORDS__ ); + e = new_lex_entry(string_buffer_devote(sb), NULL, 0, blen, __LEX_OTHER_WORDS__); e->rlen = wlen; return e; @@ -726,56 +713,55 @@ __STATIC_API__ lex_entry_t next_basic_latin( //------------------------------------------------------------------- //friso core part 3: mmseg tokenize implements functions -//mmseg algorithm implemented functions - start +//mmseg algorithm implemented functions - start /* {{{ get the next match from the current position, * throught the dictionary this will return all the matchs. * * @return friso_array_t that contains all the matchs. */ -__STATIC_API__ friso_array_t get_next_match( - friso_t friso, - friso_config_t config, - friso_task_t task, - uint_t idx ) -{ +__STATIC_API__ friso_array_t get_next_match( + friso_t friso, + friso_config_t config, + friso_task_t task, + uint_t idx) { register uint_t t; - string_buffer_t sb = new_string_buffer_with_string( task->buffer ); + string_buffer_t sb = new_string_buffer_with_string(task->buffer); //create a match dynamic array. - friso_array_t match = new_array_list_with_opacity( config->max_len ); + friso_array_t match = new_array_list_with_opacity(config->max_len); array_list_add(match, friso_dic_get(friso->dic, __LEX_CJK_WORDS__, task->buffer)); - for ( t = 1; t < config->max_len && ( task->bytes = - readNextWord( friso, task, &idx, task->buffer ) ) != 0; t++ ) { - if ( friso_whitespace( friso->charset, task ) ) break; - if ( ! friso_cn_string( friso->charset, task ) ) break; + for(t = 1; t < config->max_len && (task->bytes = + readNextWord(friso, task, &idx, task->buffer)) != 0; t++) { + if(friso_whitespace(friso->charset, task)) break; + if(! friso_cn_string(friso->charset, task)) break; //append the task->buffer to the buffer. - string_buffer_append( sb, task->buffer ); + string_buffer_append(sb, task->buffer); //check the CJK dictionary. - if ( friso_dic_match( friso->dic, - __LEX_CJK_WORDS__, sb->buffer ) ) { + if(friso_dic_match(friso->dic, + __LEX_CJK_WORDS__, sb->buffer)) { /* * add the lex_entry_t insite. * here is a key point: - * we use friso_dic_get function + * we use friso_dic_get function * to get the address of the lex_entry_cdt - * that store in the dictionary, + * that store in the dictionary, * not create a new lex_entry_cdt. * so : - * 1.we will not bother to the allocations of + * 1.we will not bother to the allocations of * the newly created lex_entry_cdt. * 2.more efficient of course. */ - array_list_add( match, friso_dic_get( - friso->dic, __LEX_CJK_WORDS__, sb->buffer ) ); + array_list_add(match, friso_dic_get( + friso->dic, __LEX_CJK_WORDS__, sb->buffer)); } } /*buffer allocations clear*/ - free_string_buffer( sb ); + free_string_buffer(sb); //array_list_trim( match ); return match; @@ -794,12 +780,11 @@ typedef friso_chunk_entry * friso_chunk_t; /* }}} */ /* {{{ create a new chunks*/ -__STATIC_API__ friso_chunk_t new_chunk( - friso_array_t words, uint_t length ) -{ - friso_chunk_t chunk = ( friso_chunk_t ) - FRISO_MALLOC( sizeof( friso_chunk_entry ) ); - if ( chunk == NULL ) { +__STATIC_API__ friso_chunk_t new_chunk( + friso_array_t words, uint_t length) { + friso_chunk_t chunk = (friso_chunk_t) + FRISO_MALLOC(sizeof(friso_chunk_entry)); + if(chunk == NULL) { ___ALLOCATION_ERROR___ } @@ -814,18 +799,16 @@ __STATIC_API__ friso_chunk_t new_chunk( /* }}} */ /* {{{ free the specified chunk */ -__STATIC_API__ void free_chunk( friso_chunk_t chunk ) -{ - FRISO_FREE( chunk ); +__STATIC_API__ void free_chunk(friso_chunk_t chunk) { + FRISO_FREE(chunk); } /* }}} */ /* {{{ a static function to count the average word length * of the given chunk. */ -__STATIC_API__ float count_chunk_avl( friso_chunk_t chunk ) -{ - chunk->average_word_length = +__STATIC_API__ float count_chunk_avl(friso_chunk_t chunk) { + chunk->average_word_length = ((float) chunk->length) / chunk->words->length; return chunk->average_word_length; } @@ -834,14 +817,13 @@ __STATIC_API__ float count_chunk_avl( friso_chunk_t chunk ) /* {{{ a static function to count the word length variance * of the given chunk. */ -__STATIC_API__ float count_chunk_var( friso_chunk_t chunk ) -{ +__STATIC_API__ float count_chunk_var(friso_chunk_t chunk) { float var = 0, tmp = 0; //snapshot register uint_t t; lex_entry_t e; - for ( t = 0; t < chunk->words->length; t++ ) { - e = ( lex_entry_t ) chunk->words->items[t]; + for(t = 0; t < chunk->words->length; t++) { + e = (lex_entry_t) chunk->words->items[t]; tmp = e->length - chunk->average_word_length; var += tmp * tmp; } @@ -855,20 +837,19 @@ __STATIC_API__ float count_chunk_var( friso_chunk_t chunk ) /* {{{ a static function to count the single word morpheme degree of freedom * of the given chunk. */ -__STATIC_API__ float count_chunk_mdf( friso_chunk_t chunk ) -{ +__STATIC_API__ float count_chunk_mdf(friso_chunk_t chunk) { float __mdf__ = 0; register uint_t t; lex_entry_t e; - for ( t = 0; t < chunk->words->length; t++ ) { - e = ( lex_entry_t ) chunk->words->items[t]; + for(t = 0; t < chunk->words->length; t++) { + e = (lex_entry_t) chunk->words->items[t]; //single CJK(UTF-8)/chinese(GBK) word. //better add a charset check here, but this will works find. //all CJK words will take 3 bytes with UTF-8 encoding. //all chinese words take 2 bytes with GBK encoding. - if ( e->length == 3 || e->length == 2 ) { - __mdf__ += (float) log( (float)e->fre); + if(e->length == 3 || e->length == 2) { + __mdf__ += (float) log((float)e->fre); } } chunk->single_word_dmf = __mdf__; @@ -898,41 +879,40 @@ putchar('\n'); \ * 3. smallest word length variance. * 4. largest single word morpheme degrees of freedom. */ -__STATIC_API__ friso_chunk_t mmseg_core_invoke( friso_array_t chunks ) -{ +__STATIC_API__ friso_chunk_t mmseg_core_invoke(friso_array_t chunks) { register uint_t t/*, j*/; float max; friso_chunk_t e; friso_array_t __res__, __tmp__; - __res__ = new_array_list_with_opacity( chunks->length ); + __res__ = new_array_list_with_opacity(chunks->length); //1.get the maximum matched chunks. //count the maximum length - max = ( float ) ( ( friso_chunk_t ) chunks->items[0] )->length; - for ( t = 1; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( e->length > max ) - max = ( float ) e->length; + max = (float)((friso_chunk_t) chunks->items[0])->length; + for(t = 1; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(e->length > max) + max = (float) e->length; } //get the chunk items that owns the maximum length. - for ( t = 0; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( e->length >= max ) { - array_list_add( __res__, e ); + for(t = 0; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(e->length >= max) { + array_list_add(__res__, e); } else { - free_array_list( e->words ); - free_chunk( e ); + free_array_list(e->words); + free_chunk(e); } } //check the left chunks - if ( __res__->length == 1 ) { - e = ( friso_chunk_t ) __res__->items[0]; - free_array_list( __res__ ); - free_array_list( chunks ); + if(__res__->length == 1) { + e = (friso_chunk_t) __res__->items[0]; + free_array_list(__res__); + free_array_list(chunks); return e; } else { - __tmp__ = array_list_clear( chunks ); + __tmp__ = array_list_clear(chunks); chunks = __res__; __res__ = __tmp__; } @@ -940,31 +920,31 @@ __STATIC_API__ friso_chunk_t mmseg_core_invoke( friso_array_t chunks ) //2.get the largest average word length chunks. //count the maximum average word length. - max = count_chunk_avl( ( friso_chunk_t ) chunks->items[0] ); - for ( t = 1; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( count_chunk_avl( e ) > max ) { + max = count_chunk_avl((friso_chunk_t) chunks->items[0]); + for(t = 1; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(count_chunk_avl(e) > max) { max = e->average_word_length; } } //get the chunks items that own the largest average word length. - for ( t = 0; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( e->average_word_length >= max ) { - array_list_add( __res__, e ); + for(t = 0; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(e->average_word_length >= max) { + array_list_add(__res__, e); } else { - free_array_list( e->words ); - free_chunk( e ); + free_array_list(e->words); + free_chunk(e); } } //check the left chunks - if ( __res__->length == 1 ) { - e = ( friso_chunk_t ) __res__->items[0]; - free_array_list( __res__); - free_array_list( chunks ); + if(__res__->length == 1) { + e = (friso_chunk_t) __res__->items[0]; + free_array_list(__res__); + free_array_list(chunks); return e; } else { - __tmp__ = array_list_clear( chunks ); + __tmp__ = array_list_clear(chunks); chunks = __res__; __res__ = __tmp__; } @@ -972,31 +952,31 @@ __STATIC_API__ friso_chunk_t mmseg_core_invoke( friso_array_t chunks ) //3.get the smallest word length variance chunks //count the smallest word length variance - max = count_chunk_var( ( friso_chunk_t ) chunks->items[0] ); - for ( t = 1; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( count_chunk_var( e ) < max ) { + max = count_chunk_var((friso_chunk_t) chunks->items[0]); + for(t = 1; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(count_chunk_var(e) < max) { max = e->word_length_variance; } } //get the chunks that own the smallest word length variance. - for ( t = 0; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( e->word_length_variance <= max ) { - array_list_add( __res__, e ); + for(t = 0; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(e->word_length_variance <= max) { + array_list_add(__res__, e); } else { - free_array_list( e->words ); - free_chunk( e ); + free_array_list(e->words); + free_chunk(e); } } //check the left chunks - if ( __res__->length == 1 ) { - e = ( friso_chunk_t ) __res__->items[0]; - free_array_list( chunks ); - free_array_list( __res__ ); + if(__res__->length == 1) { + e = (friso_chunk_t) __res__->items[0]; + free_array_list(chunks); + free_array_list(__res__); return e; } else { - __tmp__ = array_list_clear( chunks ); + __tmp__ = array_list_clear(chunks); chunks = __res__; __res__ = __tmp__; } @@ -1004,21 +984,21 @@ __STATIC_API__ friso_chunk_t mmseg_core_invoke( friso_array_t chunks ) //4.get the largest single word morpheme degrees of freedom. //count the maximum single word morpheme degreees of freedom - max = count_chunk_mdf( ( friso_chunk_t ) chunks->items[0] ); - for ( t = 1; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( count_chunk_mdf( e ) > max ) { + max = count_chunk_mdf((friso_chunk_t) chunks->items[0]); + for(t = 1; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(count_chunk_mdf(e) > max) { max = e->single_word_dmf; } - } + } //get the chunks that own the largest single word word morpheme degrees of freedom. - for ( t = 0; t < chunks->length; t++ ) { - e = ( friso_chunk_t ) chunks->items[t]; - if ( e->single_word_dmf >= max ) { - array_list_add( __res__, e ); + for(t = 0; t < chunks->length; t++) { + e = (friso_chunk_t) chunks->items[t]; + if(e->single_word_dmf >= max) { + array_list_add(__res__, e); } else { - free_array_list( e->words ); - free_chunk( e ); + free_array_list(e->words); + free_chunk(e); } } @@ -1031,17 +1011,17 @@ __STATIC_API__ friso_chunk_t mmseg_core_invoke( friso_array_t chunks ) * points to except the 1th one. * you have to do two things to totaly free a chunk: * 1. call free_array_list to free the allocations of a chunk's words. - * 2. call free_chunk to the free the allocations of a chunk. + * 2. call free_chunk to the free the allocations of a chunk. */ - for ( t = 1; t < __res__->length; t++ ) { - e = ( friso_chunk_t ) __res__->items[t]; - free_array_list( e->words ); - free_chunk( e ); + for(t = 1; t < __res__->length; t++) { + e = (friso_chunk_t) __res__->items[t]; + free_array_list(e->words); + free_chunk(e); } - e = ( friso_chunk_t ) __res__->items[0]; - free_array_list( chunks ); - free_array_list( __res__ ); + e = (friso_chunk_t) __res__->items[0]; + free_array_list(chunks); + free_array_list(__res__); return e; } @@ -1054,36 +1034,35 @@ __STATIC_API__ friso_chunk_t mmseg_core_invoke( friso_array_t chunks ) * * @see mmseg_core_invoke( chunks ); */ -FRISO_API lex_entry_t next_complex_cjk( - friso_t friso, - friso_config_t config, - friso_task_t task ) -{ +FRISO_API lex_entry_t next_complex_cjk( + friso_t friso, + friso_config_t config, + friso_task_t task) { register uint_t x, y, z; /*bakup the task->bytes here*/ uint_t __idx__ = task->bytes; lex_entry_t fe, se, te; friso_chunk_t e; friso_array_t words, chunks; - friso_array_t smatch, tmatch, fmatch = - get_next_match( friso, config, task, task->idx ); + friso_array_t smatch, tmatch, fmatch = + get_next_match(friso, config, task, task->idx); /* * here: * if the length of the fmatch is 1, mean we don't have to * continue the following work. ( no matter what we get the same result. ) */ - if ( fmatch->length == 1 ) { - fe = ( ( lex_entry_t ) fmatch->items[0] ); - free_array_list( fmatch ); + if(fmatch->length == 1) { + fe = ((lex_entry_t) fmatch->items[0]); + free_array_list(fmatch); /* - * check and clear the stop words . + * check and clear the stop words . * @date 2013-06-13 */ - if ( config->clr_stw && - friso_dic_match( friso->dic, - __LEX_STOPWORDS__, fe->word ) ) { + if(config->clr_stw && + friso_dic_match(friso->dic, + __LEX_STOPWORDS__, fe->word)) { return NULL; } @@ -1093,59 +1072,59 @@ FRISO_API lex_entry_t next_complex_cjk( chunks = new_array_list(); task->idx -= __idx__; - for ( x = 0; x < fmatch->length; x++ ) { + for(x = 0; x < fmatch->length; x++) { /*get the word and try the second layer match*/ - fe = ( lex_entry_t ) array_list_get( fmatch, x ); + fe = (lex_entry_t) array_list_get(fmatch, x); __idx__ = task->idx + fe->length; - readNextWord( friso, task, &__idx__, task->buffer ); + readNextWord(friso, task, &__idx__, task->buffer); - if ( task->bytes != 0 - && friso_cn_string(friso->charset, task ) + if(task->bytes != 0 + && friso_cn_string(friso->charset, task) && friso_dic_match(friso->dic, __LEX_CJK_WORDS__, task->buffer)) { //get the next matchs - smatch = get_next_match( friso, config, task, __idx__ ); - for ( y = 0; y < smatch->length; y++ ) { + smatch = get_next_match(friso, config, task, __idx__); + for(y = 0; y < smatch->length; y++) { /*get the word and try the third layer match*/ - se = ( lex_entry_t ) array_list_get( smatch, y ); + se = (lex_entry_t) array_list_get(smatch, y); __idx__ = task->idx + fe->length + se->length; - readNextWord( friso, task, &__idx__, task->buffer ); + readNextWord(friso, task, &__idx__, task->buffer); - if ( task->bytes != 0 - && friso_cn_string( friso->charset, task ) - && friso_dic_match( friso->dic, - __LEX_CJK_WORDS__, task->buffer ) ) { + if(task->bytes != 0 + && friso_cn_string(friso->charset, task) + && friso_dic_match(friso->dic, + __LEX_CJK_WORDS__, task->buffer)) { //get the matchs. - tmatch = get_next_match( friso, config, task, __idx__ ); - for ( z = 0; z < tmatch->length; z++ ) { - te = ( lex_entry_t ) array_list_get( tmatch, z ); + tmatch = get_next_match(friso, config, task, __idx__); + for(z = 0; z < tmatch->length; z++) { + te = (lex_entry_t) array_list_get(tmatch, z); words = new_array_list_with_opacity(3); - array_list_add( words, fe ); - array_list_add( words, se ); - array_list_add( words, te ); - array_list_add( chunks, new_chunk( words, - fe->length + se->length + te->length ) ); + array_list_add(words, fe); + array_list_add(words, se); + array_list_add(words, te); + array_list_add(chunks, new_chunk(words, + fe->length + se->length + te->length)); } //free the third matched array list - free_array_list( tmatch ); + free_array_list(tmatch); } else { words = new_array_list_with_opacity(2); - array_list_add( words, fe ); - array_list_add( words, se ); + array_list_add(words, fe); + array_list_add(words, se); //add the chunk - array_list_add( chunks, - new_chunk( words, fe->length + se->length ) ); + array_list_add(chunks, + new_chunk(words, fe->length + se->length)); } } //free the second match array list - free_array_list( smatch ); + free_array_list(smatch); } else { words = new_array_list_with_opacity(1); - array_list_add( words, fe ); - array_list_add( chunks, new_chunk( words, fe->length ) ); + array_list_add(words, fe); + array_list_add(chunks, new_chunk(words, fe->length)); } } //free the first match array list - free_array_list( fmatch ); + free_array_list(fmatch); /* * filter the chunks with the four rules of the mmseg algorithm @@ -1154,21 +1133,21 @@ FRISO_API lex_entry_t next_complex_cjk( * @see mmseg_core_invoke( chunks ); * @date 2012-12-13 */ - if ( chunks->length > 1 ) { - e = mmseg_core_invoke( chunks ); + if(chunks->length > 1) { + e = mmseg_core_invoke(chunks); } else { - e = ( friso_chunk_t ) chunks->items[0]; + e = (friso_chunk_t) chunks->items[0]; } - fe = ( lex_entry_t ) e->words->items[0]; + fe = (lex_entry_t) e->words->items[0]; task->idx += fe->length; //reset the idx of the task. free_array_list(e->words); //free the chunks words allocation - free_chunk( e ); + free_chunk(e); //clear the stop words - if ( config->clr_stw && - friso_dic_match( friso->dic, - __LEX_STOPWORDS__, fe->word ) ) { + if(config->clr_stw && + friso_dic_match(friso->dic, + __LEX_STOPWORDS__, fe->word)) { return NULL; } @@ -1197,24 +1176,23 @@ FRISO_API lex_entry_t next_complex_cjk( * @param task * @param lex * */ -__STATIC_API__ void token_sphinx_output( - friso_task_t task, - lex_entry_t lex ) -{ +__STATIC_API__ void token_sphinx_output( + friso_task_t task, + lex_entry_t lex) { uint_t i, j, len; fstring _word; len = lex->length; //append the synoyums words. - for ( i = 0; i < lex->syn->length; i++ ) { - _word = ( fstring ) lex->syn->items[i]; + for(i = 0; i < lex->syn->length; i++) { + _word = (fstring) lex->syn->items[i]; j = strlen(_word); - if ( ( len + j + 1 ) >= __HITS_WORD_LENGTH__ ) break; + if((len + j + 1) >= __HITS_WORD_LENGTH__) break; memcpy(task->token->word + len, "|", 1); len += 1; memcpy(task->token->word + len, _word, j); len += j; - } + } //set the new end of the buffer. task->token->word[len] = '\0'; @@ -1225,30 +1203,29 @@ __STATIC_API__ void token_sphinx_output( * * @param task * @param lex - * @param front 1 for add the synoyum words from the head and + * @param front 1 for add the synoyum words from the head and * 0 for append from the tail. * */ -__STATIC_API__ void token_normal_output( - friso_task_t task, - lex_entry_t lex, - int front ) -{ +__STATIC_API__ void token_normal_output( + friso_task_t task, + lex_entry_t lex, + int front) { uint_t i; fstring _word; lex_entry_t e; - for ( i = 0; i < lex->syn->length; i++ ) { - _word = ( fstring ) lex->syn->items[i]; - e = new_lex_entry( _word, NULL, 0, - strlen(_word), __LEX_NCSYN_WORDS__ ); + for(i = 0; i < lex->syn->length; i++) { + _word = (fstring) lex->syn->items[i]; + e = new_lex_entry(_word, NULL, 0, + strlen(_word), __LEX_NCSYN_WORDS__); e->offset = lex->offset; //add to the buffer. - if ( front ) { - link_list_add_first( task->pool, e ); + if(front) { + link_list_add_first(task->pool, e); } else { - link_list_add( task->pool, e); + link_list_add(task->pool, e); } - } + } } /* }}} */ @@ -1261,12 +1238,11 @@ __STATIC_API__ void token_normal_output( * @param retfw -Wether to return the first word. * @return lex_entry_t(NULL or the first sub token of the lex) */ -__STATIC_API__ lex_entry_t en_second_seg( - friso_t friso, - friso_config_t config, - friso_task_t task, - lex_entry_t lex, int retfw ) -{ +__STATIC_API__ lex_entry_t en_second_seg( + friso_t friso, + friso_config_t config, + friso_task_t task, + lex_entry_t lex, int retfw) { //printf("sseg: %d\n", (task->ctrlMask & START_SS_MASK)); int j, p = 0, start = 0; @@ -1278,16 +1254,16 @@ __STATIC_API__ lex_entry_t en_second_seg( string_buffer_clear(task->sbuf); string_buffer_append_char(task->sbuf, str[0]); - for ( j = 1; j < lex->length; j++ ) { + for(j = 1; j < lex->length; j++) { //get the type of the char _ctype = get_enchar_type(str[j]); - if ( _ctype == FRISO_EN_WHITESPACE ) { + if(_ctype == FRISO_EN_WHITESPACE) { _TYPE = FRISO_EN_WHITESPACE; p++; continue; } - if ( _ctype == _TYPE ) { + if(_ctype == _TYPE) { string_buffer_append_char(task->sbuf, str[j]); } else { start = j - task->sbuf->length - p; @@ -1296,17 +1272,17 @@ __STATIC_API__ lex_entry_t en_second_seg( * is larger than config->st_minl then we will * create a new lex_entry_t and append it to the task->wordPool. * */ - if ( task->sbuf->length >= config->st_minl - && ! ( config->clr_stw && friso_dic_match( friso->dic, - __LEX_STOPWORDS__, task->sbuf->buffer ) ) ) { - /* the allocation of lex_entry_t and its word + if(task->sbuf->length >= config->st_minl + && !(config->clr_stw && friso_dic_match(friso->dic, + __LEX_STOPWORDS__, task->sbuf->buffer))) { + /* the allocation of lex_entry_t and its word * should be released and the type of the lex_entry_t * must be __LEX_OTHER_WORDS__. * */ - sword = new_lex_entry(strdup(task->sbuf->buffer), - NULL, 0, task->sbuf->length, __LEX_OTHER_WORDS__); + sword = new_lex_entry(strdup(task->sbuf->buffer), + NULL, 0, task->sbuf->length, __LEX_OTHER_WORDS__); sword->offset = lex->offset + start; - if ( retfw && fword == NULL ) { + if(retfw && fword == NULL) { fword = sword; } else { link_list_add(task->pool, sword); @@ -1321,14 +1297,14 @@ __STATIC_API__ lex_entry_t en_second_seg( } //continue to check the last item. - if ( task->sbuf->length >= config->st_minl - && ! ( config->clr_stw && friso_dic_match( friso->dic, - __LEX_STOPWORDS__, task->sbuf->buffer ) ) ) { + if(task->sbuf->length >= config->st_minl + && !(config->clr_stw && friso_dic_match(friso->dic, + __LEX_STOPWORDS__, task->sbuf->buffer))) { start = j - task->sbuf->length; - sword = new_lex_entry(strdup(task->sbuf->buffer), - NULL, 0, task->sbuf->length, __LEX_OTHER_WORDS__); + sword = new_lex_entry(strdup(task->sbuf->buffer), + NULL, 0, task->sbuf->length, __LEX_OTHER_WORDS__); sword->offset = j - task->sbuf->length; - if ( retfw && fword == NULL ) { + if(retfw && fword == NULL) { fword = sword; } else { link_list_add(task->pool, sword); @@ -1364,23 +1340,22 @@ __STATIC_API__ lex_entry_t en_second_seg( * @param config. * @return task. */ -FRISO_API friso_token_t next_mmseg_token( - friso_t friso, - friso_config_t config, - friso_task_t task ) -{ +FRISO_API friso_token_t next_mmseg_token( + friso_t friso, + friso_config_t config, + friso_task_t task) { uint_t j, len = 0; string_buffer_t sb = NULL; lex_entry_t lex = NULL, tmp = NULL, sword = NULL; /* {{{ task word pool check */ - if ( ! link_list_empty( task->pool ) ) { + if(! link_list_empty(task->pool)) { /* * load word from the word poll if it is not empty. * this will make the next word more convenient and efficient. * often synonyms, newly created word will be stored in the poll. */ - lex = ( lex_entry_t ) link_list_remove_first( task->pool ); + lex = (lex_entry_t) link_list_remove_first(task->pool); memcpy(task->token->word, lex->word, lex->length); task->token->type = lex->type; task->token->length = lex->length; @@ -1391,14 +1366,14 @@ FRISO_API friso_token_t next_mmseg_token( /* check and handle the english synonyms words append mask. * Also we have to close the mask after finish the operation. * - * 1. we've check the config->add_syn before open the + * 1. we've check the config->add_syn before open the * _LEX_APPENSYN_MASK mask. - * 2. we should add the synonyms words of the curren + * 2. we should add the synonyms words of the curren * lex_entry_t from the head. * * @since: 1.6.0 * */ - if ( lex_appensyn_check(lex) ) { + if(lex_appensyn_check(lex)) { lex_appensyn_close(lex); append_en_syn(lex, tmp, 1); } @@ -1417,13 +1392,13 @@ FRISO_API friso_token_t next_mmseg_token( * other type: * they must exist in the dictionary, so just pass them. */ - switch ( lex->type ) { - case __LEX_OTHER_WORDS__: - FRISO_FREE( lex->word ); - free_lex_entry( lex ); + switch(lex->type) { + case __LEX_OTHER_WORDS__: + FRISO_FREE(lex->word); + free_lex_entry(lex); break; case __LEX_NCSYN_WORDS__: - free_lex_entry( lex ); + free_lex_entry(lex); break; } @@ -1431,22 +1406,22 @@ FRISO_API friso_token_t next_mmseg_token( } /* }}} */ - while ( task->idx < task->length ) { + while(task->idx < task->length) { //read the next word from the current position. - task->bytes = readNextWord( friso, task, &task->idx, task->buffer ); - if ( task->bytes == 0 ) break; + task->bytes = readNextWord(friso, task, &task->idx, task->buffer); + if(task->bytes == 0) break; //clear up the whitespace. - if ( friso_whitespace( friso->charset, task ) ) continue; + if(friso_whitespace(friso->charset, task)) continue; /* {{{ CJK words recongnize block. */ - if ( friso_cn_string( friso->charset, task ) ) { + if(friso_cn_string(friso->charset, task)) { /* check the dictionary. * and return the unrecognized CJK char as a single word. * */ - if ( ! friso_dic_match( friso->dic, - __LEX_CJK_WORDS__, task->buffer) ) { - memcpy(task->token->word, task->buffer, task->bytes ); + if(! friso_dic_match(friso->dic, + __LEX_CJK_WORDS__, task->buffer)) { + memcpy(task->token->word, task->buffer, task->bytes); task->token->type = __LEX_PUNC_WORDS__; task->token->length = task->bytes; task->token->rlen = task->bytes; @@ -1456,19 +1431,19 @@ FRISO_API friso_token_t next_mmseg_token( } //specifield mode split. - //if ( config->mode == __FRISO_COMPLEX_MODE__ ) + //if ( config->mode == __FRISO_COMPLEX_MODE__ ) // lex = next_complex_cjk( friso, config, task ); //else lex = next_simple_cjk( friso, config, task ); lex = config->next_cjk(friso, config, task); - if ( lex == NULL ) continue; //find a stopwrod. + if(lex == NULL) continue; //find a stopwrod. lex->offset = task->idx - lex->rlen; /* * try to find a chinese and english mixed words, like '卡拉ok' * keep in mind that is not english and chinese mixed words * like 'x射线'. - * + * * @reader: * 1. only if the char after the current word is an english char. * 2. if the first point meet, friso will call next_basic_latin() to @@ -1476,16 +1451,16 @@ FRISO_API friso_token_t next_mmseg_token( * 3. if match a CE word, set lex to the newly match CE word. * 4. if no match a CE word, we will have to append the basic latin * to the pool, and it should after the append of synonyms words. - * 5. do not use the task->buffer and task->unicode as the check + * 5. do not use the task->buffer and task->unicode as the check * condition for the CE word identify. * 6. Add friso_numeric_letter check so can get work like '高3' * * @date 2013-09-02 */ - if ( ( task->idx < task->length ) - && ((int)task->text[task->idx]) > 0 - && ( friso_en_letter( friso->charset, task ) - || friso_numeric_letter(friso->charset, task) ) ) { + if((task->idx < task->length) + && ((int)task->text[task->idx]) > 0 + && (friso_en_letter(friso->charset, task) + || friso_numeric_letter(friso->charset, task))) { //create a string buffer sb = new_string_buffer_with_string(lex->word); @@ -1494,18 +1469,19 @@ FRISO_API friso_token_t next_mmseg_token( task->buffer[1] = '\0'; tmp = next_basic_latin(friso, config, task); tmp->offset = task->idx - tmp->length; - string_buffer_append( sb, tmp->word ); + string_buffer_append(sb, tmp->word); //check the CE dictionary. - if ( friso_dic_match( friso->dic, - __LEX_CEM_WORDS__, sb->buffer ) ) { + if(friso_dic_match(friso->dic, + __LEX_CEM_WORDS__, sb->buffer)) { j = lex->offset; //bakup the offset. - lex = friso_dic_get( friso->dic, - __LEX_CEM_WORDS__, sb->buffer ); + lex = friso_dic_get(friso->dic, + __LEX_CEM_WORDS__, sb->buffer); lex->offset = j; check_free_otlex_entry(tmp); free_string_buffer(sb); - tmp = NULL; sb = NULL; + tmp = NULL; + sb = NULL; } } @@ -1514,7 +1490,7 @@ FRISO_API friso_token_t next_mmseg_token( * * @reader: (boodly lession, added 2013-08-31): * don't bother to handle the task->token->offset problem. - * is has been sovled perfectly above. + * is has been sovled perfectly above. */ len = (int) lex->length; memcpy(task->token->word, lex->word, lex->length); @@ -1525,15 +1501,15 @@ FRISO_API friso_token_t next_mmseg_token( task->token->word[len] = '\0'; //check and append the synonyms words - if ( config->add_syn && lex->syn != NULL ) { - if ( config->spx_out == 1 ) { + if(config->add_syn && lex->syn != NULL) { + if(config->spx_out == 1) { token_sphinx_output(task, lex); } else { token_normal_output(task, lex, 0); } } - /* {{{ here: handle the newly found basic latin created when + /* {{{ here: handle the newly found basic latin created when * we try to find a CE word. * * @reader: @@ -1542,18 +1518,18 @@ FRISO_API friso_token_t next_mmseg_token( * * @TODO: finished append the synonyms words on 2013-12-19. */ - if ( tmp != NULL && sb != NULL ) { + if(tmp != NULL && sb != NULL) { //check the secondary split. - if ( config->en_sseg == 1 - && task_ssseg_check(task) ) { + if(config->en_sseg == 1 + && task_ssseg_check(task)) { en_second_seg(friso, config, task, tmp, 0); } - free_string_buffer( sb ); - link_list_add( task->pool, tmp ); + free_string_buffer(sb); + link_list_add(task->pool, tmp); //check if append synoyums words. - if ( config->add_syn == 1 ) { + if(config->add_syn == 1) { lex_appensyn_open(tmp); } @@ -1561,30 +1537,30 @@ FRISO_API friso_token_t next_mmseg_token( /* }}} */ return task->token; - } + } /* }}} */ /* {{{ basic english/latin recongnize block. */ - else if ( friso_halfwidth_en_char( friso->charset, task ) - || friso_fullwidth_en_char( friso->charset, task ) ) { + else if(friso_halfwidth_en_char(friso->charset, task) + || friso_fullwidth_en_char(friso->charset, task)) { /* * handle the english punctuation. * * @todo: - * 1. commen all the code of the following if + * 1. commen all the code of the following if * and uncomment the continue to clear up the punctuation directly. * - * @reader: + * @reader: * 2. keep in mind that ALL the english punctuation will be handled here, * (when a english punctuation is found during the other process, we will * reset the task->idx back to it and then back here) - * except the keep punctuation(define in file friso_string.c) + * except the keep punctuation(define in file friso_string.c) * that will make up a word with the english chars around it. */ - if ( friso_en_punctuation( friso->charset, task ) ) { - if ( config->clr_stw - && friso_dic_match(friso->dic, - __LEX_STOPWORDS__, task->buffer) ) { + if(friso_en_punctuation(friso->charset, task)) { + if(config->clr_stw + && friso_dic_match(friso->dic, + __LEX_STOPWORDS__, task->buffer)) { continue; } @@ -1598,10 +1574,10 @@ FRISO_API friso_token_t next_mmseg_token( return task->token; //continue - } + } //get the next basic latin word. - lex = next_basic_latin( friso, config, task ); + lex = next_basic_latin(friso, config, task); lex->offset = task->idx - lex->rlen; /* @added: 2013-12-22 @@ -1609,32 +1585,32 @@ FRISO_API friso_token_t next_mmseg_token( * this will split 'qq2013' to 'qq, 2013' * */ sword = NULL; - if ( config->en_sseg == 1 - && task_ssseg_check(task) ) { + if(config->en_sseg == 1 + && task_ssseg_check(task)) { sword = en_second_seg(friso, config, task, lex, 1); } //check if it is a stopword. - if ( config->clr_stw - && friso_dic_match( friso->dic, - __LEX_STOPWORDS__, lex->word ) ) { + if(config->clr_stw + && friso_dic_match(friso->dic, + __LEX_STOPWORDS__, lex->word)) { //free the newly created lexicon entry. - check_free_otlex_entry( lex ); - if ( sword == NULL ) continue; + check_free_otlex_entry(lex); + if(sword == NULL) continue; lex = sword; - } else if ( sword != NULL ) { - if ( config->add_syn == 1 ) lex_appensyn_open(lex); + } else if(sword != NULL) { + if(config->add_syn == 1) lex_appensyn_open(lex); link_list_add(task->pool, lex); /* If the sub token is not NULL: - * add the lex to the task->pool if it is not NULL + * add the lex to the task->pool if it is not NULL * and return the sub token istead of lex so * the sub tokens will be output ahead of lex. * */ lex = sword; } - //if the token is longer than __HITS_WORD_LENGTH__, drop it + //if the token is longer than __HITS_WORD_LENGTH__, drop it //copy the word to the task token buffer. //if ( lex->length >= __HITS_WORD_LENGTH__ ) continue; memcpy(task->token->word, lex->word, lex->length); @@ -1644,27 +1620,27 @@ FRISO_API friso_token_t next_mmseg_token( task->token->offset = lex->offset; task->token->word[lex->length] = '\0'; - /* If sword is NULL, continue to check and append + /* If sword is NULL, continue to check and append * tye synoyums words for the current lex_entry_t. * */ - if ( sword == NULL - && config->add_syn == 1 ) { + if(sword == NULL + && config->add_syn == 1) { append_en_syn(lex, tmp, 0); } //free the newly create lex_entry_t - check_free_otlex_entry( lex ); + check_free_otlex_entry(lex); return task->token; - } + } /* }}} */ /* {{{ Keep the chinese punctuation. * @added 2013-08-31) */ - else if ( friso_cn_punctuation( friso->charset, task ) ) { - if ( config->clr_stw - && friso_dic_match(friso->dic, - __LEX_STOPWORDS__, task->buffer) ) { + else if(friso_cn_punctuation(friso->charset, task)) { + if(config->clr_stw + && friso_dic_match(friso->dic, + __LEX_STOPWORDS__, task->buffer)) { continue; } @@ -1677,16 +1653,16 @@ FRISO_API friso_token_t next_mmseg_token( return task->token; } /* }}} */ - //else if ( friso_letter_number( friso->charset, task ) ) + //else if ( friso_letter_number( friso->charset, task ) ) //{ - //} - //else if ( friso_other_number( friso->charset, task ) ) + //} + //else if ( friso_other_number( friso->charset, task ) ) //{ //} /* {{{ keep the unrecognized words? //@date 2013-10-14 */ - else if ( config->keep_urec ) { + else if(config->keep_urec) { memcpy(task->token->word, task->buffer, task->bytes); task->token->type = __LEX_UNKNOW_WORDS__; task->token->length = task->bytes; @@ -1707,20 +1683,19 @@ FRISO_API friso_token_t next_mmseg_token( * detect mode will only return the words in the dictionary * with simple forward maximum matching algorithm */ -FRISO_API friso_token_t next_detect_token( - friso_t friso, friso_config_t config, friso_task_t task ) -{ +FRISO_API friso_token_t next_detect_token( + friso_t friso, friso_config_t config, friso_task_t task) { lex_entry_t lex = NULL; int i, __convert = 0, tbytes, wbytes; /* {{{ task word pool check */ - if ( ! link_list_empty( task->pool ) ) { + if(! link_list_empty(task->pool)) { /* * load word from the word poll if it is not empty. * this will make the next word more convenient and efficient. * often synonyms, newly created word will be stored in the poll. */ - lex = ( lex_entry_t ) link_list_remove_first( task->pool ); + lex = (lex_entry_t) link_list_remove_first(task->pool); memcpy(task->token->word, lex->word, lex->length); task->token->type = lex->type; task->token->length = lex->length; @@ -1735,53 +1710,53 @@ FRISO_API friso_token_t next_detect_token( * friso->dic, so : * free the lex_entry_t but not its word here. */ - if ( lex->type == __LEX_NCSYN_WORDS__ ) { - free_lex_entry( lex ); + if(lex->type == __LEX_NCSYN_WORDS__) { + free_lex_entry(lex); } return task->token; } /* }}} */ - while ( task->idx < task->length ) { + while(task->idx < task->length) { lex = NULL; //read the next word from the current position. - task->bytes = readNextWord( friso, task, &task->idx, task->buffer ); - if ( task->bytes == 0 ) break; + task->bytes = readNextWord(friso, task, &task->idx, task->buffer); + if(task->bytes == 0) break; //clear up the whitespace. - if ( friso_whitespace( friso->charset, task ) ) continue; + if(friso_whitespace(friso->charset, task)) continue; //convert full-width to half-width // and uppercase to lowercase for english chars wbytes = 0; tbytes = task->bytes; - convert_full_to_half( friso, task, __convert ); - convert_upper_to_lower( friso, task, __convert ); - convert_work_apply( friso, task, __convert ); + convert_full_to_half(friso, task, __convert); + convert_upper_to_lower(friso, task, __convert); + convert_work_apply(friso, task, __convert); string_buffer_clear(task->sbuf); string_buffer_append(task->sbuf, task->buffer); - if ( friso_dic_match(friso->dic, __LEX_CJK_WORDS__, task->sbuf->buffer) ) { + if(friso_dic_match(friso->dic, __LEX_CJK_WORDS__, task->sbuf->buffer)) { lex = friso_dic_get(friso->dic, __LEX_CJK_WORDS__, task->sbuf->buffer); wbytes = tbytes; } - for ( i = 1; i < config->max_len; i++ ) { - task->bytes = readNextWord( friso, task, &task->idx, task->buffer ); - if ( task->bytes == 0 ) break; + for(i = 1; i < config->max_len; i++) { + task->bytes = readNextWord(friso, task, &task->idx, task->buffer); + if(task->bytes == 0) break; //convert full-width to half-width // and uppercase to lowercase for english chars tbytes += task->bytes; - convert_full_to_half( friso, task, __convert ); - convert_upper_to_lower( friso, task, __convert ); - convert_work_apply( friso, task, __convert ); + convert_full_to_half(friso, task, __convert); + convert_upper_to_lower(friso, task, __convert); + convert_work_apply(friso, task, __convert); string_buffer_append(task->sbuf, task->buffer); - if ( friso_dic_match(friso->dic, __LEX_CJK_WORDS__, task->sbuf->buffer) ) { + if(friso_dic_match(friso->dic, __LEX_CJK_WORDS__, task->sbuf->buffer)) { lex = friso_dic_get(friso->dic, __LEX_CJK_WORDS__, task->sbuf->buffer); wbytes = tbytes; } @@ -1791,7 +1766,7 @@ FRISO_API friso_token_t next_detect_token( * matches no word in the dictionary * reset the task->idx to the correct value */ - if ( lex == NULL ) { + if(lex == NULL) { task->idx -= (tbytes - 1); continue; } @@ -1808,8 +1783,8 @@ FRISO_API friso_token_t next_detect_token( task->token->word[(int)lex->length] = '\0'; //check and append the synonyms words - if ( config->add_syn && lex->syn != NULL ) { - if ( config->spx_out == 1 ) { + if(config->add_syn && lex->syn != NULL) { + if(config->spx_out == 1) { token_sphinx_output(task, lex); } else { token_normal_output(task, lex, 0); diff --git a/libfriso/friso/src/friso.h b/libfriso/friso/src/friso.h index a9cc68c..87eab0b 100644 --- a/libfriso/friso/src/friso.h +++ b/libfriso/friso/src/friso.h @@ -1,7 +1,7 @@ /* * main interface file for friso tokenizer. * you could modify it and re-release and free for commercial use. - * + * * @author lionsoul */ @@ -25,7 +25,7 @@ /* * Type: friso_lex_t * ----------- - * This type used to represent the type of the lexicon. + * This type used to represent the type of the lexicon. */ typedef enum { __LEX_CJK_WORDS__ = 0, @@ -47,7 +47,7 @@ typedef enum { } friso_lex_t; typedef friso_hash_t * friso_dic_t; -#define __FRISO_LEXICON_LENGTH__ 12 +#define __FRISO_LEXICON_LENGTH__ 12 //charset that Friso now support. @@ -59,7 +59,7 @@ typedef enum { /* * Type: friso_mode_t * ------------------ - * use to identidy the mode that the friso use. + * use to identidy the mode that the friso use. */ typedef enum { __FRISO_SIMPLE_MODE__ = 1, @@ -79,7 +79,7 @@ typedef friso_entry * friso_t; /* * Type: lex_entry_cdt * ------------------- - * This type used to represent the lexicon entry struct. + * This type used to represent the lexicon entry struct. */ #define _LEX_APPENSYN_MASK (1 << 0) //append synoyums words. #define lex_appensyn_open(e) e->ctrlMask |= _LEX_APPENSYN_MASK @@ -123,7 +123,7 @@ typedef friso_token_entry * friso_token_t; /* * Type: friso_task_entry * This type used to represent the current segmentation content. - * like the text to split, and the current index, token buffer eg.... + * like the text to split, and the current index, token buffer eg.... */ //action control mask for #FRISO_TASK_T#. #define _TASK_CHECK_CF_MASK (1 << 0) //Wether to check the chinese fraction. @@ -166,9 +166,9 @@ struct friso_config_struct { friso_mode_t mode; //Complex mode or simple mode //pointer to the function to get the next token - friso_token_t (*next_token) (friso_t, struct friso_config_struct *, friso_task_t); + friso_token_t (*next_token)(friso_t, struct friso_config_struct *, friso_task_t); //pointer to the function to get the next cjk lex_entry_t - lex_entry_t (*next_cjk ) (friso_t, struct friso_config_struct *, friso_task_t); + lex_entry_t (*next_cjk)(friso_t, struct friso_config_struct *, friso_task_t); char kpuncs[_FRISO_KEEP_PUNC_LEN]; //keep punctuations buffer. }; @@ -181,28 +181,28 @@ typedef friso_config_entry * friso_config_t; * Function: friso_new; * Usage: vars = friso_new( void ); * -------------------------------- - * This function used to create a new empty friso friso_t; + * This function used to create a new empty friso friso_t; * with default value. */ -FRISO_API friso_t friso_new( void ); +FRISO_API friso_t friso_new(void); //creat a friso entry with a default value from a configuratile file. //@return 1 for successfully and 0 for failed. -FRISO_API int friso_init_from_ifile( friso_t, friso_config_t, fstring ); +FRISO_API int friso_init_from_ifile(friso_t, friso_config_t, fstring); /* * Function: friso_free_vars; * Usage: friso_free( vars ); * -------------------------- - * This function is used to free the allocation of the given vars. + * This function is used to free the allocation of the given vars. */ -FRISO_API void friso_free( friso_t ); +FRISO_API void friso_free(friso_t); /* * Function: friso_set_dic * Usage: dic = friso_set_dic( vars, dic ); * ---------------------------------------- - * This function is used to set the dictionary for friso. + * This function is used to set the dictionary for friso. * and firso_dic_t is the pointer of a hash table array. */ //FRISO_API void friso_set_dic( friso_t, friso_dic_t ); @@ -217,14 +217,14 @@ do {\ * ------------------------------------ * This function is used to set the mode(complex or simple) that you want to friso to use. */ -FRISO_API void friso_set_mode( friso_config_t, friso_mode_t ); +FRISO_API void friso_set_mode(friso_config_t, friso_mode_t); -/*create a new friso configuration entry and initialize +/*create a new friso configuration entry and initialize it with the default value.*/ -FRISO_API friso_config_t friso_new_config( void ); +FRISO_API friso_config_t friso_new_config(void); //initialize the specified friso config entry with default value. -FRISO_API void friso_init_config( friso_config_t ); +FRISO_API void friso_init_config(friso_config_t); //free the specified friso configuration entry. //FRISO_API void friso_free_config( friso_config_t ); @@ -234,20 +234,20 @@ FRISO_API void friso_init_config( friso_config_t ); * Function: friso_new_task; * Usage: segment = friso_new_task( void ); * ---------------------------------------- - * This function is used to create a new friso segment type; + * This function is used to create a new friso segment type; */ -FRISO_API friso_task_t friso_new_task( void ); +FRISO_API friso_task_t friso_new_task(void); /* * Function: friso_free_task; - * Usage: friso_free_task( task ); + * Usage: friso_free_task( task ); * ------------------------------- * This function is used to free the allocation of function friso_new_segment(); */ -FRISO_API void friso_free_task( friso_task_t ); +FRISO_API void friso_free_task(friso_task_t); //create a new friso token -FRISO_API friso_token_t friso_new_token( void ); +FRISO_API friso_token_t friso_new_token(void); //free the given friso token //FRISO_API void friso_free_token( friso_token_t ); @@ -257,16 +257,16 @@ FRISO_API friso_token_t friso_new_token( void ); * Function: friso_set_text * Usage: friso_set_text( task, text ); * ------------------------------------ - * This function is used to set the text that is going to segment. + * This function is used to set the text that is going to segment. */ -FRISO_API void friso_set_text( friso_task_t, fstring ); +FRISO_API void friso_set_text(friso_task_t, fstring); //get the next cjk word with mmseg simple mode -FRISO_API lex_entry_t next_simple_cjk( friso_t, friso_config_t, friso_task_t ); +FRISO_API lex_entry_t next_simple_cjk(friso_t, friso_config_t, friso_task_t); //get the next cjk word with mmseg complex mode(mmseg core algorithm) -FRISO_API lex_entry_t next_complex_cjk( friso_t, friso_config_t, friso_task_t ); +FRISO_API lex_entry_t next_complex_cjk(friso_t, friso_config_t, friso_task_t); /* * Function: next_mmseg_token @@ -275,10 +275,10 @@ FRISO_API lex_entry_t next_complex_cjk( friso_t, friso_config_t, friso_task_t ); * This function is used to get next word that friso segmented * with a split mode of __FRISO_SIMPLE_MODE__ or __FRISO_COMPLEX_MODE__ */ -FRISO_API friso_token_t next_mmseg_token( friso_t, friso_config_t, friso_task_t ); +FRISO_API friso_token_t next_mmseg_token(friso_t, friso_config_t, friso_task_t); //__FRISO_DETECT_MODE__ -FRISO_API friso_token_t next_detect_token( friso_t, friso_config_t, friso_task_t ); +FRISO_API friso_token_t next_detect_token(friso_t, friso_config_t, friso_task_t); /* }}} friso main interface define :: end*/ /* {{{ lexicon interface define :: start*/ @@ -289,42 +289,42 @@ FRISO_API friso_token_t next_detect_token( friso_t, friso_config_t, friso_task_t * ----------------------------- * This function used to create a new dictionary.(memory allocation). */ -FRISO_API friso_dic_t friso_dic_new( void ); +FRISO_API friso_dic_t friso_dic_new(void); -FRISO_API fstring file_get_line( fstring, FILE * ); +FRISO_API fstring file_get_line(fstring, FILE *); /* * Function: friso_dic_free * Usage: friso_dic_free( void ); * ------------------------------ - * This function is used to free all the allocation of friso_dic_new. + * This function is used to free all the allocation of friso_dic_new. */ -FRISO_API void friso_dic_free( friso_dic_t ); +FRISO_API void friso_dic_free(friso_dic_t); //create a new lexicon entry. -FRISO_API lex_entry_t new_lex_entry( fstring, friso_array_t, uint_t, uint_t, uint_t ); +FRISO_API lex_entry_t new_lex_entry(fstring, friso_array_t, uint_t, uint_t, uint_t); //free the given lexicon entry. //free all the allocations that its synonyms word's items pointed to //when the second arguments is 1 -FRISO_API void free_lex_entry_full( lex_entry_t ); -FRISO_API void free_lex_entry( lex_entry_t ); +FRISO_API void free_lex_entry_full(lex_entry_t); +FRISO_API void free_lex_entry(lex_entry_t); /* * Function: friso_dic_load - * Usage: friso_dic_load( friso, friso_lex_t, path, length ); + * Usage: friso_dic_load( friso, friso_lex_t, path, length ); * -------------------------------------------------- * This function is used to load dictionary from a given path. * no length limit when length less than 0. */ -FRISO_API void friso_dic_load( friso_t, friso_config_t, - friso_lex_t, fstring, uint_t ); +FRISO_API void friso_dic_load(friso_t, friso_config_t, + friso_lex_t, fstring, uint_t); /* * load the lexicon configuration file. * and load all the valid lexicon from the conf file. */ -FRISO_API void friso_dic_load_from_ifile( friso_t, friso_config_t, fstring, uint_t ); +FRISO_API void friso_dic_load_from_ifile(friso_t, friso_config_t, fstring, uint_t); /* * Function: friso_dic_match @@ -332,7 +332,7 @@ FRISO_API void friso_dic_load_from_ifile( friso_t, friso_config_t, fstring, uint * ---------------------------------------------- * This function used to put new word into the dictionary. */ -FRISO_API void friso_dic_add( friso_dic_t, friso_lex_t, fstring, friso_array_t ); +FRISO_API void friso_dic_add(friso_dic_t, friso_lex_t, fstring, friso_array_t); /* * Function: friso_dic_add_with_fre @@ -340,15 +340,15 @@ FRISO_API void friso_dic_add( friso_dic_t, friso_lex_t, fstring, friso_array_t ) * ------------------------------------------------------------------- * This function used to put new word width frequency into the dictionary. */ -FRISO_API void friso_dic_add_with_fre( friso_dic_t, friso_lex_t, fstring, friso_array_t, uint_t ); +FRISO_API void friso_dic_add_with_fre(friso_dic_t, friso_lex_t, fstring, friso_array_t, uint_t); /* * Function: friso_dic_match * Usage: result = friso_dic_match( dic, friso_lex_t, word ); * ---------------------------------------------------- - * This function is used to check the given word is in the dictionary or not. + * This function is used to check the given word is in the dictionary or not. */ -FRISO_API int friso_dic_match( friso_dic_t, friso_lex_t, fstring ); +FRISO_API int friso_dic_match(friso_dic_t, friso_lex_t, fstring); /* * Function: friso_dic_get @@ -356,15 +356,15 @@ FRISO_API int friso_dic_match( friso_dic_t, friso_lex_t, fstring ); * ----------------------------------------- * This function is used to search the specified lex_entry_t. */ -FRISO_API lex_entry_t friso_dic_get( friso_dic_t, friso_lex_t, fstring ); +FRISO_API lex_entry_t friso_dic_get(friso_dic_t, friso_lex_t, fstring); /* * Function: friso_spec_dic_size * Usage: friso_spec_dic_size( dic, friso_lex_t ) - * This function is used to get the size of the dictionary with a specified type. + * This function is used to get the size of the dictionary with a specified type. */ -FRISO_API uint_t friso_spec_dic_size( friso_dic_t, friso_lex_t ); -FRISO_API uint_t friso_all_dic_size( friso_dic_t ); +FRISO_API uint_t friso_spec_dic_size(friso_dic_t, friso_lex_t); +FRISO_API uint_t friso_all_dic_size(friso_dic_t); /* }}} lexicon interface define :: end*/ #endif /*end ifndef*/ diff --git a/libfriso/friso/src/friso_API.h b/libfriso/friso/src/friso_API.h index d5afcdd..69c6177 100644 --- a/libfriso/friso/src/friso_API.h +++ b/libfriso/friso/src/friso_API.h @@ -4,7 +4,7 @@ * 2. hashmap interface. * 3. dynamaic array interface. * 4. double link list interface. - * + * * @author chenxin */ @@ -68,45 +68,45 @@ typedef string_buffer_entry * string_buffer_t; //FRISO_API string_buffer_t new_string_buffer( void ); #define new_string_buffer() \ new_string_buffer_with_opacity( __DEFAULT_ARRAY_LIST_OPACITY__ ); -FRISO_API string_buffer_t new_string_buffer_with_opacity( uint_t ); -FRISO_API string_buffer_t new_string_buffer_with_string( fstring str ); +FRISO_API string_buffer_t new_string_buffer_with_opacity(uint_t); +FRISO_API string_buffer_t new_string_buffer_with_string(fstring str); /* * this function will copy the chars that the fstring pointed. * to the buffer. * this may cause the resize action of the buffer. */ -FRISO_API void string_buffer_append( string_buffer_t, fstring ); -FRISO_API void string_buffer_append_char( string_buffer_t, char ); +FRISO_API void string_buffer_append(string_buffer_t, fstring); +FRISO_API void string_buffer_append_char(string_buffer_t, char); //insert the given fstring from the specified position. -FRISO_API void string_buffer_insert( string_buffer_t, uint_t idx, fstring ); +FRISO_API void string_buffer_insert(string_buffer_t, uint_t idx, fstring); //remove the char in the specified position. -FRISO_API fstring string_buffer_remove( string_buffer_t, uint_t idx, uint_t ); +FRISO_API fstring string_buffer_remove(string_buffer_t, uint_t idx, uint_t); /* * turn the string_buffer to a string. * or return the buffer of the string_buffer. */ -FRISO_API string_buffer_t string_buffer_trim( string_buffer_t ); +FRISO_API string_buffer_t string_buffer_trim(string_buffer_t); /* * free the given fstring buffer. - * and this function will not free the allocations of the + * and this function will not free the allocations of the * the string_buffer_t->buffer, we return it to you, if there is * a necessary you could free it youself by calling free(); */ -FRISO_API fstring string_buffer_devote( string_buffer_t ); +FRISO_API fstring string_buffer_devote(string_buffer_t); /* * clear the given fstring buffer. * reset its buffer with 0 and reset its length to 0. */ -FRISO_API void string_buffer_clear( string_buffer_t ); +FRISO_API void string_buffer_clear(string_buffer_t); //free the fstring buffer include the buffer. -FRISO_API void free_string_buffer( string_buffer_t ); +FRISO_API void free_string_buffer(string_buffer_t); /** * fstring specified chars tokenizer functions @@ -126,28 +126,28 @@ typedef string_split_entry * string_split_t; * create a new string_split_entry. * * @param source - * @return string_split_t; + * @return string_split_t; */ -FRISO_API string_split_t new_string_split( fstring, fstring ); +FRISO_API string_split_t new_string_split(fstring, fstring); -FRISO_API void string_split_reset( string_split_t, fstring, fstring ); +FRISO_API void string_split_reset(string_split_t, fstring, fstring); -FRISO_API void string_split_set_source( string_split_t, fstring ); +FRISO_API void string_split_set_source(string_split_t, fstring); -FRISO_API void string_split_set_delimiter( string_split_t, fstring ); +FRISO_API void string_split_set_delimiter(string_split_t, fstring); -FRISO_API void free_string_split( string_split_t ); +FRISO_API void free_string_split(string_split_t); /** - * get the next split fstring, and copy the - * splited fstring into the __dst buffer . + * get the next split fstring, and copy the + * splited fstring into the __dst buffer . * * @param string_split_t * @param __dst - * @return fstring (NULL if reach the end of the source + * @return fstring (NULL if reach the end of the source * or there is no more segmentation) */ -FRISO_API fstring string_split_next( string_split_t, fstring ); +FRISO_API fstring string_split_next(string_split_t, fstring); /* }}} */ @@ -170,37 +170,37 @@ typedef friso_array_entry * friso_array_t; #define new_array_list() new_array_list_with_opacity(__DEFAULT_ARRAY_LIST_OPACITY__) //create a new friso dynamic array with the given opacity -FRISO_API friso_array_t new_array_list_with_opacity( uint_t ); +FRISO_API friso_array_t new_array_list_with_opacity(uint_t); /* * free the given friso array. - * and its items, but never where the items's item to pointed to . + * and its items, but never where the items's item to pointed to . */ -FRISO_API void free_array_list( friso_array_t ); +FRISO_API void free_array_list(friso_array_t); //add a new item to the array. -FRISO_API void array_list_add( friso_array_t, void * ); +FRISO_API void array_list_add(friso_array_t, void *); //insert a new item at a specifed position. -FRISO_API void array_list_insert( friso_array_t, uint_t, void * ); +FRISO_API void array_list_insert(friso_array_t, uint_t, void *); //get a item at a specified position. -FRISO_API void *array_list_get( friso_array_t, uint_t ); +FRISO_API void *array_list_get(friso_array_t, uint_t); /* * set the item at a specified position. * this will return the old value. */ -FRISO_API void *array_list_set( friso_array_t, uint_t, void * ); +FRISO_API void *array_list_set(friso_array_t, uint_t, void *); /* * remove the given item at a specified position. * this will return the value of the removed item. */ -FRISO_API void *array_list_remove( friso_array_t, uint_t ); +FRISO_API void *array_list_remove(friso_array_t, uint_t); /*trim the array list for final use.*/ -FRISO_API friso_array_t array_list_trim( friso_array_t ); +FRISO_API friso_array_t array_list_trim(friso_array_t); /* * clear the array list. @@ -208,7 +208,7 @@ FRISO_API friso_array_t array_list_trim( friso_array_t ); * but will not free the point array allocations, * and will reset the length of it. */ -FRISO_API friso_array_t array_list_clear( friso_array_t ); +FRISO_API friso_array_t array_list_clear(friso_array_t); //return the size of the array. //FRISO_API uint_t array_list_size( friso_array_t ); @@ -247,10 +247,10 @@ typedef struct { typedef friso_link_entry * friso_link_t; //create a new link list -FRISO_API friso_link_t new_link_list( void ); +FRISO_API friso_link_t new_link_list(void); //free the specified link list -FRISO_API void free_link_list( friso_link_t ); +FRISO_API void free_link_list(friso_link_t); //return the size of the current link list. //FRISO_API uint_t link_list_size( friso_link_t ); @@ -261,37 +261,37 @@ FRISO_API void free_link_list( friso_link_t ); #define link_list_empty( link ) (link->size == 0) //clear all the nodes in the link list( except the head and the tail ). -FRISO_API friso_link_t link_list_clear( friso_link_t link ); +FRISO_API friso_link_t link_list_clear(friso_link_t link); //add a new node to the link list.(append from the tail) -FRISO_API void link_list_add( friso_link_t, void * ); +FRISO_API void link_list_add(friso_link_t, void *); //add a new node before the specified node -FRISO_API void link_list_insert_before( friso_link_t, uint_t, void * ); +FRISO_API void link_list_insert_before(friso_link_t, uint_t, void *); //get the node in the current index. -FRISO_API void *link_list_get( friso_link_t, uint_t ); +FRISO_API void *link_list_get(friso_link_t, uint_t); //modify the node in the current index. -FRISO_API void *link_list_set( friso_link_t, uint_t, void * ); +FRISO_API void *link_list_set(friso_link_t, uint_t, void *); //remove the specified link node -FRISO_API void *link_list_remove( friso_link_t, uint_t ); +FRISO_API void *link_list_remove(friso_link_t, uint_t); //remove the given node -FRISO_API void *link_list_remove_node( friso_link_t, link_node_t ); +FRISO_API void *link_list_remove_node(friso_link_t, link_node_t); //remove the node from the frist. -FRISO_API void *link_list_remove_first( friso_link_t ); +FRISO_API void *link_list_remove_first(friso_link_t); //remove the last node from the link list -FRISO_API void *link_list_remove_last( friso_link_t ); +FRISO_API void *link_list_remove_last(friso_link_t); //append a node from the end. -FRISO_API void link_list_add_last( friso_link_t, void * ); +FRISO_API void link_list_add_last(friso_link_t, void *); //add a node at the begining of the link list. -FRISO_API void link_list_add_first( friso_link_t, void * ); +FRISO_API void link_list_add_first(friso_link_t, void *); /* }}} link list interface define::end*/ @@ -305,7 +305,7 @@ struct hash_entry { }; typedef struct hash_entry friso_hash_entry; typedef friso_hash_entry * hash_entry_t; -typedef void (*fhash_callback_fn_t)( hash_entry_t ); +typedef void (*fhash_callback_fn_t)(hash_entry_t); typedef struct { uint_t length; @@ -324,10 +324,10 @@ typedef friso_hash_cdt * friso_hash_t; /* * Function: new_hash_table * Usage: table = new_hash_table(); - * -------------------------------- + * -------------------------------- * this function allocates a new symbol table with no entries. */ -FRISO_API friso_hash_t new_hash_table( void ); +FRISO_API friso_hash_t new_hash_table(void); /* * Function: free_hash_table @@ -335,7 +335,7 @@ FRISO_API friso_hash_t new_hash_table( void ); * -------------------------------------- * this function will free all the allocation for memory. */ -FRISO_API void free_hash_table( friso_hash_t, fhash_callback_fn_t ); +FRISO_API void free_hash_table(friso_hash_t, fhash_callback_fn_t); /* * Function: put_new_mapping @@ -343,7 +343,7 @@ FRISO_API void free_hash_table( friso_hash_t, fhash_callback_fn_t ); * ---------------------------------------- * the function associates the specified key with the given value. */ -FRISO_API void *hash_put_mapping( friso_hash_t, fstring, void * ); +FRISO_API void *hash_put_mapping(friso_hash_t, fstring, void *); /* * Function: is_mapping_exists @@ -351,7 +351,7 @@ FRISO_API void *hash_put_mapping( friso_hash_t, fstring, void * ); * ---------------------------------------------- * this function check the given key mapping is exists or not. */ -FRISO_API int hash_exist_mapping( friso_hash_t, fstring ); +FRISO_API int hash_exist_mapping(friso_hash_t, fstring); /* * Function: get_mapping_value @@ -360,7 +360,7 @@ FRISO_API int hash_exist_mapping( friso_hash_t, fstring ); * this function return the value associated with the given key. * UNDEFINED will be return if the mapping is not exists. */ -FRISO_API void * hash_get_value( friso_hash_t, fstring ); +FRISO_API void * hash_get_value(friso_hash_t, fstring); /* * Function: remove_mapping @@ -368,13 +368,13 @@ FRISO_API void * hash_get_value( friso_hash_t, fstring ); * ------------------------------------ * This function is used to remove the mapping associated with the given key. */ -FRISO_API hash_entry_t hash_remove_mapping( friso_hash_t, fstring ); +FRISO_API hash_entry_t hash_remove_mapping(friso_hash_t, fstring); /* * Function: get_table_size * Usage: size = get_table_size( table ); * -------------------------------------- - * This function is used to count the size of the specified table. + * This function is used to count the size of the specified table. */ //FRISO_API uint_t hash_get_size( friso_hash_t ); #define hash_get_size( hash ) hash->size diff --git a/libfriso/friso/src/friso_GBK.c b/libfriso/friso/src/friso_GBK.c index caf6c54..a6310d2 100644 --- a/libfriso/friso/src/friso_GBK.c +++ b/libfriso/friso/src/friso_GBK.c @@ -15,16 +15,15 @@ * * @return int the bytes of the current readed word. */ -FRISO_API int gbk_next_word( - friso_task_t task, - uint_t *idx, - fstring __word ) -{ +FRISO_API int gbk_next_word( + friso_task_t task, + uint_t *idx, + fstring __word) { int c; - if ( *idx >= task->length ) return 0; + if(*idx >= task->length) return 0; c = (uchar_t)task->text[*idx]; - if ( c <= 0x80 ) { + if(c <= 0x80) { task->bytes = 1; } else { task->bytes = 2; @@ -46,29 +45,27 @@ FRISO_API int gbk_next_word( //check if the given buffer is a gbk word (ANSII string). // included the simplified and traditional words. -FRISO_API int gbk_cn_string(char *str) -{ +FRISO_API int gbk_cn_string(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; //GBK/2: gb2312 chinese word. - return ( ((c1 >= 0xb0 && c1 <= 0xf7) - && (c2 >= 0xa1 && c2 <= 0xfe)) - //GBK/3: extend chinese words. - || ((c1 >= 0x81 && c1 <= 0xa0) - && ( (c2 >= 0x40 && c2 <= 0x7e) - || (c2 >= 0x80 && c2 <= 0xfe) )) - //GBK/4: extend chinese words. - || ((c1 >= 0xaa && c1 <= 0xfe) - && ( (c2 >= 0x40 && c2 <= 0xfe) - || (c2 >= 0x80 && c2 <= 0xa0) )) ); + return (((c1 >= 0xb0 && c1 <= 0xf7) + && (c2 >= 0xa1 && c2 <= 0xfe)) + //GBK/3: extend chinese words. + || ((c1 >= 0x81 && c1 <= 0xa0) + && ((c2 >= 0x40 && c2 <= 0x7e) + || (c2 >= 0x80 && c2 <= 0xfe))) + //GBK/4: extend chinese words. + || ((c1 >= 0xaa && c1 <= 0xfe) + && ((c2 >= 0x40 && c2 <= 0xfe) + || (c2 >= 0x80 && c2 <= 0xa0)))); } /*check if the given char is a ASCII letter * include all the arabic number, letters and english puntuations.*/ -FRISO_API int gbk_halfwidth_en_char( char c ) -{ +FRISO_API int gbk_halfwidth_en_char(char c) { int u = (uchar_t) c; - return ( u >= 32 && u <= 126 ); + return (u >= 32 && u <= 126); } /* @@ -76,52 +73,48 @@ FRISO_API int gbk_halfwidth_en_char( char c ) * include the full-width arabic numeber, letters. * but not the full-width puntuations. */ -FRISO_API int gbk_fullwidth_en_char( char *str ) -{ +FRISO_API int gbk_fullwidth_en_char(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - return ( (c1 == 0xA3) - && ( (c2 >= 0xB0 && c2 <= 0xB9) //arabic numbers. - || ( c2 >= 0xC1 && c2 <= 0xDA ) //uppercase letters. - || ( c2 >= 0xE1 && c2 <= 0xFA) ) ); //lowercase letters. + return ((c1 == 0xA3) + && ((c2 >= 0xB0 && c2 <= 0xB9) //arabic numbers. + || (c2 >= 0xC1 && c2 <= 0xDA) //uppercase letters. + || (c2 >= 0xE1 && c2 <= 0xFA))); //lowercase letters. } //check if the given char is a upper case english letter. // included the full-width and half-width letters. -FRISO_API int gbk_uppercase_letter( char *str ) -{ +FRISO_API int gbk_uppercase_letter(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - if ( c1 <= 0x80 ) { //half-width - return ( c1 >= 65 && c1 <= 90 ); + if(c1 <= 0x80) { //half-width + return (c1 >= 65 && c1 <= 90); } else { //full-width - return ( c1 == 0xa3 && ( c2 >= 0xc1 && c2 <= 0xda ) ); + return (c1 == 0xa3 && (c2 >= 0xc1 && c2 <= 0xda)); } } //check if the given char is a lower case char. // included the full-width and half-width letters. -FRISO_API int gbk_lowercase_letter( char *str ) -{ +FRISO_API int gbk_lowercase_letter(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - if ( c1 <= 0x80 ) { //half-width - return ( c1 >= 97 && c1 <= 122 ); + if(c1 <= 0x80) { //half-width + return (c1 >= 97 && c1 <= 122); } else { //full-width - return ( c1 == 0xa3 && ( c2 >= 0xe1 && c2 <= 0xfa ) ); + return (c1 == 0xa3 && (c2 >= 0xe1 && c2 <= 0xfa)); } } //check if the given char is a arabic numeric. // included the full-width and half-width arabic numeric. -FRISO_API int gbk_numeric_letter( char *str ) -{ +FRISO_API int gbk_numeric_letter(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - if ( c1 <= 0x80 ) { //half-width - return ( c1 >= 48 && c1 <= 57 ); + if(c1 <= 0x80) { //half-width + return (c1 >= 48 && c1 <= 57); } else { //full-width - return ( ( c1 == 0xa3 ) && ( c2 >= 0xb0 && c2 <= 0xb9 ) ); + return ((c1 == 0xa3) && (c2 >= 0xb0 && c2 <= 0xb9)); } } @@ -129,49 +122,47 @@ FRISO_API int gbk_numeric_letter( char *str ) * check if the given fstring is make up with numeric chars. * both full-width,half-width numeric is ok. */ -FRISO_API int gbk_numeric_string( char *str ) -{ +FRISO_API int gbk_numeric_string(char *str) { char *s = str; int c1 = 0; int c2 = 0; - while ( *s != '\0' ) { - c1 = (uchar_t) (*s++); - if ( c1 <= 0x80 ) { //half-width - if ( c1 < 48 || c2 > 57 ) return 0; + while(*s != '\0') { + c1 = (uchar_t)(*s++); + if(c1 <= 0x80) { //half-width + if(c1 < 48 || c2 > 57) return 0; } else { //full-width - if ( c1 != 0xa3 ) return 0; - c2 = (uchar_t) (*s++); - if ( c2 < 0xb0 || c2 > 0xb9 ) return 0; + if(c1 != 0xa3) return 0; + c2 = (uchar_t)(*s++); + if(c2 < 0xb0 || c2 > 0xb9) return 0; } } return 1; } -FRISO_API int gbk_decimal_string( char *str ) -{ +FRISO_API int gbk_decimal_string(char *str) { int c1 = 0; int c2 = 0; int len = strlen(str), i, p = 0; //point header check. - if ( str[0] == '.' || str[len - 1] == '.' ) return 0; + if(str[0] == '.' || str[len - 1] == '.') return 0; - for ( i = 0; i < len; ) { + for(i = 0; i < len;) { c1 = (uchar_t) str[i++]; //count the number of the points. - if ( c1 == 46 ) { + if(c1 == 46) { p++; continue; } - if ( c1 <= 0x80 ) { //half-width - if ( c1 < 48 || c1 > 57 ) return 0; + if(c1 <= 0x80) { //half-width + if(c1 < 48 || c1 > 57) return 0; } else { //full-width - if ( c1 != 0xa3 ) return 0; + if(c1 != 0xa3) return 0; c2 = (uchar_t) str[i++]; - if ( c2 < 0xb0 || c2 > 0xb9 ) return 0; + if(c2 < 0xb0 || c2 > 0xb9) return 0; } } @@ -180,17 +171,16 @@ FRISO_API int gbk_decimal_string( char *str ) //check if the given char is a english(ASCII) letter. // (full-width and half-width), not the punctuation/arabic of course. -FRISO_API int gbk_en_letter( char *str ) -{ +FRISO_API int gbk_en_letter(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - if ( c1 <= 0x80 ) { - return ( (c1 >= 65 && c1 <= 90) //lowercase - || (c1 >= 97 && c1 <= 122)); //uppercase + if(c1 <= 0x80) { + return ((c1 >= 65 && c1 <= 90) //lowercase + || (c1 >= 97 && c1 <= 122)); //uppercase } else { - return ( (c1 == 0xa3) - && ( ( c2 >= 0xc1 && c2 <= 0xda ) //lowercase - || ( c2 >= 0xe1 && c2 <= 0xfa ) ) ); //uppercase + return ((c1 == 0xa3) + && ((c2 >= 0xc1 && c2 <= 0xda) //lowercase + || (c2 >= 0xe1 && c2 <= 0xfa))); //uppercase } return 0; @@ -198,65 +188,60 @@ FRISO_API int gbk_en_letter( char *str ) //check the given char is a whitespace or not. // included full-width and half-width whitespace. -FRISO_API int gbk_whitespace( char *str ) -{ +FRISO_API int gbk_whitespace(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - if ( c1 <= 0x80 ) { + if(c1 <= 0x80) { return (c1 == 32); } else { - return ( c1 == 0xa3 && c2 == 0xa0 ); + return (c1 == 0xa3 && c2 == 0xa0); } } /* check if the given char is a letter number like 'ⅠⅡ' */ -FRISO_API int gbk_letter_number( char *str ) -{ +FRISO_API int gbk_letter_number(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - return ( (c1 == 0xa2) - && ( ( c2 >= 0xa1 && c2 <= 0xb0 ) //lowercase - || ( c2 >= 0xf0 && c2 <= 0xfe ) ) ); //uppercase + return ((c1 == 0xa2) + && ((c2 >= 0xa1 && c2 <= 0xb0) //lowercase + || (c2 >= 0xf0 && c2 <= 0xfe))); //uppercase } /* * check if the given char is a other number like '①⑩⑽㈩' */ -FRISO_API int gbk_other_number( char *str ) -{ +FRISO_API int gbk_other_number(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; - return ( ( c1 == 0xa2 ) && ( c2 >= 0xc5 && c2 <= 0xee ) ); + return ((c1 == 0xa2) && (c2 >= 0xc5 && c2 <= 0xee)); } //check if the given char is a english punctuation. -FRISO_API int gbk_en_punctuation( char c ) -{ +FRISO_API int gbk_en_punctuation(char c) { int u = (uchar_t) c; - return ( (u > 32 && u < 48) - || ( u > 57 && u < 65 ) - || ( u > 90 && u < 97 ) - || ( u > 122 && u < 127 ) ); + return ((u > 32 && u < 48) + || (u > 57 && u < 65) + || (u > 90 && u < 97) + || (u > 122 && u < 127)); } //check the given char is a chinese punctuation. -FRISO_API int gbk_cn_punctuation( char *str ) -{ +FRISO_API int gbk_cn_punctuation(char *str) { int c1 = (uchar_t) str[0]; int c2 = (uchar_t) str[1]; //full-width en punctuation. - return ( (c1 == 0xa3 && (( c2 >= 0xa1 && c2 <= 0xaf ) - || ( c2 >= 0xba && c2 <= 0xc0 ) - || ( c2 >= 0xdb && c2 <= 0xe0 ) - || ( c2 >= 0xfb && c2 <= 0xfe ) )) - //chinese punctuation. - || (c1 == 0xa1 && ( (c2 >= 0xa1 && c2 <= 0xae) - || ( c2 >= 0xb0 && c2 <= 0xbf ) )) - //A6 area special punctuations:" " - || (c1 == 0xa6 && (c2 >= 0xf9 && c2 <= 0xfe)) - //A8 area special punctuations: " ˊˋ˙–―‥‵℅ " - || (c1 == 0xa8 && (c2 >= 0x40 && c2 <= 0x47)) ); + return ((c1 == 0xa3 && ((c2 >= 0xa1 && c2 <= 0xaf) + || (c2 >= 0xba && c2 <= 0xc0) + || (c2 >= 0xdb && c2 <= 0xe0) + || (c2 >= 0xfb && c2 <= 0xfe))) + //chinese punctuation. + || (c1 == 0xa1 && ((c2 >= 0xa1 && c2 <= 0xae) + || (c2 >= 0xb0 && c2 <= 0xbf))) + //A6 area special punctuations:" " + || (c1 == 0xa6 && (c2 >= 0xf9 && c2 <= 0xfe)) + //A8 area special punctuations: " ˊˋ˙–―‥‵℅ " + || (c1 == 0xa8 && (c2 >= 0x40 && c2 <= 0x47))); } /* {{{ @@ -292,7 +277,7 @@ FRISO_API int gbk_cn_punctuation( char *str ) /* }}} */ //check if the given english char is a full-width char or not. -//FRISO_API int gbk_fullwidth_char( char *str ) +//FRISO_API int gbk_fullwidth_char( char *str ) //{ // return 1; //} diff --git a/libfriso/friso/src/friso_UTF8.c b/libfriso/friso/src/friso_UTF8.c index b574cc6..4f46e11 100644 --- a/libfriso/friso/src/friso_UTF8.c +++ b/libfriso/friso/src/friso_UTF8.c @@ -15,15 +15,14 @@ * * @return int the bytes of the current readed word. */ -FRISO_API int utf8_next_word( - friso_task_t task, - uint_t *idx, - fstring __word ) -{ - if ( *idx >= task->length ) return 0; +FRISO_API int utf8_next_word( + friso_task_t task, + uint_t *idx, + fstring __word) { + if(*idx >= task->length) return 0; //register uint_t t; - task->bytes = get_utf8_bytes( task->text[ *idx ] ); + task->bytes = get_utf8_bytes(task->text[ *idx ]); //for ( t = 0; t < task->bytes; t++ ) { // __word[t] = task->text[ (*idx)++ ]; @@ -37,7 +36,7 @@ FRISO_API int utf8_next_word( __word[task->bytes] = '\0'; //the unicode counter was moved here from version 1.6.0 - task->unicode = get_utf8_unicode( __word ); + task->unicode = get_utf8_unicode(__word); return task->bytes; } @@ -47,12 +46,11 @@ FRISO_API int utf8_next_word( * * @param int */ -FRISO_API void print_char_binary( char value ) -{ +FRISO_API void print_char_binary(char value) { register uint_t t; - for ( t = 0; t < __CHAR_BYTES__; t++ ) { - if ( ( value & 0x80 ) == 0x80 ) { + for(t = 0; t < __CHAR_BYTES__; t++) { + if((value & 0x80) == 0x80) { printf("1"); } else { printf("0"); @@ -66,15 +64,14 @@ FRISO_API void print_char_binary( char value ) * between 1 - 6. * * @param __char - * @return int + * @return int */ -FRISO_API int get_utf8_bytes( char value ) -{ +FRISO_API int get_utf8_bytes(char value) { register uint_t t = 0; //one byte ascii char. - if ( ( value & 0x80 ) == 0 ) return 1; - for ( ; ( value & 0x80 ) != 0; value <<= 1 ) { + if((value & 0x80) == 0) return 1; + for(; (value & 0x80) != 0; value <<= 1) { t++; } @@ -83,17 +80,16 @@ FRISO_API int get_utf8_bytes( char value ) /* * get the unicode serial of a utf-8 char. - * + * * @param ch * @return int. */ -FRISO_API int get_utf8_unicode( const fstring ch ) -{ - int code = 0, bytes = get_utf8_bytes( *ch ); - register uchar_t *bit = ( uchar_t * ) &code; - register char b1,b2,b3; +FRISO_API int get_utf8_unicode(const fstring ch) { + int code = 0, bytes = get_utf8_bytes(*ch); + register uchar_t *bit = (uchar_t *) &code; + register char b1, b2, b3; - switch ( bytes ) { + switch(bytes) { case 1: *bit = *ch; break; @@ -102,7 +98,7 @@ FRISO_API int get_utf8_unicode( const fstring ch ) b2 = *(ch + 1); *bit = (b1 << 6) + (b2 & 0x3F); - *(bit+1) = (b1 >> 2) & 0x07; + *(bit + 1) = (b1 >> 2) & 0x07; break; case 3: b1 = *ch; @@ -110,7 +106,7 @@ FRISO_API int get_utf8_unicode( const fstring ch ) b3 = *(ch + 2); *bit = (b2 << 6) + (b3 & 0x3F); - *(bit+1) = (b1 << 4) + ((b2 >> 2) & 0x0F); + *(bit + 1) = (b1 << 4) + ((b2 >> 2) & 0x0F); break; //ignore the ones that are larger than 3 bytes; } @@ -119,51 +115,50 @@ FRISO_API int get_utf8_unicode( const fstring ch ) } //turn the unicode serial to a utf-8 string. -FRISO_API int unicode_to_utf8( uint_t u, fstring __word ) -{ - if ( u <= 0x0000007F ) { +FRISO_API int unicode_to_utf8(uint_t u, fstring __word) { + if(u <= 0x0000007F) { //U-00000000 - U-0000007F //0xxxxxxx - *__word = ( u & 0x7F ); + *__word = (u & 0x7F); return 1; - } else if ( u >= 0x00000080 && u <= 0x000007FF ) { + } else if(u >= 0x00000080 && u <= 0x000007FF) { //U-00000080 - U-000007FF //110xxxxx 10xxxxxx - *( __word + 1 ) = ( u & 0x3F) | 0x80; + *(__word + 1) = (u & 0x3F) | 0x80; *__word = ((u >> 6) & 0x1F) | 0xC0; return 2; - } else if ( u >= 0x00000800 && u <= 0x0000FFFF ) { + } else if(u >= 0x00000800 && u <= 0x0000FFFF) { //U-00000800 - U-0000FFFF //1110xxxx 10xxxxxx 10xxxxxx - *( __word + 2 ) = ( u & 0x3F) | 0x80; - *( __word + 1 ) = ((u >> 6) & 0x3F) | 0x80; + *(__word + 2) = (u & 0x3F) | 0x80; + *(__word + 1) = ((u >> 6) & 0x3F) | 0x80; *__word = ((u >> 12) & 0x0F) | 0xE0; return 3; - } else if ( u >= 0x00010000 && u <= 0x001FFFFF ) { + } else if(u >= 0x00010000 && u <= 0x001FFFFF) { //U-00010000 - U-001FFFFF //11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - *( __word + 3 ) = ( u & 0x3F) | 0x80; - *( __word + 2 ) = ((u >> 6) & 0x3F) | 0x80; - *( __word + 1 ) = ((u >> 12) & 0x3F) | 0x80; + *(__word + 3) = (u & 0x3F) | 0x80; + *(__word + 2) = ((u >> 6) & 0x3F) | 0x80; + *(__word + 1) = ((u >> 12) & 0x3F) | 0x80; *__word = ((u >> 18) & 0x07) | 0xF0; return 4; - } else if ( u >= 0x00200000 && u <= 0x03FFFFFF ) { + } else if(u >= 0x00200000 && u <= 0x03FFFFFF) { //U-00200000 - U-03FFFFFF //111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - *( __word + 4 ) = ( u & 0x3F) | 0x80; - *( __word + 3 ) = ((u >> 6) & 0x3F) | 0x80; - *( __word + 2 ) = ((u >> 12) & 0x3F) | 0x80; - *( __word + 1 ) = ((u >> 18) & 0x3F) | 0x80; + *(__word + 4) = (u & 0x3F) | 0x80; + *(__word + 3) = ((u >> 6) & 0x3F) | 0x80; + *(__word + 2) = ((u >> 12) & 0x3F) | 0x80; + *(__word + 1) = ((u >> 18) & 0x3F) | 0x80; *__word = ((u >> 24) & 0x03) | 0xF8; return 5; - } else if ( u >= 0x04000000 && u <= 0x7FFFFFFF ) { + } else if(u >= 0x04000000 && u <= 0x7FFFFFFF) { //U-04000000 - U-7FFFFFFF //1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - *( __word + 5 ) = ( u & 0x3F) | 0x80; - *( __word + 4 ) = ((u >> 6) & 0x3F) | 0x80; - *( __word + 3 ) = ((u >> 12) & 0x3F) | 0x80; - *( __word + 2 ) = ((u >> 18) & 0x3F) | 0x80; - *( __word + 1 ) = ((u >> 24) & 0x3F) | 0x80; + *(__word + 5) = (u & 0x3F) | 0x80; + *(__word + 4) = ((u >> 6) & 0x3F) | 0x80; + *(__word + 3) = ((u >> 12) & 0x3F) | 0x80; + *(__word + 2) = ((u >> 18) & 0x3F) | 0x80; + *(__word + 1) = ((u >> 24) & 0x3F) | 0x80; *__word = ((u >> 30) & 0x01) | 0xFC; return 6; } @@ -173,17 +168,17 @@ FRISO_API int unicode_to_utf8( uint_t u, fstring __word ) /* * check the given char is a CJK char or not. - * 2E80-2EFF CJK 部首补充 + * 2E80-2EFF CJK 部首补充 * 2F00-2FDF 康熙字典部首 * 3000-303F CJK 符号和标点 --ignore * 31C0-31EF CJK 笔画 * 3200-32FF 封闭式 CJK 文字和月份 --ignore. * 3300-33FF CJK 兼容 - * 3400-4DBF CJK 统一表意符号扩展 A + * 3400-4DBF CJK 统一表意符号扩展 A * 4DC0-4DFF 易经六十四卦符号 - * 4E00-9FBF CJK 统一表意符号 + * 4E00-9FBF CJK 统一表意符号 * F900-FAFF CJK 兼容象形文字 - * FE30-FE4F CJK 兼容形式 + * FE30-FE4F CJK 兼容形式 * FF00-FFEF 全角ASCII、全角标点 --ignore (as basic latin) * * Japanese: @@ -195,9 +190,9 @@ FRISO_API int unicode_to_utf8( uint_t u, fstring __word ) * AC00-D7AF 韩文拼音 * 1100-11FF 韩文字母 * 3130-318F 韩文兼容字母 - * + * * @param ch :pointer to the char - * @return int : 1 for yes and 0 for not. + * @return int : 1 for yes and 0 for not. */ //Comment one of the following macro define @@ -205,44 +200,42 @@ FRISO_API int unicode_to_utf8( uint_t u, fstring __word ) #define FRISO_CJK_CHK_C //#define FRISO_CJK_CHK_J //#define FRISO_CJK_CHK_K -FRISO_API int utf8_cjk_string( uint_t u ) -{ +FRISO_API int utf8_cjk_string(uint_t u) { int c = 0, j = 0, k = 0; //Chinese. #ifdef FRISO_CJK_CHK_C - c = ( ( u >= 0x4E00 && u <= 0x9FBF ) - || ( u >= 0x2E80 && u <= 0x2EFF ) || ( u >= 0x2F00 && u <= 0x2FDF ) - || ( u >= 0x31C0 && u <= 0x31EF ) //|| ( u >= 0x3200 && u <= 0x32FF ) - || ( u >= 0x3300 && u <= 0x33FF ) //|| ( u >= 0x3400 && u <= 0x4DBF ) - || ( u >= 0x4DC0 && u <= 0x4DFF ) || ( u >= 0xF900 && u <= 0xFAFF ) - || ( u >= 0xFE30 && u <= 0xFE4F ) ); + c = ((u >= 0x4E00 && u <= 0x9FBF) + || (u >= 0x2E80 && u <= 0x2EFF) || (u >= 0x2F00 && u <= 0x2FDF) + || (u >= 0x31C0 && u <= 0x31EF) //|| ( u >= 0x3200 && u <= 0x32FF ) + || (u >= 0x3300 && u <= 0x33FF) //|| ( u >= 0x3400 && u <= 0x4DBF ) + || (u >= 0x4DC0 && u <= 0x4DFF) || (u >= 0xF900 && u <= 0xFAFF) + || (u >= 0xFE30 && u <= 0xFE4F)); #endif //Japanese. #ifdef FRISO_CJK_CHK_J - j = ( ( u >= 0x3040 && u <= 0x309F ) - || ( u >= 0x30A0 && u <= 0x30FF ) || ( u >= 0x31F0 && u <= 0x31FF ) ); + j = ((u >= 0x3040 && u <= 0x309F) + || (u >= 0x30A0 && u <= 0x30FF) || (u >= 0x31F0 && u <= 0x31FF)); #endif //Korean #ifdef FRISO_CJK_CHK_K - k = ( ( u >= 0xAC00 && u <= 0xD7AF ) - || ( u >= 0x1100 && u <= 0x11FF ) || ( u >= 0x3130 && u <= 0x318F ) ); + k = ((u >= 0xAC00 && u <= 0xD7AF) + || (u >= 0x1100 && u <= 0x11FF) || (u >= 0x3130 && u <= 0x318F)); #endif - return ( c || j || k ); + return (c || j || k); } /* * check the given char is a Basic Latin letter or not. * include all the letters and english punctuations. - * + * * @param c - * @return int 1 for yes and 0 for not. + * @return int 1 for yes and 0 for not. */ -FRISO_API int utf8_halfwidth_en_char( uint_t u ) -{ - return ( u >= 32 && u <= 126 ); +FRISO_API int utf8_halfwidth_en_char(uint_t u) { + return (u >= 32 && u <= 126); } /* @@ -253,44 +246,39 @@ FRISO_API int utf8_halfwidth_en_char( uint_t u ) * @param c * @return int */ -FRISO_API int utf8_fullwidth_en_char( uint_t u ) -{ - return ( (u >= 65296 && u <= 65305 ) //arabic number - || ( u >= 65313 && u <= 65338 ) //upper case letters - || ( u >= 65345 && u <= 65370 ) ); //lower case letters +FRISO_API int utf8_fullwidth_en_char(uint_t u) { + return ((u >= 65296 && u <= 65305) //arabic number + || (u >= 65313 && u <= 65338) //upper case letters + || (u >= 65345 && u <= 65370)); //lower case letters } //check the given char is a upper case letters or not. // included the full-width and half-width letters. -FRISO_API int utf8_uppercase_letter( uint_t u ) -{ - if ( u > 65280 ) u -= 65248; - return ( u >= 65 && u <= 90 ); +FRISO_API int utf8_uppercase_letter(uint_t u) { + if(u > 65280) u -= 65248; + return (u >= 65 && u <= 90); } //check the given char is a upper case letters or not. // included the full-width and half-width letters. -FRISO_API int utf8_lowercase_letter( uint_t u ) -{ - if ( u > 65280 ) u -= 65248; - return ( u >= 97 && u <= 122 ); +FRISO_API int utf8_lowercase_letter(uint_t u) { + if(u > 65280) u -= 65248; + return (u >= 97 && u <= 122); } //check the given char is a numeric // included the full-width and half-width arabic numeric. -FRISO_API int utf8_numeric_letter( uint_t u ) -{ - if ( u > 65280 ) u -= 65248; //make full-width half-width. - return ( ( u >= 48 && u <= 57 ) ); +FRISO_API int utf8_numeric_letter(uint_t u) { + if(u > 65280) u -= 65248; //make full-width half-width. + return ((u >= 48 && u <= 57)); } //check the given char is a english letter.(included the full-width) // not the punctuation of course. -FRISO_API int utf8_en_letter( uint_t u ) -{ - if ( u > 65280 ) u -= 65248; - return ( ( u >= 65 && u <= 90 ) - || ( u >= 97 && u <= 122 ) ); +FRISO_API int utf8_en_letter(uint_t u) { + if(u > 65280) u -= 65248; + return ((u >= 65 && u <= 90) + || (u >= 97 && u <= 122)); } /* @@ -310,24 +298,23 @@ FRISO_API int utf8_en_letter( uint_t u ) * 65304, 8 * 65305, 9 */ -FRISO_API int utf8_numeric_string( const fstring str ) -{ +FRISO_API int utf8_numeric_string(const fstring str) { fstring s = str; int bytes, u; - while ( *s != '\0' ) { + while(*s != '\0') { //if ( ! utf8_numeric_letter( get_utf8_unicode( s++ ) ) ) { // return 0; - //} + //} //new implemention. //@date 2013-10-14 bytes = 1; - if ( *s < 0 ) { //full-width chars. + if(*s < 0) { //full-width chars. u = get_utf8_unicode(s); bytes = get_utf8_bytes(*s); - if ( u < 65296 || u > 65305 ) return 0; - } else if ( *s < 48 || *s > 57 ) { + if(u < 65296 || u > 65305) return 0; + } else if(*s < 48 || *s > 57) { return 0; } @@ -337,25 +324,24 @@ FRISO_API int utf8_numeric_string( const fstring str ) return 1; } -FRISO_API int utf8_decimal_string( const fstring str ) -{ +FRISO_API int utf8_decimal_string(const fstring str) { int len = strlen(str), i, p = 0; int bytes = 0, u; - if ( str[0] == '.' || str[len-1] == '.' ) return 0; + if(str[0] == '.' || str[len - 1] == '.') return 0; - for ( i = 1; i < len; bytes = 1 ) { + for(i = 1; i < len; bytes = 1) { //count the number of char '.' - if ( str[i] == '.' ) { + if(str[i] == '.') { i++; p++; continue; - } else if ( str[i] < 0 ) { + } else if(str[i] < 0) { //full-width numeric. - u = get_utf8_unicode(str+i); + u = get_utf8_unicode(str + i); bytes = get_utf8_bytes(str[i]); - if ( u < 65296 || u > 65305 ) return 0; - } else if ( str[i] < 48 || str[i] > 57 ) { + if(u < 65296 || u > 65305) return 0; + } else if(str[i] < 48 || str[i] > 57) { return 0; } @@ -367,13 +353,12 @@ FRISO_API int utf8_decimal_string( const fstring str ) /* * check the given char is a whitespace or not. - * + * * @param ch - * @return int 1 for yes and 0 for not. + * @return int 1 for yes and 0 for not. */ -FRISO_API int utf8_whitespace( uint_t u ) -{ - if ( u == 32 || u == 12288 ) { +FRISO_API int utf8_whitespace(uint_t u) { + if(u == 32 || u == 12288) { return 1; } return 0; @@ -382,17 +367,16 @@ FRISO_API int utf8_whitespace( uint_t u ) /* * check the given char is a english punctuation. - * + * * @param ch - * @return int + * @return int */ -FRISO_API int utf8_en_punctuation( uint_t u ) -{ +FRISO_API int utf8_en_punctuation(uint_t u) { //if ( u > 65280 ) u = u - 65248; //make full-width half-width - return ( (u > 32 && u < 48) - || ( u > 57 && u < 65 ) - || ( u > 90 && u < 97 ) //added @2013-08-31 - || ( u > 122 && u < 127 ) ); + return ((u > 32 && u < 48) + || (u > 57 && u < 65) + || (u > 90 && u < 97) //added @2013-08-31 + || (u > 122 && u < 127)); } /* @@ -400,17 +384,16 @@ FRISO_API int utf8_en_punctuation( uint_t u ) * @date 2013-08-31 added. * * @param ch - * @return int + * @return int */ -FRISO_API int utf8_cn_punctuation( uint_t u ) -{ - return ( ( u > 65280 && u < 65296 ) - || ( u > 65305 && u < 65312 ) - || ( u > 65338 && u < 65345 ) - || ( u > 65370 && u < 65382 ) - //cjk symbol and punctuation.(added 2013-09-06) - //from http://www.unicode.org/charts/PDF/U3000.pdf - || ( u >= 12289 && u <= 12319) ); +FRISO_API int utf8_cn_punctuation(uint_t u) { + return ((u > 65280 && u < 65296) + || (u > 65305 && u < 65312) + || (u > 65338 && u < 65345) + || (u > 65370 && u < 65382) + //cjk symbol and punctuation.(added 2013-09-06) + //from http://www.unicode.org/charts/PDF/U3000.pdf + || (u >= 12289 && u <= 12319)); } /* @@ -419,8 +402,7 @@ FRISO_API int utf8_cn_punctuation( uint_t u ) * @param ch * @return int */ -FRISO_API int utf8_letter_number( uint_t u ) -{ +FRISO_API int utf8_letter_number(uint_t u) { return 0; } @@ -430,13 +412,12 @@ FRISO_API int utf8_letter_number( uint_t u ) * @param ch * @return int */ -FRISO_API int utf8_other_number( uint_t u ) -{ +FRISO_API int utf8_other_number(uint_t u) { return 0; } //A macro define has replace this. -//FRISO_API int is_en_punctuation( char c ) +//FRISO_API int is_en_punctuation( char c ) //{ // return utf8_en_punctuation( (uint_t) c ); //} @@ -448,9 +429,9 @@ FRISO_API int utf8_other_number( uint_t u ) /* @Deprecated * check the given char is an english keep punctuation.*/ -//FRISO_API int utf8_keep_punctuation( fstring str ) +//FRISO_API int utf8_keep_punctuation( fstring str ) //{ -// if ( __keep_punctuations_hash__ == NULL ) +// if ( __keep_punctuations_hash__ == NULL ) // { // __keep_punctuations_hash__ = new_hash_table(); // hash_put_mapping( __keep_punctuations_hash__, "@", NULL ); @@ -473,11 +454,11 @@ FRISO_API int utf8_other_number( uint_t u ) /* * check the given english char is a full-width char or not. - * + * * @param ch - * @return 1 for yes and 0 for not. + * @return 1 for yes and 0 for not. */ -//FRISO_API int utf8_fullwidth_char( uint_t u ) +//FRISO_API int utf8_fullwidth_char( uint_t u ) //{ // if ( u == 12288 ) // return 1; //full-width space diff --git a/libfriso/friso/src/friso_array.c b/libfriso/friso/src/friso_array.c index 4ae3e92..b30c85d 100644 --- a/libfriso/friso/src/friso_array.c +++ b/libfriso/friso/src/friso_array.c @@ -10,16 +10,15 @@ /* ******************************************** * friso array list static functions block * **********************************************/ -__STATIC_API__ void **create_array_entries( uint_t __blocks ) -{ +__STATIC_API__ void **create_array_entries(uint_t __blocks) { register uint_t t; - void **block = ( void ** ) FRISO_CALLOC( sizeof( void * ), __blocks ); - if ( block == NULL ) { + void **block = (void **) FRISO_CALLOC(sizeof(void *), __blocks); + if(block == NULL) { ___ALLOCATION_ERROR___ } //initialize - for ( t = 0; t < __blocks; t++ ) { + for(t = 0; t < __blocks; t++) { block[t] = NULL; } @@ -27,18 +26,17 @@ __STATIC_API__ void **create_array_entries( uint_t __blocks ) } //resize the array. (the opacity should not be smaller than array->length) -__STATIC_API__ friso_array_t resize_array_list( - friso_array_t array, - uint_t opacity ) -{ +__STATIC_API__ friso_array_t resize_array_list( + friso_array_t array, + uint_t opacity) { register uint_t t; - void **block = create_array_entries( opacity ); + void **block = create_array_entries(opacity); - for ( t = 0; t < array->length ; t++ ) { + for(t = 0; t < array->length ; t++) { block[t] = array->items[t]; } - FRISO_FREE( array->items ); + FRISO_FREE(array->items); array->items = block; array->allocs = opacity; @@ -55,16 +53,15 @@ __STATIC_API__ friso_array_t resize_array_list( //} //create a new array list with a given opacity. -FRISO_API friso_array_t new_array_list_with_opacity( uint_t opacity ) -{ - friso_array_t array = ( friso_array_t ) - FRISO_MALLOC( sizeof( friso_array_entry ) ); - if ( array == NULL ) { +FRISO_API friso_array_t new_array_list_with_opacity(uint_t opacity) { + friso_array_t array = (friso_array_t) + FRISO_MALLOC(sizeof(friso_array_entry)); + if(array == NULL) { ___ALLOCATION_ERROR___ } //initialize - array->items = create_array_entries( opacity ); + array->items = create_array_entries(opacity); array->allocs = opacity; array->length = 0; @@ -73,10 +70,9 @@ FRISO_API friso_array_t new_array_list_with_opacity( uint_t opacity ) /* * free the given friso array. - * and its items, but never where its items item pointed to . + * and its items, but never where its items item pointed to . */ -FRISO_API void free_array_list( friso_array_t array ) -{ +FRISO_API void free_array_list(friso_array_t array) { //free the allocation that all the items pointed to //register int t; //if ( flag == 1 ) { @@ -87,40 +83,38 @@ FRISO_API void free_array_list( friso_array_t array ) // } //} - FRISO_FREE( array->items ); - FRISO_FREE( array ); + FRISO_FREE(array->items); + FRISO_FREE(array); } //add a new item to the array. -FRISO_API void array_list_add( friso_array_t array, void *value ) -{ +FRISO_API void array_list_add(friso_array_t array, void *value) { //check the condition to resize. - if ( array->length == array->allocs ) { - resize_array_list( array, array->length * 2 + 1 ); + if(array->length == array->allocs) { + resize_array_list(array, array->length * 2 + 1); } array->items[array->length++] = value; } //insert a new item at a specified position. -FRISO_API void array_list_insert( - friso_array_t array, - uint_t idx, - void *value ) -{ +FRISO_API void array_list_insert( + friso_array_t array, + uint_t idx, + void *value) { register uint_t t; - if ( idx <= array->length ) { + if(idx <= array->length) { //check the condition to resize the array. - if ( array->length == array->allocs ) { - resize_array_list( array, array->length * 2 + 1 ); + if(array->length == array->allocs) { + resize_array_list(array, array->length * 2 + 1); } //move the elements after idx. //for ( t = idx; t < array->length; t++ ) { // array->items[t+1] = array->items[t]; //} - for ( t = array->length - 1; t >= idx; t-- ) { - array->items[t+1] = array->items[t]; + for(t = array->length - 1; t >= idx; t--) { + array->items[t + 1] = array->items[t]; } array->items[idx] = value; @@ -129,9 +123,8 @@ FRISO_API void array_list_insert( } //get the item at a specified position. -FRISO_API void *array_list_get( friso_array_t array, uint_t idx ) -{ - if ( idx < array->length ) { +FRISO_API void *array_list_get(friso_array_t array, uint_t idx) { + if(idx < array->length) { return array->items[idx]; } return NULL; @@ -139,13 +132,12 @@ FRISO_API void *array_list_get( friso_array_t array, uint_t idx ) //set the value of the item at a specified position. //this will return the old value. -FRISO_API void * array_list_set( - friso_array_t array, - uint_t idx, - void * value ) -{ +FRISO_API void * array_list_set( + friso_array_t array, + uint_t idx, + void * value) { void * oval = NULL; - if ( idx < array->length ) { + if(idx < array->length) { oval = array->items[idx]; array->items[idx] = value; } @@ -154,16 +146,15 @@ FRISO_API void * array_list_set( //remove the item at a specified position. //this will return the value of the removed item. -FRISO_API void * array_list_remove( - friso_array_t array, uint_t idx ) -{ +FRISO_API void * array_list_remove( + friso_array_t array, uint_t idx) { register uint_t t; void *oval = NULL; - if ( idx < array->length ) { + if(idx < array->length) { oval = array->items[idx]; //move the elements after idx. - for ( t = idx; t < array->length - 1; t++ ) { + for(t = idx; t < array->length - 1; t++) { array->items[t] = array->items[ t + 1 ]; } array->items[array->length - 1] = NULL; @@ -174,11 +165,10 @@ FRISO_API void * array_list_remove( } /*trim the array list*/ -FRISO_API friso_array_t array_list_trim( friso_array_t array ) -{ - if ( array->length < array->allocs ) { - return resize_array_list( array, array->length ); - } +FRISO_API friso_array_t array_list_trim(friso_array_t array) { + if(array->length < array->allocs) { + return resize_array_list(array, array->length); + } return array; } @@ -188,20 +178,19 @@ FRISO_API friso_array_t array_list_trim( friso_array_t array ) * but will not free the point array allocations, * and will reset the length of it. */ -FRISO_API friso_array_t array_list_clear( friso_array_t array ) -{ +FRISO_API friso_array_t array_list_clear(friso_array_t array) { register uint_t t; //free all the allocations that the array->length's pointer pointed. - for ( t = 0; t < array->length; t++ ) { + for(t = 0; t < array->length; t++) { /*if ( array->items[t] == NULL ) continue; FRISO_FREE( array->items[t] ); */ - array->items[t] = NULL; + array->items[t] = NULL; } //attribute reset. array->length = 0; return array; -} +} //get the size of the array list. (A macro define has replace this.) //FRISO_API uint_t array_list_size( friso_array_t array ) { @@ -214,7 +203,7 @@ FRISO_API friso_array_t array_list_clear( friso_array_t array ) //} //check if the array is empty.(A macro define has replace this.) -//FRISO_API int array_list_empty( friso_array_t array ) +//FRISO_API int array_list_empty( friso_array_t array ) //{ // return ( array->length == 0 ); //} diff --git a/libfriso/friso/src/friso_ctype.c b/libfriso/friso/src/friso_ctype.c index 9194674..1da0fa5 100644 --- a/libfriso/friso/src/friso_ctype.c +++ b/libfriso/friso/src/friso_ctype.c @@ -1,6 +1,6 @@ /** - * friso string type check functions, - * like english/CJK, full-wdith/half-width, punctuation or not. + * friso string type check functions, + * like english/CJK, full-wdith/half-width, punctuation or not. * @see friso_UTF8.c and friso_GBK.c for detail. * * @author lionsoul @@ -13,16 +13,15 @@ #include "friso_API.h" /* check if the specified string is a cn string. - * + * * @return int (true for cn string or false) * */ -FRISO_API int friso_cn_string( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { +FRISO_API int friso_cn_string( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { return utf8_cjk_string(task->unicode); - } else if ( charset == FRISO_GBK ) { + } else if(charset == FRISO_GBK) { return gbk_cn_string(task->buffer); } @@ -30,13 +29,12 @@ FRISO_API int friso_cn_string( } //check if the specified word is a whitespace. -FRISO_API int friso_whitespace( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { +FRISO_API int friso_whitespace( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { return utf8_whitespace(task->unicode); - } else if ( charset == FRISO_GBK ) { + } else if(charset == FRISO_GBK) { return gbk_whitespace(task->buffer); } @@ -46,11 +44,10 @@ FRISO_API int friso_whitespace( //check if the specifiled word is a numeric letter. FRISO_API int friso_numeric_letter( friso_charset_t charset, - friso_task_t task) -{ - if ( charset == FRISO_UTF8 ) { + friso_task_t task) { + if(charset == FRISO_UTF8) { return utf8_numeric_letter((uint_t) task->text[task->idx]); - } else if ( charset == FRISO_GBK ) { + } else if(charset == FRISO_GBK) { return gbk_numeric_letter(task->text + task->idx); } @@ -58,14 +55,13 @@ FRISO_API int friso_numeric_letter( } //check if the specified word is aa english letter. -FRISO_API int friso_en_letter( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_en_letter( ( uint_t ) task->text[task->idx]); - } else if ( charset == FRISO_GBK ) { - return gbk_en_letter( task->text + task->idx ); +FRISO_API int friso_en_letter( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { + return utf8_en_letter((uint_t) task->text[task->idx]); + } else if(charset == FRISO_GBK) { + return gbk_en_letter(task->text + task->idx); } return 0; @@ -73,13 +69,12 @@ FRISO_API int friso_en_letter( //check if the specified word is a half-width letter. // punctuations are inclued. -FRISO_API int friso_halfwidth_en_char( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { +FRISO_API int friso_halfwidth_en_char( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { return utf8_halfwidth_en_char(task->unicode); - } else if ( charset == FRISO_GBK ) { + } else if(charset == FRISO_GBK) { return gbk_halfwidth_en_char(task->buffer[0]); } @@ -88,14 +83,13 @@ FRISO_API int friso_halfwidth_en_char( //check if the specified word is a full-width letter. // full-width punctuations are not included. -FRISO_API int friso_fullwidth_en_char( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_fullwidth_en_char( task->unicode ); - } else if ( charset == FRISO_GBK ) { - return gbk_fullwidth_en_char( task->buffer ); +FRISO_API int friso_fullwidth_en_char( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { + return utf8_fullwidth_en_char(task->unicode); + } else if(charset == FRISO_GBK) { + return gbk_fullwidth_en_char(task->buffer); } return 0; @@ -104,49 +98,45 @@ FRISO_API int friso_fullwidth_en_char( //check if the specified word is an english punctuations. FRISO_API int friso_en_punctuation( friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_en_punctuation( task->unicode ); - } else if ( charset == FRISO_GBK ) { - return gbk_en_punctuation( task->buffer[0] ); + friso_task_t task) { + if(charset == FRISO_UTF8) { + return utf8_en_punctuation(task->unicode); + } else if(charset == FRISO_GBK) { + return gbk_en_punctuation(task->buffer[0]); } return 0; } //check if the specified word ia sn chinese punctuation. -FRISO_API int friso_cn_punctuation( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_cn_punctuation( task->unicode ); - } else if ( charset == FRISO_GBK ) { - return gbk_cn_punctuation( task->buffer ); +FRISO_API int friso_cn_punctuation( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { + return utf8_cn_punctuation(task->unicode); + } else if(charset == FRISO_GBK) { + return gbk_cn_punctuation(task->buffer); } return 0; } -FRISO_API int friso_letter_number( - friso_charset_t charset, - friso_task_t task ) -{ +FRISO_API int friso_letter_number( + friso_charset_t charset, + friso_task_t task) { return 0; } -FRISO_API int friso_other_number( - friso_charset_t charset, - friso_task_t task ) -{ +FRISO_API int friso_other_number( + friso_charset_t charset, + friso_task_t task) { return 0; } //check if the word is a keep punctuation. //@Deprecated -//FRISO_API int friso_keep_punctuation( -// friso_charset_t charset, +//FRISO_API int friso_keep_punctuation( +// friso_charset_t charset, // friso_task_t task ) //{ // if ( charset == FRISO_UTF8 ) @@ -158,40 +148,37 @@ FRISO_API int friso_other_number( //check if the specified char is en english punctuation. // this function is the same as friso_en_punctuation. -FRISO_API int is_en_punctuation( - friso_charset_t charset, char c ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_en_punctuation( (uint_t) c); - } else if ( charset == FRISO_GBK ) { - return gbk_en_punctuation( c ); +FRISO_API int is_en_punctuation( + friso_charset_t charset, char c) { + if(charset == FRISO_UTF8) { + return utf8_en_punctuation((uint_t) c); + } else if(charset == FRISO_GBK) { + return gbk_en_punctuation(c); } return 0; } -//check the specified string is make up with numeric. -FRISO_API int friso_numeric_string( - friso_charset_t charset, - char *buffer ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_numeric_string( buffer ); - } else if ( charset == FRISO_GBK ) { - return gbk_numeric_string( buffer ); +//check the specified string is make up with numeric. +FRISO_API int friso_numeric_string( + friso_charset_t charset, + char *buffer) { + if(charset == FRISO_UTF8) { + return utf8_numeric_string(buffer); + } else if(charset == FRISO_GBK) { + return gbk_numeric_string(buffer); } return 0; } //check the specified string is a decimal string. -FRISO_API int friso_decimal_string( - friso_charset_t charset, char *buffer ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_decimal_string( buffer ); - } else if ( charset == FRISO_GBK ) { - return gbk_decimal_string( buffer ); +FRISO_API int friso_decimal_string( + friso_charset_t charset, char *buffer) { + if(charset == FRISO_UTF8) { + return utf8_decimal_string(buffer); + } else if(charset == FRISO_GBK) { + return gbk_decimal_string(buffer); } return 0; @@ -199,14 +186,13 @@ FRISO_API int friso_decimal_string( //check if the specified char is english uppercase letter. // included full-width and half-width letters. -FRISO_API int friso_uppercase_letter( - friso_charset_t charset, - friso_task_t task ) -{ - if ( charset == FRISO_UTF8 ) { - return utf8_uppercase_letter( task->unicode ); - } else if ( charset == FRISO_GBK ) { - return gbk_uppercase_letter( task->buffer ); +FRISO_API int friso_uppercase_letter( + friso_charset_t charset, + friso_task_t task) { + if(charset == FRISO_UTF8) { + return utf8_uppercase_letter(task->unicode); + } else if(charset == FRISO_GBK) { + return gbk_uppercase_letter(task->buffer); } return 0; @@ -216,27 +202,26 @@ FRISO_API int friso_uppercase_letter( * the type will be the constants defined above. * (include the fullwidth english char.) */ -FRISO_API friso_enchar_t friso_enchar_type( - friso_charset_t charset, - friso_task_t task ) -{ +FRISO_API friso_enchar_t friso_enchar_type( + friso_charset_t charset, + friso_task_t task) { //Unicode or ASCII.(Both UTF-8 and GBK are valid) uint_t u = 0; - if ( charset == FRISO_UTF8 ) { + if(charset == FRISO_UTF8) { u = task->unicode; //if ( u >= 65280 ) u = 65280 - 65248; - } else if ( charset == FRISO_GBK ) { + } else if(charset == FRISO_GBK) { u = (uchar_t)task->buffer[0]; //if ( u == 0xa3 ) ; //full-width. } //range check. - if ( u > 126 || u < 32 ) return FRISO_EN_UNKNOW; - if ( u == 32 ) return FRISO_EN_WHITESPACE; - if ( u >= 48 && u <= 57 ) return FRISO_EN_NUMERIC; - if ( u >= 65 && u <= 90 ) return FRISO_EN_LETTER; - if ( u >= 97 && u <= 122 ) return FRISO_EN_LETTER; + if(u > 126 || u < 32) return FRISO_EN_UNKNOW; + if(u == 32) return FRISO_EN_WHITESPACE; + if(u >= 48 && u <= 57) return FRISO_EN_NUMERIC; + if(u >= 65 && u <= 90) return FRISO_EN_LETTER; + if(u >= 97 && u <= 122) return FRISO_EN_LETTER; return FRISO_EN_PUNCTUATION; } @@ -245,16 +230,15 @@ FRISO_API friso_enchar_t friso_enchar_type( * the type will be the constants defined above. * (the char should be half-width english char only) */ -FRISO_API friso_enchar_t get_enchar_type( char ch ) -{ +FRISO_API friso_enchar_t get_enchar_type(char ch) { uint_t u = (uchar_t) ch; //range check. - if ( u > 126 || u < 32 ) return FRISO_EN_UNKNOW; - if ( u == 32 ) return FRISO_EN_WHITESPACE; - if ( u >= 48 && u <= 57 ) return FRISO_EN_NUMERIC; - if ( u >= 65 && u <= 90 ) return FRISO_EN_LETTER; - if ( u >= 97 && u <= 122 ) return FRISO_EN_LETTER; + if(u > 126 || u < 32) return FRISO_EN_UNKNOW; + if(u == 32) return FRISO_EN_WHITESPACE; + if(u >= 48 && u <= 57) return FRISO_EN_NUMERIC; + if(u >= 65 && u <= 90) return FRISO_EN_LETTER; + if(u >= 97 && u <= 122) return FRISO_EN_LETTER; return FRISO_EN_PUNCTUATION; } diff --git a/libfriso/friso/src/friso_ctype.h b/libfriso/friso/src/friso_ctype.h index 9ef579a..dd403aa 100644 --- a/libfriso/friso/src/friso_ctype.h +++ b/libfriso/friso/src/friso_ctype.h @@ -19,50 +19,50 @@ /** {{{ wrap interface */ /* check if the specified string is a cn string. - * + * * @return int (true for cn string or false) * */ -FRISO_API int friso_cn_string( friso_charset_t, friso_task_t ); +FRISO_API int friso_cn_string(friso_charset_t, friso_task_t); //check if the specified word is a whitespace. -FRISO_API int friso_whitespace( friso_charset_t, friso_task_t ); +FRISO_API int friso_whitespace(friso_charset_t, friso_task_t); //check if the specifiled word is a numeric letter. FRISO_API int friso_numeric_letter(friso_charset_t, friso_task_t); //check if the specified word is a english letter. -FRISO_API int friso_en_letter( friso_charset_t, friso_task_t ); +FRISO_API int friso_en_letter(friso_charset_t, friso_task_t); //check if the specified word is a half-width letter. // punctuations are inclued. -FRISO_API int friso_halfwidth_en_char( friso_charset_t, friso_task_t ); +FRISO_API int friso_halfwidth_en_char(friso_charset_t, friso_task_t); //check if the specified word is a full-width letter. // full-width punctuations are not included. -FRISO_API int friso_fullwidth_en_char( friso_charset_t, friso_task_t ); +FRISO_API int friso_fullwidth_en_char(friso_charset_t, friso_task_t); //check if the specified word is an english punctuations. -FRISO_API int friso_en_punctuation( friso_charset_t, friso_task_t ); +FRISO_API int friso_en_punctuation(friso_charset_t, friso_task_t); //check if the specified word ia sn chinese punctuation. -FRISO_API int friso_cn_punctuation( friso_charset_t, friso_task_t ); +FRISO_API int friso_cn_punctuation(friso_charset_t, friso_task_t); -FRISO_API int friso_letter_number( friso_charset_t, friso_task_t ); -FRISO_API int friso_other_number( friso_charset_t, friso_task_t ); +FRISO_API int friso_letter_number(friso_charset_t, friso_task_t); +FRISO_API int friso_other_number(friso_charset_t, friso_task_t); //check if the word is a keep punctuation. //@Deprecated //FRISO_API int friso_keep_punctuation( friso_charset_t, friso_task_t ); //check the specified string is numeric string. -FRISO_API int friso_numeric_string( friso_charset_t, char * ); +FRISO_API int friso_numeric_string(friso_charset_t, char *); //check the specified string is a decimal string. -FRISO_API int friso_decimal_string( friso_charset_t, char * ); +FRISO_API int friso_decimal_string(friso_charset_t, char *); //check if the specified char is english uppercase letter. // included full-width and half-width letters. -FRISO_API int friso_uppercase_letter( friso_charset_t, friso_task_t ); +FRISO_API int friso_uppercase_letter(friso_charset_t, friso_task_t); //en char type. @@ -83,13 +83,13 @@ typedef enum { * the type will be the constants defined above. * (include the fullwidth english char.) */ -FRISO_API friso_enchar_t friso_enchar_type( friso_charset_t, friso_task_t ); +FRISO_API friso_enchar_t friso_enchar_type(friso_charset_t, friso_task_t); /* get the type of the specified en char. * the type will be the constants defined above. * (the char should be half-width english char only) */ -FRISO_API friso_enchar_t get_enchar_type( char ); +FRISO_API friso_enchar_t get_enchar_type(char); /* }}} */ @@ -102,76 +102,76 @@ FRISO_API friso_enchar_t get_enchar_type( char ); * * @return int the bytes of the current readed word. */ -FRISO_API int utf8_next_word( friso_task_t, uint_t *, fstring ); +FRISO_API int utf8_next_word(friso_task_t, uint_t *, fstring); //get the bytes of a utf-8 char. -FRISO_API int get_utf8_bytes( char ); +FRISO_API int get_utf8_bytes(char); //return the unicode serial number of a given string. -FRISO_API int get_utf8_unicode( const fstring ); +FRISO_API int get_utf8_unicode(const fstring); //convert the unicode serial to a utf-8 string. -FRISO_API int unicode_to_utf8( uint_t, fstring ); +FRISO_API int unicode_to_utf8(uint_t, fstring); //check if the given char is a CJK. -FRISO_API int utf8_cjk_string( uint_t ) ; +FRISO_API int utf8_cjk_string(uint_t) ; /*check the given char is a Basic Latin letter or not. * include all the letters and english puntuations.*/ -FRISO_API int utf8_halfwidth_en_char( uint_t ); +FRISO_API int utf8_halfwidth_en_char(uint_t); /* * check the given char is a full-width latain or not. * include the full-width arabic numeber, letters. * but not the full-width puntuations. */ -FRISO_API int utf8_fullwidth_en_char( uint_t ); +FRISO_API int utf8_fullwidth_en_char(uint_t); //check the given char is a upper case letter or not. // included all the full-width and half-width letters. -FRISO_API int utf8_uppercase_letter( uint_t ); +FRISO_API int utf8_uppercase_letter(uint_t); //check the given char is a lower case letter or not. // included all the full-width and half-width letters. -FRISO_API int utf8_lowercase_letter( uint_t ); +FRISO_API int utf8_lowercase_letter(uint_t); //check the given char is a numeric. // included the full-width and half-width arabic numeric. -FRISO_API int utf8_numeric_letter( uint_t ); +FRISO_API int utf8_numeric_letter(uint_t); /* * check if the given fstring is make up with numeric chars. * both full-width,half-width numeric is ok. */ -FRISO_API int utf8_numeric_string( char * ); +FRISO_API int utf8_numeric_string(char *); -FRISO_API int utf8_decimal_string( char * ); +FRISO_API int utf8_decimal_string(char *); //check the given char is a english char. //(full-width and half-width) //not the punctuation of course. -FRISO_API int utf8_en_letter( uint_t ); +FRISO_API int utf8_en_letter(uint_t); //check the given char is a whitespace or not. -FRISO_API int utf8_whitespace( uint_t ); +FRISO_API int utf8_whitespace(uint_t); /* check if the given char is a letter number like 'ⅠⅡ' */ -FRISO_API int utf8_letter_number( uint_t ); +FRISO_API int utf8_letter_number(uint_t); /* * check if the given char is a other number like '①⑩⑽㈩' */ -FRISO_API int utf8_other_number( uint_t ); +FRISO_API int utf8_other_number(uint_t); //check if the given char is a english punctuation. -FRISO_API int utf8_en_punctuation( uint_t ) ; +FRISO_API int utf8_en_punctuation(uint_t) ; //check if the given char is a chinese punctuation. -FRISO_API int utf8_cn_punctuation( uint_t u ); +FRISO_API int utf8_cn_punctuation(uint_t u); -FRISO_API int is_en_punctuation( friso_charset_t, char ); -//#define is_en_punctuation( c ) utf8_en_punctuation((uint_t) c) +FRISO_API int is_en_punctuation(friso_charset_t, char); +//#define is_en_punctuation( c ) utf8_en_punctuation((uint_t) c) //@Deprecated //FRISO_API int utf8_keep_punctuation( fstring ); @@ -186,67 +186,67 @@ FRISO_API int is_en_punctuation( friso_charset_t, char ); * * @return int the bytes of the current readed word. */ -FRISO_API int gbk_next_word( friso_task_t, uint_t *, fstring ); +FRISO_API int gbk_next_word(friso_task_t, uint_t *, fstring); //get the bytes of a utf-8 char. -FRISO_API int get_gbk_bytes( char ); +FRISO_API int get_gbk_bytes(char); //check if the given char is a gbk char (ANSII string). -FRISO_API int gbk_cn_string( char * ) ; +FRISO_API int gbk_cn_string(char *) ; /*check if the given char is a ASCII letter * include all the letters and english puntuations.*/ -FRISO_API int gbk_halfwidth_en_char( char ); +FRISO_API int gbk_halfwidth_en_char(char); /* * check if the given char is a full-width latain. * include the full-width arabic numeber, letters. * but not the full-width puntuations. */ -FRISO_API int gbk_fullwidth_en_char( char * ); +FRISO_API int gbk_fullwidth_en_char(char *); //check if the given char is a upper case char. // included all the full-width and half-width letters. -FRISO_API int gbk_uppercase_letter( char * ); +FRISO_API int gbk_uppercase_letter(char *); //check if the given char is a lower case char. // included all the full-width and half-width letters. -FRISO_API int gbk_lowercase_letter( char * ); +FRISO_API int gbk_lowercase_letter(char *); //check if the given char is a numeric. // included the full-width and half-width arabic numeric. -FRISO_API int gbk_numeric_letter( char * ); +FRISO_API int gbk_numeric_letter(char *); /* * check if the given fstring is make up with numeric chars. * both full-width,half-width numeric is ok. */ -FRISO_API int gbk_numeric_string( char * ); +FRISO_API int gbk_numeric_string(char *); -FRISO_API int gbk_decimal_string( char * ); +FRISO_API int gbk_decimal_string(char *); //check if the given char is a english(ASCII) char. //(full-width and half-width) //not the punctuation of course. -FRISO_API int gbk_en_letter( char * ); +FRISO_API int gbk_en_letter(char *); //check the specified char is a whitespace or not. -FRISO_API int gbk_whitespace( char * ); +FRISO_API int gbk_whitespace(char *); /* check if the given char is a letter number like 'ⅠⅡ' */ -FRISO_API int gbk_letter_number( char * ); +FRISO_API int gbk_letter_number(char *); /* * check if the given char is a other number like '①⑩⑽㈩' */ -FRISO_API int gbk_other_number( char * ); +FRISO_API int gbk_other_number(char *); //check if the given char is a english punctuation. -FRISO_API int gbk_en_punctuation( char ) ; +FRISO_API int gbk_en_punctuation(char) ; //check the given char is a chinese punctuation. -FRISO_API int gbk_cn_punctuation( char * ); +FRISO_API int gbk_cn_punctuation(char *); //cause the logic handle is the same as the utf8. // here invoke the utf8 interface directly. diff --git a/libfriso/friso/src/friso_hash.c b/libfriso/friso/src/friso_hash.c index bd76608..f16ad3f 100644 --- a/libfriso/friso/src/friso_hash.c +++ b/libfriso/friso/src/friso_hash.c @@ -16,32 +16,30 @@ /* ************************ * mapping function area * **************************/ -__STATIC_API__ uint_t hash( fstring str, uint_t length ) -{ +__STATIC_API__ uint_t hash(fstring str, uint_t length) { //hash code uint_t h = 0; - while ( *str != '\0' ) { - h = h * HASH_FACTOR + ( *str++ ); + while(*str != '\0') { + h = h * HASH_FACTOR + (*str++); } return (h % length); } /*test if a integer is a prime.*/ -__STATIC_API__ int is_prime( int n ) -{ +__STATIC_API__ int is_prime(int n) { int j; - if ( n == 2 || n == 3 ) { + if(n == 2 || n == 3) { return 1; } - if ( n == 1 || n % 2 == 0 ) { + if(n == 1 || n % 2 == 0) { return 0; } - for ( j = 3; j * j < n; j++ ) { - if ( n % j == 0 ) { + for(j = 3; j * j < n; j++) { + if(n % j == 0) { return 0; } } @@ -50,10 +48,9 @@ __STATIC_API__ int is_prime( int n ) } /*get the next prime just after the speicified integer.*/ -__STATIC_API__ int next_prime( int n ) -{ - if ( n % 2 == 0 ) n++; - for ( ; ! is_prime( n ); n = n + 2 ) ; +__STATIC_API__ int next_prime(int n) { + if(n % 2 == 0) n++; + for(; ! is_prime(n); n = n + 2) ; return n; } @@ -76,14 +73,13 @@ __STATIC_API__ int next_prime( int n ) /* ********************************* * static hashtable function area. * ***********************************/ -__STATIC_API__ hash_entry_t new_hash_entry( - fstring key, - void * value, - hash_entry_t next ) -{ - hash_entry_t e = ( hash_entry_t ) - FRISO_MALLOC( sizeof( friso_hash_entry ) ); - if ( e == NULL ) { +__STATIC_API__ hash_entry_t new_hash_entry( + fstring key, + void * value, + hash_entry_t next) { + hash_entry_t e = (hash_entry_t) + FRISO_MALLOC(sizeof(friso_hash_entry)); + if(e == NULL) { ___ALLOCATION_ERROR___ } @@ -96,16 +92,15 @@ __STATIC_API__ hash_entry_t new_hash_entry( } //create blocks copy of entries. -__STATIC_API__ hash_entry_t * create_hash_entries( uint_t blocks ) -{ +__STATIC_API__ hash_entry_t * create_hash_entries(uint_t blocks) { register uint_t t; - hash_entry_t *e = ( hash_entry_t * ) - FRISO_CALLOC( sizeof( hash_entry_t ), blocks ); - if ( e == NULL ) { + hash_entry_t *e = (hash_entry_t *) + FRISO_CALLOC(sizeof(hash_entry_t), blocks); + if(e == NULL) { ___ALLOCATION_ERROR___ } - for ( t = 0; t < blocks; t++ ) { + for(t = 0; t < blocks; t++) { e[t] = NULL; } @@ -113,35 +108,34 @@ __STATIC_API__ hash_entry_t * create_hash_entries( uint_t blocks ) } //a static function to do the re-hash work. -__STATIC_API__ void rebuild_hash( friso_hash_t _hash ) -{ +__STATIC_API__ void rebuild_hash(friso_hash_t _hash) { //printf("rehashed.\n"); //find the next prime as the length of the hashtable. - uint_t t, length = next_prime( _hash->length * 2 + 1 ); + uint_t t, length = next_prime(_hash->length * 2 + 1); hash_entry_t e, next, *_src = _hash->table, \ - *table = create_hash_entries( length ); + *table = create_hash_entries(length); uint_t bucket; //copy the nodes - for ( t = 0; t < _hash->length; t++ ) { - e = *( _src + t ); - if ( e != NULL ) { + for(t = 0; t < _hash->length; t++) { + e = *(_src + t); + if(e != NULL) { do { next = e->_next; - bucket = hash( e->_key, length ); + bucket = hash(e->_key, length); e->_next = table[bucket]; table[bucket] = e; e = next; - } while ( e != NULL ); + } while(e != NULL); } } _hash->table = table; _hash->length = length; - _hash->threshold = ( uint_t ) ( _hash->length * _hash->factor ); + _hash->threshold = (uint_t)(_hash->length * _hash->factor); //free the old hash_entry_t blocks allocations. - FRISO_FREE( _src ); + FRISO_FREE(_src); } /* ******************************** @@ -149,10 +143,9 @@ __STATIC_API__ void rebuild_hash( friso_hash_t _hash ) * ********************************/ //create a new hash table. -FRISO_API friso_hash_t new_hash_table( void ) -{ - friso_hash_t _hash = ( friso_hash_t ) FRISO_MALLOC( sizeof ( friso_hash_cdt ) ); - if ( _hash == NULL ) { +FRISO_API friso_hash_t new_hash_table(void) { + friso_hash_t _hash = (friso_hash_t) FRISO_MALLOC(sizeof(friso_hash_cdt)); + if(_hash == NULL) { ___ALLOCATION_ERROR___ } @@ -160,51 +153,49 @@ FRISO_API friso_hash_t new_hash_table( void ) _hash->length = DEFAULT_LENGTH; _hash->size = 0; _hash->factor = DEFAULT_FACTOR; - _hash->threshold = ( uint_t ) ( _hash->length * _hash->factor ); - _hash->table = create_hash_entries( _hash->length ); + _hash->threshold = (uint_t)(_hash->length * _hash->factor); + _hash->table = create_hash_entries(_hash->length); return _hash; } -FRISO_API void free_hash_table( - friso_hash_t _hash, - fhash_callback_fn_t fentry_func ) -{ +FRISO_API void free_hash_table( + friso_hash_t _hash, + fhash_callback_fn_t fentry_func) { register uint_t j; hash_entry_t e, n; - for ( j = 0; j < _hash->length; j++ ) { - e = *( _hash->table + j ); - for ( ; e != NULL ; ) { + for(j = 0; j < _hash->length; j++) { + e = *(_hash->table + j); + for(; e != NULL ;) { n = e->_next; - if ( fentry_func != NULL ) fentry_func(e); - FRISO_FREE( e ); + if(fentry_func != NULL) fentry_func(e); + FRISO_FREE(e); e = n; } } //free the pointer array block ( 4 * htable->length continuous bytes ). - FRISO_FREE( _hash->table ); - FRISO_FREE( _hash ); + FRISO_FREE(_hash->table); + FRISO_FREE(_hash); } //put a new mapping insite. //the value cannot be NULL. -FRISO_API void *hash_put_mapping( - friso_hash_t _hash, - fstring key, - void * value ) -{ - uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length ); - hash_entry_t e = *( _hash->table + bucket ); +FRISO_API void *hash_put_mapping( + friso_hash_t _hash, + fstring key, + void * value) { + uint_t bucket = (key == NULL) ? 0 : hash(key, _hash->length); + hash_entry_t e = *(_hash->table + bucket); void *oval = NULL; //check the given key is already exists or not. - for ( ; e != NULL; e = e->_next ) { - if ( key == e->_key - || ( key != NULL && e->_key != NULL - && strcmp( key, e->_key ) == 0 ) ) { + for(; e != NULL; e = e->_next) { + if(key == e->_key + || (key != NULL && e->_key != NULL + && strcmp(key, e->_key) == 0)) { oval = e->_val; //bak the old value e->_key = key; e->_val = value; @@ -213,29 +204,28 @@ FRISO_API void *hash_put_mapping( } //put a new mapping into the hashtable. - _hash->table[bucket] = new_hash_entry( key, value, _hash->table[bucket] ); + _hash->table[bucket] = new_hash_entry(key, value, _hash->table[bucket]); _hash->size++; //check the condition to rebuild the hashtable. - if ( _hash->size >= _hash->threshold ) { - rebuild_hash( _hash ); + if(_hash->size >= _hash->threshold) { + rebuild_hash(_hash); } return oval; } //check the existence of the mapping associated with the given key. -FRISO_API int hash_exist_mapping( - friso_hash_t _hash, fstring key ) -{ - uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length ); +FRISO_API int hash_exist_mapping( + friso_hash_t _hash, fstring key) { + uint_t bucket = (key == NULL) ? 0 : hash(key, _hash->length); hash_entry_t e; - for ( e = *( _hash->table + bucket ); - e != NULL; e = e->_next ) { - if ( key == e->_key - || ( key != NULL && e->_key != NULL - && strcmp( key, e->_key ) == 0 )) { + for(e = *(_hash->table + bucket); + e != NULL; e = e->_next) { + if(key == e->_key + || (key != NULL && e->_key != NULL + && strcmp(key, e->_key) == 0)) { return 1; } } @@ -244,16 +234,15 @@ FRISO_API int hash_exist_mapping( } //get the value associated with the given key. -FRISO_API void *hash_get_value( friso_hash_t _hash, fstring key ) -{ - uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length ); +FRISO_API void *hash_get_value(friso_hash_t _hash, fstring key) { + uint_t bucket = (key == NULL) ? 0 : hash(key, _hash->length); hash_entry_t e; - for ( e = *( _hash->table + bucket ); - e != NULL; e = e->_next ) { - if ( key == e->_key - || ( key != NULL && e->_key != NULL - && strcmp( key, e->_key ) == 0 )) { + for(e = *(_hash->table + bucket); + e != NULL; e = e->_next) { + if(key == e->_key + || (key != NULL && e->_key != NULL + && strcmp(key, e->_key) == 0)) { return e->_val; } } @@ -262,21 +251,20 @@ FRISO_API void *hash_get_value( friso_hash_t _hash, fstring key ) } //remove the mapping associated with the given key. -FRISO_API hash_entry_t hash_remove_mapping( - friso_hash_t _hash, fstring key ) -{ - uint_t bucket = ( key == NULL ) ? 0 : hash( key, _hash->length ); +FRISO_API hash_entry_t hash_remove_mapping( + friso_hash_t _hash, fstring key) { + uint_t bucket = (key == NULL) ? 0 : hash(key, _hash->length); hash_entry_t e, prev = NULL; hash_entry_t b; - for ( e = *( _hash->table + bucket ); - e != NULL; prev = e, e = e->_next ) { - if ( key == e->_key - || ( key != NULL && e->_key != NULL - && strcmp( key, e->_key ) == 0 ) ) { + for(e = *(_hash->table + bucket); + e != NULL; prev = e, e = e->_next) { + if(key == e->_key + || (key != NULL && e->_key != NULL + && strcmp(key, e->_key) == 0)) { b = e; //the node located at *( htable->table + bucket ) - if ( prev == NULL ) { + if(prev == NULL) { _hash->table[bucket] = e->_next; } else { prev->_next = e->_next; diff --git a/libfriso/friso/src/friso_lexicon.c b/libfriso/friso/src/friso_lexicon.c index 0517d7e..cc07384 100644 --- a/libfriso/friso/src/friso_lexicon.c +++ b/libfriso/friso/src/friso_lexicon.c @@ -1,7 +1,7 @@ /* * friso lexicon functions implementation. * used to deal with the friso lexicon, like: load,remove,match... - * + * * @author lionsoul */ @@ -15,16 +15,15 @@ #define __FRISO_LEX_IFILE__ "friso.lex.ini" //create a new lexicon -FRISO_API friso_dic_t friso_dic_new() -{ +FRISO_API friso_dic_t friso_dic_new() { register uint_t t; - friso_dic_t dic = ( friso_dic_t ) FRISO_CALLOC( - sizeof( friso_hash_t ), __FRISO_LEXICON_LENGTH__ ); - if ( dic == NULL ) { + friso_dic_t dic = (friso_dic_t) FRISO_CALLOC( + sizeof(friso_hash_t), __FRISO_LEXICON_LENGTH__); + if(dic == NULL) { ___ALLOCATION_ERROR___ } - for ( t = 0; t < __FRISO_LEXICON_LENGTH__; t++ ) { + for(t = 0; t < __FRISO_LEXICON_LENGTH__; t++) { dic[t] = new_hash_table(); } @@ -33,24 +32,23 @@ FRISO_API friso_dic_t friso_dic_new() /** * default callback function to invoke - * when free the friso dictionary . + * when free the friso dictionary . * * @date 2013-06-12 */ -__STATIC_API__ void default_fdic_callback( hash_entry_t e ) -{ +__STATIC_API__ void default_fdic_callback(hash_entry_t e) { register uint_t i; friso_array_t syn; - lex_entry_t lex = ( lex_entry_t ) e->_val; + lex_entry_t lex = (lex_entry_t) e->_val; //free the lex->word - FRISO_FREE( lex->word ); + FRISO_FREE(lex->word); //free the lex->syn if it is not NULL - if ( lex->syn != NULL ) { + if(lex->syn != NULL) { syn = lex->syn; - for ( i = 0; i < syn->length; i++ ) { - FRISO_FREE( syn->items[i] ); + for(i = 0; i < syn->length; i++) { + FRISO_FREE(syn->items[i]); } - free_array_list( syn ); + free_array_list(syn); } //free the e->_val @@ -58,29 +56,27 @@ __STATIC_API__ void default_fdic_callback( hash_entry_t e ) FRISO_FREE(lex); } -FRISO_API void friso_dic_free( friso_dic_t dic ) -{ +FRISO_API void friso_dic_free(friso_dic_t dic) { register uint_t t; - for ( t = 0; t < __FRISO_LEXICON_LENGTH__; t++ ) { + for(t = 0; t < __FRISO_LEXICON_LENGTH__; t++) { //free the hash table - free_hash_table( dic[t], default_fdic_callback ); + free_hash_table(dic[t], default_fdic_callback); } - FRISO_FREE( dic ); + FRISO_FREE(dic); } //create a new lexicon entry -FRISO_API lex_entry_t new_lex_entry( - fstring word, - friso_array_t syn, - uint_t fre, - uint_t length, - uint_t type ) -{ - lex_entry_t e = ( lex_entry_t ) - FRISO_MALLOC( sizeof( lex_entry_cdt ) ); - if ( e == NULL ) { +FRISO_API lex_entry_t new_lex_entry( + fstring word, + friso_array_t syn, + uint_t fre, + uint_t length, + uint_t type) { + lex_entry_t e = (lex_entry_t) + FRISO_MALLOC(sizeof(lex_entry_cdt)); + if(e == NULL) { ___ALLOCATION_ERROR___ } @@ -107,20 +103,19 @@ FRISO_API lex_entry_t new_lex_entry( * 3. free its pos. (friso_array_t) * 4. free the lex_entry_t. */ -FRISO_API void free_lex_entry_full( lex_entry_t e ) -{ +FRISO_API void free_lex_entry_full(lex_entry_t e) { register uint_t i; friso_array_t syn; //free the lex->word - FRISO_FREE( e->word ); + FRISO_FREE(e->word); //free the lex->syn if it is not NULL - if ( e->syn != NULL ) { + if(e->syn != NULL) { syn = e->syn; - for ( i = 0; i < syn->length; i++ ) { - FRISO_FREE( syn->items[i] ); + for(i = 0; i < syn->length; i++) { + FRISO_FREE(syn->items[i]); } - free_array_list( syn ); + free_array_list(syn); } //free the e->_val @@ -128,8 +123,7 @@ FRISO_API void free_lex_entry_full( lex_entry_t e ) FRISO_FREE(e); } -FRISO_API void free_lex_entry( lex_entry_t e ) -{ +FRISO_API void free_lex_entry(lex_entry_t e) { //if ( e->syn != NULL ) { // if ( flag == 1 ) free_array_list( e->syn); // else free_array_list( e->syn ); @@ -140,37 +134,35 @@ FRISO_API void free_lex_entry( lex_entry_t e ) //add a new entry to the dictionary. -FRISO_API void friso_dic_add( - friso_dic_t dic, - friso_lex_t lex, - fstring word, - friso_array_t syn ) -{ +FRISO_API void friso_dic_add( + friso_dic_t dic, + friso_lex_t lex, + fstring word, + friso_array_t syn) { void *olex = NULL; - if ( lex >= 0 && lex < __FRISO_LEXICON_LENGTH__ ) { + if(lex >= 0 && lex < __FRISO_LEXICON_LENGTH__) { //printf("lex=%d, word=%s, syn=%s\n", lex, word, syn); - olex = hash_put_mapping( dic[lex], word, - new_lex_entry( word, syn, 0, - (uint_t) strlen(word), (uint_t) lex ) ); - if ( olex != NULL ) { + olex = hash_put_mapping(dic[lex], word, + new_lex_entry(word, syn, 0, + (uint_t) strlen(word), (uint_t) lex)); + if(olex != NULL) { free_lex_entry_full((lex_entry_t)olex); } } } -FRISO_API void friso_dic_add_with_fre( - friso_dic_t dic, - friso_lex_t lex, - fstring word, - friso_array_t syn, - uint_t frequency ) -{ +FRISO_API void friso_dic_add_with_fre( + friso_dic_t dic, + friso_lex_t lex, + fstring word, + friso_array_t syn, + uint_t frequency) { void *olex = NULL; - if ( lex >= 0 && lex < __FRISO_LEXICON_LENGTH__ ) { - olex = hash_put_mapping( dic[lex], word, - new_lex_entry( word, syn, frequency, - ( uint_t ) strlen(word), ( uint_t ) lex ) ); - if ( olex != NULL ) { + if(lex >= 0 && lex < __FRISO_LEXICON_LENGTH__) { + olex = hash_put_mapping(dic[lex], word, + new_lex_entry(word, syn, frequency, + (uint_t) strlen(word), (uint_t) lex)); + if(olex != NULL) { free_lex_entry_full((lex_entry_t)olex); } } @@ -179,39 +171,37 @@ FRISO_API void friso_dic_add_with_fre( /* * read a line from a specified stream. * the newline will be cleared. - * - * @date 2012-11-24 + * + * @date 2012-11-24 */ -FRISO_API fstring file_get_line( fstring __dst, FILE * _stream ) -{ +FRISO_API fstring file_get_line(fstring __dst, FILE * _stream) { register int c; fstring cs; cs = __dst; - while ( ( c = fgetc( _stream ) ) != EOF ) { - if ( c == '\n' ) break; - *cs++ = c; + while((c = fgetc(_stream)) != EOF) { + if(c == '\n') break; + *cs++ = c; } *cs = '\0'; - return ( c == EOF && cs == __dst ) ? NULL : __dst; + return (c == EOF && cs == __dst) ? NULL : __dst; } /* - * static function to copy a string. + * static function to copy a string. */ ///instead of memcpy -__STATIC_API__ fstring string_copy( - fstring _src, - fstring __dst, - uint_t blocks ) -{ +__STATIC_API__ fstring string_copy( + fstring _src, + fstring __dst, + uint_t blocks) { register fstring __src = _src; register uint_t t; - for ( t = 0; t < blocks; t++ ) { - if ( *__src == '\0' ) break; + for(t = 0; t < blocks; t++) { + if(*__src == '\0') break; __dst[t] = *__src++; } __dst[t] = '\0'; @@ -220,24 +210,23 @@ __STATIC_API__ fstring string_copy( } /** - * make a heap allocation, and copy the - * source fstring to the new allocation, and - * you should free it after use it . + * make a heap allocation, and copy the + * source fstring to the new allocation, and + * you should free it after use it . * * @param _src source fstring * @param blocks number of bytes to copy */ -__STATIC_API__ fstring string_copy_heap( - fstring _src, uint_t blocks ) -{ +__STATIC_API__ fstring string_copy_heap( + fstring _src, uint_t blocks) { register uint_t t; - fstring str = ( fstring ) FRISO_MALLOC( blocks + 1 ); - if ( str == NULL ) { + fstring str = (fstring) FRISO_MALLOC(blocks + 1); + if(str == NULL) { ___ALLOCATION_ERROR___; } - for ( t = 0; t < blocks; t++ ) { + for(t = 0; t < blocks; t++) { //if ( *_src == '\0' ) break; str[t] = *_src++; } @@ -249,15 +238,14 @@ __STATIC_API__ fstring string_copy_heap( /* * find the postion of the first appear of the given char. * address of the char in the fstring will be return . - * if not found NULL will be return . + * if not found NULL will be return . */ -__STATIC_API__ fstring indexOf( fstring __str, char delimiter ) -{ +__STATIC_API__ fstring indexOf(fstring __str, char delimiter) { uint_t i, __length__; - __length__ = strlen( __str ); - for ( i = 0; i < __length__; i++ ) { - if ( __str[i] == delimiter ) { + __length__ = strlen(__str); + for(i = 0; i < __length__; i++) { + if(__str[i] == delimiter) { return __str + i; } } @@ -266,20 +254,19 @@ __STATIC_API__ fstring indexOf( fstring __str, char delimiter ) } /** - * load all the valid wors from a specified lexicon file . + * load all the valid wors from a specified lexicon file . * * @param dic friso dictionary instance (A hash array) * @param lex the lexicon type * @param lex_file the path of the lexicon file * @param length the maximum length of the word item */ -FRISO_API void friso_dic_load( - friso_t friso, - friso_config_t config, - friso_lex_t lex, - fstring lex_file, - uint_t length ) -{ +FRISO_API void friso_dic_load( + friso_t friso, + friso_config_t config, + friso_lex_t lex, + fstring lex_file, + uint_t length) { FILE * _stream; char __char[1024], _buffer[512]; @@ -292,35 +279,35 @@ FRISO_API void friso_dic_load( friso_array_t sywords; uint_t _fre; - if ( ( _stream = fopen( lex_file, "rb" ) ) != NULL ) { - while ( ( _line = file_get_line( __char, _stream ) ) != NULL ) { + if((_stream = fopen(lex_file, "rb")) != NULL) { + while((_line = file_get_line(__char, _stream)) != NULL) { //clear up the notes //make sure the length of the line is greater than 1. //like the single '#' mark in stopwords dictionary. - if ( _line[0] == '#' && strlen(_line) > 1 ) continue; + if(_line[0] == '#' && strlen(_line) > 1) continue; //handle the stopwords. - if ( lex == __LEX_STOPWORDS__ ) { + if(lex == __LEX_STOPWORDS__) { //clean the chinese words that its length is greater than max length. - if ( ((int)_line[0]) < 0 && strlen( _line ) > length ) continue; - friso_dic_add( friso->dic, __LEX_STOPWORDS__, - string_copy_heap( _line, strlen(_line) ), NULL ); + if(((int)_line[0]) < 0 && strlen(_line) > length) continue; + friso_dic_add(friso->dic, __LEX_STOPWORDS__, + string_copy_heap(_line, strlen(_line)), NULL); continue; } //split the fstring with '/'. - string_split_reset( &sse, "/", _line); - if ( string_split_next( &sse, _buffer ) == NULL ) { + string_split_reset(&sse, "/", _line); + if(string_split_next(&sse, _buffer) == NULL) { continue; } //1. get the word. - _word = string_copy_heap( _buffer, strlen(_buffer) ); + _word = string_copy_heap(_buffer, strlen(_buffer)); - if ( string_split_next( &sse, _buffer ) == NULL ) { - //normal lexicon type, + if(string_split_next(&sse, _buffer) == NULL) { + //normal lexicon type, //add them to the dictionary directly - friso_dic_add( friso->dic, lex, _word, NULL ); + friso_dic_add(friso->dic, lex, _word, NULL); continue; } @@ -330,87 +317,86 @@ FRISO_API void friso_dic_load( * but not for __LEX_ECM_WORDS__ and english __LEX_STOPWORDS__ * and __LEX_CEM_WORDS__. */ - if ( ! ( lex == __LEX_ECM_WORDS__ || lex == __LEX_CEM_WORDS__ ) - && strlen( _word ) > length ) { + if(!(lex == __LEX_ECM_WORDS__ || lex == __LEX_CEM_WORDS__) + && strlen(_word) > length) { FRISO_FREE(_word); continue; } //2. get the synonyms words. _syn = NULL; - if ( strcmp( _buffer, "null" ) != 0 ) { - _syn = string_copy( _buffer, _sbuffer, strlen(_buffer) ); + if(strcmp(_buffer, "null") != 0) { + _syn = string_copy(_buffer, _sbuffer, strlen(_buffer)); } //3. get the word frequency if it available. _fre = 0; - if ( string_split_next( &sse, _buffer ) != NULL ) { - _fre = atoi( _buffer ); + if(string_split_next(&sse, _buffer) != NULL) { + _fre = atoi(_buffer); } /** * Here: - * split the synonyms words with mark "," + * split the synonyms words with mark "," * and put them in a array list if the synonyms is not NULL */ sywords = NULL; - if ( config->add_syn && _syn != NULL ) { - string_split_reset( &sse, ",", _sbuffer ); + if(config->add_syn && _syn != NULL) { + string_split_reset(&sse, ",", _sbuffer); sywords = new_array_list_with_opacity(5); - while ( string_split_next( &sse, _buffer ) != NULL ) { - if ( strlen(_buffer) > length ) continue; - array_list_add( sywords, - string_copy_heap(_buffer, strlen(_buffer)) ); + while(string_split_next(&sse, _buffer) != NULL) { + if(strlen(_buffer) > length) continue; + array_list_add(sywords, + string_copy_heap(_buffer, strlen(_buffer))); } - sywords = array_list_trim( sywords ); + sywords = array_list_trim(sywords); } //4. add the word item - friso_dic_add_with_fre( - friso->dic, lex, _word, sywords, _fre ); - } + friso_dic_add_with_fre( + friso->dic, lex, _word, sywords, _fre); + } - fclose( _stream ); + fclose(_stream); } else { fprintf(stderr, "Warning: Fail to open lexicon file %s\n", lex_file); fprintf(stderr, "Warning: Without lexicon file, segment results will not correct \n"); - } + } } /** - * get the lexicon type index with the specified - * type keywords . + * get the lexicon type index with the specified + * type keywords . * * @see friso.h#friso_lex_t * @param _key * @return int */ -__STATIC_API__ friso_lex_t get_lexicon_type_with_constant( fstring _key ) -{ - if ( strcmp( _key, "__LEX_CJK_WORDS__" ) == 0 ) { +__STATIC_API__ friso_lex_t get_lexicon_type_with_constant(fstring _key) { + if(strcmp(_key, "__LEX_CJK_WORDS__") == 0) { return __LEX_CJK_WORDS__; - } else if ( strcmp( _key, "__LEX_CJK_UNITS__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CJK_UNITS__") == 0) { return __LEX_CJK_UNITS__; - } else if ( strcmp( _key, "__LEX_ECM_WORDS__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_ECM_WORDS__") == 0) { return __LEX_ECM_WORDS__; - } else if ( strcmp( _key, "__LEX_CEM_WORDS__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CEM_WORDS__") == 0) { return __LEX_CEM_WORDS__; - } else if ( strcmp( _key, "__LEX_CN_LNAME__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CN_LNAME__") == 0) { return __LEX_CN_LNAME__; - } else if ( strcmp( _key, "__LEX_CN_SNAME__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CN_SNAME__") == 0) { return __LEX_CN_SNAME__; - } else if ( strcmp( _key, "__LEX_CN_DNAME1__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CN_DNAME1__") == 0) { return __LEX_CN_DNAME1__; - } else if ( strcmp( _key, "__LEX_CN_DNAME2__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CN_DNAME2__") == 0) { return __LEX_CN_DNAME2__; - } else if ( strcmp( _key, "__LEX_CN_LNA__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_CN_LNA__") == 0) { return __LEX_CN_LNA__; - } else if ( strcmp( _key, "__LEX_STOPWORDS__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_STOPWORDS__") == 0) { return __LEX_STOPWORDS__; - } else if ( strcmp( _key, "__LEX_ENPUN_WORDS__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_ENPUN_WORDS__") == 0) { return __LEX_ENPUN_WORDS__; - } else if ( strcmp( _key, "__LEX_EN_WORDS__" ) == 0 ) { + } else if(strcmp(_key, "__LEX_EN_WORDS__") == 0) { return __LEX_EN_WORDS__; } @@ -424,14 +410,13 @@ __STATIC_API__ friso_lex_t get_lexicon_type_with_constant( fstring _key ) * @param friso friso instance * @param config friso_config instance * @param _path dictionary directory - * @param _limitts words length limit + * @param _limitts words length limit */ -FRISO_API void friso_dic_load_from_ifile( - friso_t friso, - friso_config_t config, - fstring _path, - uint_t _limits ) -{ +FRISO_API void friso_dic_load_from_ifile( + friso_t friso, + friso_config_t config, + fstring _path, + uint_t _limits) { //1.parse the configuration file. FILE *__stream; @@ -443,116 +428,112 @@ FRISO_API void friso_dic_load_from_ifile( //get the lexicon configruation file path sb = new_string_buffer(); - string_buffer_append( sb, _path ); - string_buffer_append( sb, __FRISO_LEX_IFILE__ ); + string_buffer_append(sb, _path); + string_buffer_append(sb, __FRISO_LEX_IFILE__); //printf("%s\n", sb->buffer); - if ( ( __stream = fopen( sb->buffer, "rb" ) ) != NULL ) { - while ( ( __line__ = - file_get_line( __chars__, __stream ) ) != NULL ) { + if((__stream = fopen(sb->buffer, "rb")) != NULL) { + while((__line__ = + file_get_line(__chars__, __stream)) != NULL) { //comment filter. - if ( __line__[0] == '#' ) continue; - if ( __line__[0] == '\0' ) continue; + if(__line__[0] == '#') continue; + if(__line__[0] == '\0') continue; - __length__ = strlen( __line__ ); + __length__ = strlen(__line__); //item start - if ( __line__[ __length__ - 1 ] == '[' ) { + if(__line__[ __length__ - 1 ] == '[') { //get the type key - for ( i = 0; i < __length__ - && ( __line__[i] == ' ' || __line__[i] == '\t' ); i++ ); - for ( t = 0; i < __length__; i++,t++ ) { - if ( __line__[i] == ' ' - || __line__[i] == '\t' || __line__[i] == ':' ) break; + for(i = 0; i < __length__ + && (__line__[i] == ' ' || __line__[i] == '\t'); i++); + for(t = 0; i < __length__; i++, t++) { + if(__line__[i] == ' ' + || __line__[i] == '\t' || __line__[i] == ':') break; __key__[t] = __line__[i]; } __key__[t] = '\0'; //get the lexicon type lex_t = get_lexicon_type_with_constant(__key__); - if ( lex_t == -1 ) continue; + if(lex_t == -1) continue; //printf("key=%s, type=%d\n", __key__, lex_t ); - while ( ( __line__ = file_get_line( __chars__, __stream ) ) != NULL ) { + while((__line__ = file_get_line(__chars__, __stream)) != NULL) { //comments filter. - if ( __line__[0] == '#' ) continue; - if ( __line__[0] == '\0' ) continue; + if(__line__[0] == '#') continue; + if(__line__[0] == '\0') continue; - __length__ = strlen( __line__ ); - if ( __line__[ __length__ - 1 ] == ']' ) break; + __length__ = strlen(__line__); + if(__line__[ __length__ - 1 ] == ']') break; - for ( i = 0; i < __length__ - && ( __line__[i] == ' ' || __line__[i] == '\t' ); i++ ); - for ( t = 0; i < __length__; i++,t++ ) { - if ( __line__[i] == ' ' - || __line__[i] == '\t' || __line__[i] == ';' ) break; - __key__[t] = __line__[i]; + for(i = 0; i < __length__ + && (__line__[i] == ' ' || __line__[i] == '\t'); i++); + for(t = 0; i < __length__; i++, t++) { + if(__line__[i] == ' ' + || __line__[i] == '\t' || __line__[i] == ';') break; + __key__[t] = __line__[i]; } __key__[t] = '\0'; //load the lexicon item from the lexicon file. - string_buffer_clear( sb ); - string_buffer_append( sb, _path ); - string_buffer_append( sb, __key__ ); + string_buffer_clear(sb); + string_buffer_append(sb, _path); + string_buffer_append(sb, __key__); //printf("key=%s, type=%d\n", __key__, lex_t); - friso_dic_load( friso, config, lex_t, sb->buffer, _limits ); + friso_dic_load(friso, config, lex_t, sb->buffer, _limits); } - } + } } //end while - fclose( __stream ); + fclose(__stream); } else { fprintf(stderr, "Warning: Fail to open the lexicon configuration file %s\n", sb->buffer); fprintf(stderr, "Warning: Without lexicon file, segment results will not correct \n"); } - free_string_buffer(sb); + free_string_buffer(sb); } //match the item. -FRISO_API int friso_dic_match( - friso_dic_t dic, - friso_lex_t lex, - fstring word ) -{ - if ( lex >= 0 && lex < __FRISO_LEXICON_LENGTH__ ) { - return hash_exist_mapping( dic[lex], word ); +FRISO_API int friso_dic_match( + friso_dic_t dic, + friso_lex_t lex, + fstring word) { + if(lex >= 0 && lex < __FRISO_LEXICON_LENGTH__) { + return hash_exist_mapping(dic[lex], word); } return 0; } //get the lex_entry_t associated with the word. -FRISO_API lex_entry_t friso_dic_get( - friso_dic_t dic, - friso_lex_t lex, - fstring word ) -{ - if ( lex >= 0 && lex < __FRISO_LEXICON_LENGTH__ ) { - return ( lex_entry_t ) hash_get_value( dic[lex], word ); +FRISO_API lex_entry_t friso_dic_get( + friso_dic_t dic, + friso_lex_t lex, + fstring word) { + if(lex >= 0 && lex < __FRISO_LEXICON_LENGTH__) { + return (lex_entry_t) hash_get_value(dic[lex], word); } return NULL; } //get the size of the specified type dictionary. -FRISO_API uint_t friso_spec_dic_size( - friso_dic_t dic, - friso_lex_t lex ) -{ - if ( lex >= 0 && lex < __FRISO_LEXICON_LENGTH__ ) { - return hash_get_size( dic[lex] ); +FRISO_API uint_t friso_spec_dic_size( + friso_dic_t dic, + friso_lex_t lex) { + if(lex >= 0 && lex < __FRISO_LEXICON_LENGTH__) { + return hash_get_size(dic[lex]); } return 0; } //get size of the whole dictionary. -FRISO_API uint_t friso_all_dic_size( - friso_dic_t dic ) -{ +FRISO_API uint_t friso_all_dic_size( + friso_dic_t dic) { register uint_t size = 0, t; - for ( t = 0; t < __FRISO_LEXICON_LENGTH__; t++ ) { - size += hash_get_size( dic[t] ); + for(t = 0; t < __FRISO_LEXICON_LENGTH__; t++) { + size += hash_get_size(dic[t]); } return size; diff --git a/libfriso/friso/src/friso_link.c b/libfriso/friso/src/friso_link.c index a185204..661e15e 100644 --- a/libfriso/friso/src/friso_link.c +++ b/libfriso/friso/src/friso_link.c @@ -10,14 +10,13 @@ #include //create a new link list node. -__STATIC_API__ link_node_t new_node_entry( - void * value, - link_node_t prev, - link_node_t next ) -{ - link_node_t node = ( link_node_t ) - FRISO_MALLOC( sizeof( link_node_entry ) ); - if ( node == NULL ) { +__STATIC_API__ link_node_t new_node_entry( + void * value, + link_node_t prev, + link_node_t next) { + link_node_t node = (link_node_t) + FRISO_MALLOC(sizeof(link_node_entry)); + if(node == NULL) { ___ALLOCATION_ERROR___ } @@ -29,17 +28,16 @@ __STATIC_API__ link_node_t new_node_entry( } //create a new link list -FRISO_API friso_link_t new_link_list( void ) -{ - friso_link_t e = ( friso_link_t ) - FRISO_MALLOC( sizeof( friso_link_entry ) ); - if ( e == NULL ) { +FRISO_API friso_link_t new_link_list(void) { + friso_link_t e = (friso_link_t) + FRISO_MALLOC(sizeof(friso_link_entry)); + if(e == NULL) { ___ALLOCATION_ERROR___ } //initialize the entry - e->head = new_node_entry( NULL, NULL, NULL ); - e->tail = new_node_entry( NULL, e->head, NULL ); + e->head = new_node_entry(NULL, NULL, NULL); + e->tail = new_node_entry(NULL, e->head, NULL); e->head->next = e->tail; e->size = 0; @@ -47,28 +45,25 @@ FRISO_API friso_link_t new_link_list( void ) } //free the given link list -FRISO_API void free_link_list( friso_link_t link ) -{ +FRISO_API void free_link_list(friso_link_t link) { link_node_t node, next; - for ( node = link->head; node != NULL; ) { + for(node = link->head; node != NULL;) { next = node->next; - FRISO_FREE( node ); + FRISO_FREE(node); node = next; } - FRISO_FREE( link ); + FRISO_FREE(link); } //clear all nodes in the link list. -FRISO_API friso_link_t link_list_clear( - friso_link_t link ) -{ +FRISO_API friso_link_t link_list_clear( + friso_link_t link) { link_node_t node, next; //free all the middle nodes. - for ( node = link->head->next; node != link->tail; ) - { + for(node = link->head->next; node != link->tail;) { next = node->next; - FRISO_FREE( node ); + FRISO_FREE(node); node = next; } @@ -94,22 +89,20 @@ FRISO_API friso_link_t link_list_clear( * find the node at a specified position. * static */ -__STATIC_API__ link_node_t get_node( - friso_link_t link, uint_t idx ) -{ +__STATIC_API__ link_node_t get_node( + friso_link_t link, uint_t idx) { link_node_t p = NULL; register uint_t t; - if ( idx >= 0 && idx < link->size ) - { - if ( idx < link->size / 2 ) { //find from the head. + if(idx >= 0 && idx < link->size) { + if(idx < link->size / 2) { //find from the head. p = link->head; - for ( t = 0; t <= idx; t++ ) - p = p->next; + for(t = 0; t <= idx; t++) + p = p->next; } else { //find from the tail. p = link->tail; - for ( t = link->size; t > idx; t-- ) - p = p->prev; + for(t = link->size; t > idx; t--) + p = p->prev; } } @@ -120,10 +113,10 @@ __STATIC_API__ link_node_t get_node( * insert a node before the given node. * static */ -//__STATIC_API__ void insert_before( -// friso_link_t link, -// link_node_t node, -// void * value ) +//__STATIC_API__ void insert_before( +// friso_link_t link, +// link_node_t node, +// void * value ) //{ // link_node_t e = new_node_entry( value, node->prev, node ); // e->prev->next = e; @@ -147,48 +140,44 @@ __STATIC_API__ link_node_t get_node( * * @return the value of the removed node. */ -__STATIC_API__ void * remove_node( - friso_link_t link, link_node_t node ) -{ +__STATIC_API__ void * remove_node( + friso_link_t link, link_node_t node) { void * _value = node->value; node->prev->next = node->next; node->next->prev = node->prev; link->size--; - FRISO_FREE( node ); + FRISO_FREE(node); return _value; } //add a new node to the link list.(insert just before the tail) -FRISO_API void link_list_add( - friso_link_t link, void * value ) -{ - insert_before( link, link->tail, value ); +FRISO_API void link_list_add( + friso_link_t link, void * value) { + insert_before(link, link->tail, value); } //add a new node before the given index. -FRISO_API void link_list_insert_before( - friso_link_t link, uint_t idx, void * value ) -{ - link_node_t node = get_node( link, idx ); - if ( node != NULL ) { - insert_before( link, node, value ); +FRISO_API void link_list_insert_before( + friso_link_t link, uint_t idx, void * value) { + link_node_t node = get_node(link, idx); + if(node != NULL) { + insert_before(link, node, value); } } /* * get the value with the specified node. - * + * * @return the value of the node. */ -FRISO_API void * link_list_get( - friso_link_t link, uint_t idx ) -{ - link_node_t node = get_node( link, idx ); - if ( node != NULL ) { +FRISO_API void * link_list_get( + friso_link_t link, uint_t idx) { + link_node_t node = get_node(link, idx); + if(node != NULL) { return node->value; } return NULL; @@ -198,17 +187,16 @@ FRISO_API void * link_list_get( * set the value of the node that located in the specified position. * we did't free the allocation of the old value, we return it to you. * free it yourself when it is necessary. - * + * * @return the old value. */ -FRISO_API void *link_list_set( - friso_link_t link, - uint_t idx, void * value ) -{ - link_node_t node = get_node( link, idx ); +FRISO_API void *link_list_set( + friso_link_t link, + uint_t idx, void * value) { + link_node_t node = get_node(link, idx); void * _value = NULL; - if ( node != NULL ) { + if(node != NULL) { _value = node->value; node->value = value; } @@ -222,14 +210,13 @@ FRISO_API void *link_list_set( * @see remove_node * @return the value of the node removed. */ -FRISO_API void *link_list_remove( - friso_link_t link, uint_t idx ) -{ - link_node_t node = get_node( link, idx ); +FRISO_API void *link_list_remove( + friso_link_t link, uint_t idx) { + link_node_t node = get_node(link, idx); - if ( node != NULL ) { + if(node != NULL) { //printf("idx=%d, node->value=%s\n", idx, (string) node->value ); - return remove_node( link, node ); + return remove_node(link, node); } return NULL; @@ -237,48 +224,43 @@ FRISO_API void *link_list_remove( /* * remove the given node from the given link list. - * + * * @see remove_node. * @return the value of the node removed. */ -FRISO_API void *link_list_remove_node( - friso_link_t link, - link_node_t node ) -{ - return remove_node( link, node ); +FRISO_API void *link_list_remove_node( + friso_link_t link, + link_node_t node) { + return remove_node(link, node); } //remove the first node after the head -FRISO_API void *link_list_remove_first( - friso_link_t link ) -{ - if ( link->size > 0 ) { - return remove_node( link, link->head->next ); +FRISO_API void *link_list_remove_first( + friso_link_t link) { + if(link->size > 0) { + return remove_node(link, link->head->next); } return NULL; } //remove the last node just before the tail. -FRISO_API void *link_list_remove_last( - friso_link_t link ) -{ - if ( link->size > 0 ) { - return remove_node( link, link->tail->prev ); +FRISO_API void *link_list_remove_last( + friso_link_t link) { + if(link->size > 0) { + return remove_node(link, link->tail->prev); } return NULL; } //append a node from the tail. -FRISO_API void link_list_add_last( - friso_link_t link, - void *value ) -{ - insert_before( link, link->tail, value ); +FRISO_API void link_list_add_last( + friso_link_t link, + void *value) { + insert_before(link, link->tail, value); } //append a note just after the head. -FRISO_API void link_list_add_first( - friso_link_t link, void *value ) -{ - insert_before( link, link->head->next, value ); +FRISO_API void link_list_add_first( + friso_link_t link, void *value) { + insert_before(link, link->head->next, value); } diff --git a/libfriso/friso/src/friso_string.c b/libfriso/friso/src/friso_string.c index b3e89f8..5805ab1 100644 --- a/libfriso/friso/src/friso_string.c +++ b/libfriso/friso/src/friso_string.c @@ -1,6 +1,6 @@ /* * utf-8 handle functions implementation. - * + * * @author lionsoul */ @@ -21,32 +21,30 @@ * * @date: 2014-10-16 */ -__STATIC_API__ fstring create_buffer( uint_t length ) -{ - fstring buffer = ( fstring ) FRISO_MALLOC( length + 1 ); - if ( buffer == NULL ) { +__STATIC_API__ fstring create_buffer(uint_t length) { + fstring buffer = (fstring) FRISO_MALLOC(length + 1); + if(buffer == NULL) { ___ALLOCATION_ERROR___ } - memset( buffer, 0x00, length + 1 ); + memset(buffer, 0x00, length + 1); return buffer; } //the __allocs should not be smaller than sb->length -__STATIC_API__ string_buffer_t resize_buffer( - string_buffer_t sb, uint_t __allocs ) -{ +__STATIC_API__ string_buffer_t resize_buffer( + string_buffer_t sb, uint_t __allocs) { //create a new buffer. - //if ( __allocs < sb->length ) __allocs = sb->length + 1; - fstring str = create_buffer( __allocs ); + //if ( __allocs < sb->length ) __allocs = sb->length + 1; + fstring str = create_buffer(__allocs); //register uint_t t; //for ( t = 0; t < sb->length; t++ ) { // str[t] = sb->buffer[t]; //} - memcpy( str, sb->buffer, sb->length ); - FRISO_FREE( sb->buffer ); + memcpy(str, sb->buffer, sb->length); + FRISO_FREE(sb->buffer); sb->buffer = str; sb->allocs = __allocs; @@ -55,21 +53,20 @@ __STATIC_API__ string_buffer_t resize_buffer( } //create a new fstring buffer with a default opacity. -//FRISO_API string_buffer_t new_string_buffer( void ) +//FRISO_API string_buffer_t new_string_buffer( void ) //{ // return new_string_buffer_with_opacity( __BUFFER_DEFAULT_LENGTH__ ); //} //create a new fstring buffer with the given opacity. -FRISO_API string_buffer_t new_string_buffer_with_opacity( uint_t opacity ) -{ - string_buffer_t sb = ( string_buffer_t ) - FRISO_MALLOC( sizeof( string_buffer_entry ) ); - if ( sb == NULL ) { +FRISO_API string_buffer_t new_string_buffer_with_opacity(uint_t opacity) { + string_buffer_t sb = (string_buffer_t) + FRISO_MALLOC(sizeof(string_buffer_entry)); + if(sb == NULL) { ___ALLOCATION_ERROR___ - } + } - sb->buffer = create_buffer( opacity ); + sb->buffer = create_buffer(opacity); sb->length = 0; sb->allocs = opacity; @@ -77,18 +74,17 @@ FRISO_API string_buffer_t new_string_buffer_with_opacity( uint_t opacity ) } //create a buffer with the given string. -FRISO_API string_buffer_t new_string_buffer_with_string( fstring str ) -{ +FRISO_API string_buffer_t new_string_buffer_with_string(fstring str) { //buffer allocations. - string_buffer_t sb = ( string_buffer_t ) - FRISO_MALLOC( sizeof( string_buffer_entry ) ); - if ( sb == NULL ) { + string_buffer_t sb = (string_buffer_t) + FRISO_MALLOC(sizeof(string_buffer_entry)); + if(sb == NULL) { ___ALLOCATION_ERROR___ } //initialize - sb->length = strlen( str ); - sb->buffer = create_buffer( sb->length + __BUFFER_DEFAULT_LENGTH__ ); + sb->length = strlen(str); + sb->buffer = create_buffer(sb->length + __BUFFER_DEFAULT_LENGTH__); sb->allocs = sb->length + __BUFFER_DEFAULT_LENGTH__; //register uint_t t; @@ -96,19 +92,18 @@ FRISO_API string_buffer_t new_string_buffer_with_string( fstring str ) //for ( t = 0; t < sb->length; t++ ) { // sb->buffer[t] = str[t]; //} - memcpy( sb->buffer, str, sb->length ); + memcpy(sb->buffer, str, sb->length); return sb; } -FRISO_API void string_buffer_append( - string_buffer_t sb, fstring __str ) -{ - register uint_t __len__ = strlen( __str ); +FRISO_API void string_buffer_append( + string_buffer_t sb, fstring __str) { + register uint_t __len__ = strlen(__str); //check the necessity to resize the buffer. - if ( sb->length + __len__ > sb->allocs ) { - sb = resize_buffer( sb, ( sb->length + __len__ ) * 2 + 1 ); + if(sb->length + __len__ > sb->allocs) { + sb = resize_buffer(sb, (sb->length + __len__) * 2 + 1); } //register uint_t t; @@ -116,26 +111,24 @@ FRISO_API void string_buffer_append( //for ( t = 0; t < __len__; t++ ) { // sb->buffer[ sb->length++ ] = __str[t]; //} - memcpy( sb->buffer + sb->length, __str, __len__ ); + memcpy(sb->buffer + sb->length, __str, __len__); sb->length += __len__; } -FRISO_API void string_buffer_append_char( - string_buffer_t sb, char ch ) -{ +FRISO_API void string_buffer_append_char( + string_buffer_t sb, char ch) { //check the necessity to resize the buffer. - if ( sb->length + 1 > sb->allocs ) { - sb = resize_buffer( sb, sb->length * 2 + 1 ); + if(sb->length + 1 > sb->allocs) { + sb = resize_buffer(sb, sb->length * 2 + 1); } sb->buffer[sb->length++] = ch; } -FRISO_API void string_buffer_insert( - string_buffer_t sb, - uint_t idx, - fstring __str ) -{ +FRISO_API void string_buffer_insert( + string_buffer_t sb, + uint_t idx, + fstring __str) { } /* @@ -144,26 +137,25 @@ FRISO_API void string_buffer_insert( * * @return the new string. */ -FRISO_API fstring string_buffer_remove( - string_buffer_t sb, - uint_t idx, - uint_t length ) -{ +FRISO_API fstring string_buffer_remove( + string_buffer_t sb, + uint_t idx, + uint_t length) { uint_t t; //move the bytes after the idx + length - for ( t = idx + length; t < sb->length; t++ ) { + for(t = idx + length; t < sb->length; t++) { sb->buffer[t - length] = sb->buffer[t]; } sb->buffer[t] = '\0'; - //memcpy( sb->buffer + idx, - // sb->buffer + idx + length, + //memcpy( sb->buffer + idx, + // sb->buffer + idx + length, // sb->length - idx - length ); t = sb->length - idx; - if ( t > 0 ) { - sb->length -= ( t > length ) ? length : t; + if(t > 0) { + sb->length -= (t > length) ? length : t; } - sb->buffer[sb->length-1] = '\0'; + sb->buffer[sb->length - 1] = '\0'; return sb->buffer; } @@ -172,25 +164,23 @@ FRISO_API fstring string_buffer_remove( * turn the string_buffer to a string. * or return the buffer of the string_buffer. */ -FRISO_API string_buffer_t string_buffer_trim( string_buffer_t sb ) -{ +FRISO_API string_buffer_t string_buffer_trim(string_buffer_t sb) { //resize the buffer. - if ( sb->length < sb->allocs - 1 ) { - sb = resize_buffer( sb, sb->length + 1 ); + if(sb->length < sb->allocs - 1) { + sb = resize_buffer(sb, sb->length + 1); } return sb; } /* * free the given fstring buffer. - * and this function will not free the allocations of the + * and this function will not free the allocations of the * string_buffer_t->buffer, we return it to you, if there is * a necessary you could free it youself by calling free(); */ -FRISO_API fstring string_buffer_devote( string_buffer_t sb ) -{ +FRISO_API fstring string_buffer_devote(string_buffer_t sb) { fstring buffer = sb->buffer; - FRISO_FREE( sb ); + FRISO_FREE(sb); return buffer; } @@ -198,17 +188,15 @@ FRISO_API fstring string_buffer_devote( string_buffer_t sb ) * clear the given fstring buffer. * reset its buffer with 0 and reset its length to 0. */ -FRISO_API void string_buffer_clear( string_buffer_t sb ) -{ - memset( sb->buffer, 0x00, sb->length ); +FRISO_API void string_buffer_clear(string_buffer_t sb) { + memset(sb->buffer, 0x00, sb->length); sb->length = 0; } //free everything of the fstring buffer. -FRISO_API void free_string_buffer( string_buffer_t sb ) -{ - FRISO_FREE( sb->buffer ); - FRISO_FREE( sb ); +FRISO_API void free_string_buffer(string_buffer_t sb) { + FRISO_FREE(sb->buffer); + FRISO_FREE(sb); } @@ -216,15 +204,14 @@ FRISO_API void free_string_buffer( string_buffer_t sb ) * create a new string_split_entry. * * @param source - * @return string_split_t; + * @return string_split_t; */ -FRISO_API string_split_t new_string_split( - fstring delimiter, - fstring source ) -{ - string_split_t e = ( string_split_t ) - FRISO_MALLOC( sizeof( string_split_entry ) ); - if ( e == NULL ) { +FRISO_API string_split_t new_string_split( + fstring delimiter, + fstring source) { + string_split_t e = (string_split_t) + FRISO_MALLOC(sizeof(string_split_entry)); + if(e == NULL) { ___ALLOCATION_ERROR___; } @@ -237,70 +224,65 @@ FRISO_API string_split_t new_string_split( return e; } -FRISO_API void string_split_reset( - string_split_t sst, - fstring delimiter, - fstring source ) -{ +FRISO_API void string_split_reset( + string_split_t sst, + fstring delimiter, + fstring source) { sst->delimiter = delimiter; sst->delLen = strlen(delimiter); - sst->source = source; - sst->srcLen = strlen(source); - sst->idx = 0; -} - -FRISO_API void string_split_set_source( - string_split_t sst, fstring source ) -{ sst->source = source; sst->srcLen = strlen(source); sst->idx = 0; } -FRISO_API void string_split_set_delimiter( - string_split_t sst, fstring delimiter ) -{ - sst->delimiter = delimiter; - sst->delLen = strlen( delimiter ); +FRISO_API void string_split_set_source( + string_split_t sst, fstring source) { + sst->source = source; + sst->srcLen = strlen(source); sst->idx = 0; } -FRISO_API void free_string_split( string_split_t sst ) -{ +FRISO_API void string_split_set_delimiter( + string_split_t sst, fstring delimiter) { + sst->delimiter = delimiter; + sst->delLen = strlen(delimiter); + sst->idx = 0; +} + +FRISO_API void free_string_split(string_split_t sst) { FRISO_FREE(sst); } /** - * get the next split fstring, and copy the - * splited fstring into the __dst buffer . + * get the next split fstring, and copy the + * splited fstring into the __dst buffer . * * @param string_split_t * @param __dst - * @return fstring (NULL if reach the end of the source + * @return fstring (NULL if reach the end of the source * or there is no more segmentation) */ -FRISO_API fstring string_split_next( - string_split_t sst, fstring __dst) -{ +FRISO_API fstring string_split_next( + string_split_t sst, fstring __dst) { uint_t i, _ok; fstring _dst = __dst; //check if reach the end of the fstring - if ( sst->idx >= sst->srcLen ) return NULL; + if(sst->idx >= sst->srcLen) return NULL; - while ( 1 ) { + while(1) { _ok = 1; - for ( i = 0; i < sst->delLen - && (sst->idx + i < sst->srcLen); i++ ) { - if ( sst->source[sst->idx+i] != sst->delimiter[i] ) { + for(i = 0; i < sst->delLen + && (sst->idx + i < sst->srcLen); i++) { + if(sst->source[sst->idx + i] != sst->delimiter[i]) { _ok = 0; break; } - } + } //find the delimiter here, - //break the loop and self plus the sst->idx, then return the buffer . - if ( _ok == 1 ) { + //break the loop and self plus the sst->idx, then return the buffer . + if(_ok == 1) { sst->idx += sst->delLen; break; } @@ -308,7 +290,7 @@ FRISO_API fstring string_split_next( //coy the char to the buffer *_dst++ = sst->source[sst->idx++]; //check if reach the end of the fstring - if ( sst->idx >= sst->srcLen ) break; + if(sst->idx >= sst->srcLen) break; } *_dst = '\0'; diff --git a/libfriso/friso/src/tst-array.c b/libfriso/friso/src/tst-array.c index 6aeeb03..f3b2825 100644 --- a/libfriso/friso/src/tst-array.c +++ b/libfriso/friso/src/tst-array.c @@ -8,10 +8,10 @@ #include #include -int main( int argc, char **args ) { - +int main(int argc, char **args) { + //create a new array list. - friso_array_t array = new_array_list(); + friso_array_t array = new_array_list(); fstring keys[] = { "chenmanwen", "yangqinghua", "chenxin", "luojiangyan", "xiaoyanzi", "bibi", @@ -20,31 +20,31 @@ int main( int argc, char **args ) { "chenpei", "liheng", "zhangzhigang", "zhgangyishao", "yangjiangbo", "caizaili", "panpan", "xiaolude", "yintanwen" }; - int j, idx = 2, len = sizeof( keys ) / sizeof( fstring ); + int j, idx = 2, len = sizeof(keys) / sizeof(fstring); - for ( j = 0; j < len; j++ ) { - array_list_add( array, keys[j] ); + for(j = 0; j < len; j++) { + array_list_add(array, keys[j]); } - printf("length=%d, allocations=%d\n", array->length, array->allocs ); - array_list_trim( array ); - printf("after tirm length=%d, allocations=%d\n", array->length, array->allocs ); - printf("idx=%d, value=%s\n", idx, ( fstring ) array_list_get( array, idx ) ); + printf("length=%d, allocations=%d\n", array->length, array->allocs); + array_list_trim(array); + printf("after tirm length=%d, allocations=%d\n", array->length, array->allocs); + printf("idx=%d, value=%s\n", idx, (fstring) array_list_get(array, idx)); - printf("\nAfter set %dth item.\n", idx ); - array_list_set( array, idx, "chenxin__" ); - printf("idx=%d, value=%s\n", idx, ( fstring ) array_list_get( array, idx ) ); + printf("\nAfter set %dth item.\n", idx); + array_list_set(array, idx, "chenxin__"); + printf("idx=%d, value=%s\n", idx, (fstring) array_list_get(array, idx)); - printf("\nAfter remove %dth item.\n", idx ); - array_list_remove( array, idx ); - printf("length=%d, allocations=%d\n", array->length, array->allocs ); - printf("idx=%d, value=%s\n", idx, ( fstring ) array_list_get( array, idx ) ); + printf("\nAfter remove %dth item.\n", idx); + array_list_remove(array, idx); + printf("length=%d, allocations=%d\n", array->length, array->allocs); + printf("idx=%d, value=%s\n", idx, (fstring) array_list_get(array, idx)); - printf("\nInsert a item at %dth\n", idx ); - array_list_insert( array, idx, "*chenxin*" ); - printf("idx=%d, value=%s\n", idx, ( fstring ) array_list_get( array, idx ) ); + printf("\nInsert a item at %dth\n", idx); + array_list_insert(array, idx, "*chenxin*"); + printf("idx=%d, value=%s\n", idx, (fstring) array_list_get(array, idx)); - free_array_list( array ); + free_array_list(array); return 0; } diff --git a/libfriso/friso/src/tst-friso.c b/libfriso/friso/src/tst-friso.c index 0918128..f39a9b6 100644 --- a/libfriso/friso/src/tst-friso.c +++ b/libfriso/friso/src/tst-friso.c @@ -32,19 +32,18 @@ break; println("+---------------------------------------------------------------+"); //read a line from a command line. -static fstring getLine( FILE *fp, fstring __dst ) -{ +static fstring getLine(FILE *fp, fstring __dst) { register int c; register fstring cs; cs = __dst; - while ( ( c = getc( fp ) ) != EOF ) { - if ( c == '\n' ) break; - *cs++ = c; + while((c = getc(fp)) != EOF) { + if(c == '\n') break; + *cs++ = c; } *cs = '\0'; - return ( c == EOF && cs == __dst ) ? NULL : __dst; + return (c == EOF && cs == __dst) ? NULL : __dst; } /*static void printcode( fstring str ) { @@ -57,8 +56,7 @@ static fstring getLine( FILE *fp, fstring __dst ) putchar('\n'); }*/ -int main(int argc, char **argv) -{ +int main(int argc, char **argv) { clock_t s_time, e_time; char line[__INPUT_LENGTH__] = {0}; @@ -70,13 +68,13 @@ int main(int argc, char **argv) friso_task_t task; // get the lexicon directory from command line arguments - for ( i = 0; i < argc; i++ ) { - if ( strcasecmp( "-init", argv[i] ) == 0 ) { - __path__ = argv[i+1]; + for(i = 0; i < argc; i++) { + if(strcasecmp("-init", argv[i]) == 0) { + __path__ = argv[i + 1]; } } - if ( __path__ == NULL ) { + if(__path__ == NULL) { println("Usage: friso -init lexicon path"); exit(0); } @@ -90,12 +88,12 @@ int main(int argc, char **argv) friso_dic_load_from_ifile( dic, __path__, __LENGTH__ ); friso_set_dic( friso, dic ); friso_set_mode( friso, __FRISO_COMPLEX_MODE__ );*/ - if ( friso_init_from_ifile(friso, config, __path__) != 1 ) { + if(friso_init_from_ifile(friso, config, __path__) != 1) { printf("fail to initialize friso and config.\n"); goto err; } - switch ( config->mode ) { + switch(config->mode) { case __FRISO_SIMPLE_MODE__: mode = "Simple"; break; @@ -114,41 +112,41 @@ int main(int argc, char **argv) e_time = clock(); - printf("Initialized in %fsec\n", (double) ( e_time - s_time ) / CLOCKS_PER_SEC ); + printf("Initialized in %fsec\n", (double)(e_time - s_time) / CLOCKS_PER_SEC); printf("Mode: %s\n", mode); - printf("+-Version: %s (%s)\n", friso_version(), friso->charset == FRISO_UTF8 ? "UTF-8" : "GBK" ); + printf("+-Version: %s (%s)\n", friso_version(), friso->charset == FRISO_UTF8 ? "UTF-8" : "GBK"); ___ABOUT___; //set the task. task = friso_new_task(); - while ( 1 ) { + while(1) { print("friso>> "); - getLine( stdin, line ); + getLine(stdin, line); //exit the programe - if (strcasecmp( line, "quit") == 0) { + if(strcasecmp(line, "quit") == 0) { ___EXIT_INFO___ } //for ( i = 0; i < 1000000; i++ ) { //set the task text. - friso_set_text( task, line ); + friso_set_text(task, line); println("分词结果:"); s_time = clock(); - while ( ( config->next_token( friso, config, task ) ) != NULL ) { + while((config->next_token(friso, config, task)) != NULL) { printf( - "%s[%d, %d, %d] ", - task->token->word, - task->token->offset, - task->token->length, + "%s[%d, %d, %d] ", + task->token->word, + task->token->offset, + task->token->length, task->token->rlen ); // printf("%s ", task->token->word); } //} e_time = clock(); - printf("\nDone, cost < %fsec\n", ( (double)(e_time - s_time) ) / CLOCKS_PER_SEC ); + printf("\nDone, cost < %fsec\n", ((double)(e_time - s_time)) / CLOCKS_PER_SEC); } diff --git a/libfriso/friso/src/tst-hash.c b/libfriso/friso/src/tst-hash.c index 8631bd4..853031b 100644 --- a/libfriso/friso/src/tst-hash.c +++ b/libfriso/friso/src/tst-hash.c @@ -1,19 +1,18 @@ /** * hashmap testing program - * + * * @author lionsoul */ #include "friso_API.h" #include -void print_hash_info( friso_hash_t _hash ) { +void print_hash_info(friso_hash_t _hash) { printf("info:length=%d, size=%d, facotr=%f, threshold=%d\n", _hash->length, \ - _hash->size, _hash->factor, _hash->threshold); -} + _hash->size, _hash->factor, _hash->threshold); +} -int main(int argc, char **argv) -{ +int main(int argc, char **argv) { friso_hash_t _hash = new_hash_table(); char *names[] = { "陈满文", "阳清华", @@ -31,13 +30,13 @@ int main(int argc, char **argv) "周安", "郭桥安", "刘敏", "黄广华", "李胜", "黄海清" - }; + }; //char *str[] = {"陈鑫", "张仁芳", "比比"}; char **str = names; int j, len = 30; - print_hash_info( _hash ); - for (j = 0; j < len; j++) { + print_hash_info(_hash); + for(j = 0; j < len; j++) { hash_put_mapping(_hash, names[j], names[j]); } @@ -47,7 +46,7 @@ int main(int argc, char **argv) getchar(); //remove mappings - for (j = 0; j < len; j++) { + for(j = 0; j < len; j++) { printf("Exist %s?%2d\n", str[j], hash_exist_mapping(_hash, str[j])); printf("Now, remove %s\n", str[j]); hash_remove_mapping(_hash, str[j]); diff --git a/libfriso/friso/src/tst-lex.c b/libfriso/friso/src/tst-lex.c index 3eb15a4..b4443a8 100644 --- a/libfriso/friso/src/tst-lex.c +++ b/libfriso/friso/src/tst-lex.c @@ -1,6 +1,6 @@ /* * lex functions test program. - * + * * @author lionsoul */ @@ -16,8 +16,7 @@ printf("3. other search the words in the dictionary.\n"); \ printf("4. quit exit the programe.\n"); -int main(int argc, char **argv) -{ +int main(int argc, char **argv) { lex_entry_t e; int lex = __LEX_CJK_WORDS__; char _line[__LENGTH__]; @@ -59,42 +58,42 @@ int main(int argc, char **argv) //__CN_DNAME2__ friso_dic_load(friso, config, __LEX_CN_DNAME2__, "../vendors/dict/UTF-8/lex-dname-2.lex", __LENGTH__); //__CN_LNA__ - friso_dic_load(friso, config, __LEX_CN_LNA__, "../vendors/dict/UTF-8/lex-ln-adorn.lex", __LENGTH__ ); + friso_dic_load(friso, config, __LEX_CN_LNA__, "../vendors/dict/UTF-8/lex-ln-adorn.lex", __LENGTH__); e_time = clock(); printf( - "Done, cost: %f sec, size=%d\n", - (double) (e_time - s_time) / CLOCKS_PER_SEC, + "Done, cost: %f sec, size=%d\n", + (double)(e_time - s_time) / CLOCKS_PER_SEC, friso_all_dic_size(friso->dic) ); - while (1) { + while(1) { printf("friso-%d>> ", lex); - if (scanf("%s", _line) != 1) { + if(scanf("%s", _line) != 1) { printf("Invalid input\n"); continue; } - if (strcmp( _line, "quit" ) == 0) { + if(strcmp(_line, "quit") == 0) { break; - } else if ( strcmp(_line, "help") == 0 ) { + } else if(strcmp(_line, "help") == 0) { ___PRINT_HELP_INFO___ - } else if ( strcmp( _line, "#set" ) == 0 ) { + } else if(strcmp(_line, "#set") == 0) { printf("lex_t>> "); - if (scanf("%d", &lex) != 1) { + if(scanf("%d", &lex) != 1) { printf("Warning: Invalid lex type input\n"); continue; } } else { s_time = clock(); - e = friso_dic_get( friso->dic, lex, _line ); + e = friso_dic_get(friso->dic, lex, _line); e_time = clock(); - if (e != NULL) { + if(e != NULL) { printf( - "word=%s, syn=%s, fre=%d, cost:%fsec\n", - e->word, e->syn==NULL? "NULL" : (char *)e->syn->items[0], - e->fre, - (double) (e_time - s_time) / CLOCKS_PER_SEC + "word=%s, syn=%s, fre=%d, cost:%fsec\n", + e->word, e->syn == NULL ? "NULL" : (char *)e->syn->items[0], + e->fre, + (double)(e_time - s_time) / CLOCKS_PER_SEC ); } else { printf("%s was not found.\n", _line); diff --git a/libfriso/friso/src/tst-link.c b/libfriso/friso/src/tst-link.c index 09850a0..3b12134 100644 --- a/libfriso/friso/src/tst-link.c +++ b/libfriso/friso/src/tst-link.c @@ -1,6 +1,6 @@ /* * link list test programe. - * + * * @author lionsoul */ @@ -8,7 +8,7 @@ #include #include -int main( int argc, char **args ) { +int main(int argc, char **args) { friso_link_t link; fstring keys[] = { @@ -19,32 +19,32 @@ int main( int argc, char **args ) { "chenpei", "liheng", "zhangzhigang", "zhgangyishao", "yangjiangbo", "caizaili", "panpan", "xiaolude", "yintanwen" }; - int j, len = sizeof( keys ) / sizeof( fstring ); + int j, len = sizeof(keys) / sizeof(fstring); link = new_link_list(); //print the size of the link - printf("size=%d\n", link->size ); + printf("size=%d\n", link->size); - for ( j = 0; j < len; j++ ) { + for(j = 0; j < len; j++) { //link_add( link, keys[j] ); - link_list_add_last( link, keys[j] ); + link_list_add_last(link, keys[j]); } - printf("size=%d\n", link->size ); + printf("size=%d\n", link->size); - for ( j = 0; j < len / 2; j++ ) { + for(j = 0; j < len / 2; j++) { //printf("idx=%d, remove %s\n", j, ( fstring ) link_remove( link, 0 ) ); - printf("idx=%d, remove %s\n", j, ( fstring ) link_list_remove_first( link ) ); + printf("idx=%d, remove %s\n", j, (fstring) link_list_remove_first(link)); } - printf("size=%d\n", link->size ); + printf("size=%d\n", link->size); //clear all the nodes - link_list_clear( link ); - printf("size=%d, head->next->value=%s\n", link->size, ( fstring ) link->head->next->value ); + link_list_clear(link); + printf("size=%d, head->next->value=%s\n", link->size, (fstring) link->head->next->value); - free_link_list( link ); + free_link_list(link); return 0; } diff --git a/libfriso/friso/src/tst-split.c b/libfriso/friso/src/tst-split.c index 388724e..d3e9595 100644 --- a/libfriso/friso/src/tst-split.c +++ b/libfriso/friso/src/tst-split.c @@ -8,17 +8,16 @@ #include #include -int main ( int argc, char **args ) -{ - fstring source = ",I am a chinese,,my name is Lion,and i am the author of friso,bug report email chenxin619315@gmail.com,qq:1187582057"; +int main(int argc, char **args) { + fstring source = ",I am a chinese,,my name is Lion,and i am the author of friso,bug report email chenxin619315@gmail.com,qq:1187582057"; char buffer[128]; - string_split_t split = new_string_split(",", source ); + string_split_t split = new_string_split(",", source); printf("sst->idx=%d\n", split->idx); printf("sst->srcLen=%d\n", split->srcLen); printf("sst->delLen=%d\n", split->delLen); - while ( string_split_next(split, buffer) != NULL) { + while(string_split_next(split, buffer) != NULL) { printf("buffer:%s\n", buffer); } diff --git a/libfriso/friso/src/tst-string.c b/libfriso/friso/src/tst-string.c index b0cf777..70d6308 100644 --- a/libfriso/friso/src/tst-string.c +++ b/libfriso/friso/src/tst-string.c @@ -9,39 +9,39 @@ #include #include -int main( int argc, char **args ) { +int main(int argc, char **args) { fstring str = "康熙字典部首, 符号和标点, 统一表意符号扩展 A ,CJK㈩兼Ⅱ容形式⑩."; char word[4]; - int bytes, t, j, length = strlen( str ); + int bytes, t, j, length = strlen(str); string_buffer_t sb = new_string_buffer(); - printf("str=%s, length=%d\n", str, length ); + printf("str=%s, length=%d\n", str, length); - for (t = 0; t < length; t += bytes) { + for(t = 0; t < length; t += bytes) { bytes = get_utf8_bytes(*(str + t)); - if ( bytes == 0 ) { + if(bytes == 0) { continue; } - for ( j = 0; j < bytes; j++ ) { - word[j] = *(str + t + j ); + for(j = 0; j < bytes; j++) { + word[j] = *(str + t + j); } word[j] = '\0'; - string_buffer_append( sb, word ); - printf("word=%s\n", word ); + string_buffer_append(sb, word); + printf("word=%s\n", word); } - printf("length=%d, buffer=%s\n", sb->length, sb->buffer ); - string_buffer_remove( sb, 0, 3 ); - printf("length=%d, buffer=%s\n", sb->length, sb->buffer ); - string_buffer_remove( sb, 0, 3 ); - printf("length=%d, buffer=%s\n", sb->length, sb->buffer ); - string_buffer_remove( sb, sb->length - 3, 6 ); - sb = string_buffer_trim( sb ); - printf("length=%d, buffer=%s\n", sb->length, string_buffer_devote( sb ) ); + printf("length=%d, buffer=%s\n", sb->length, sb->buffer); + string_buffer_remove(sb, 0, 3); + printf("length=%d, buffer=%s\n", sb->length, sb->buffer); + string_buffer_remove(sb, 0, 3); + printf("length=%d, buffer=%s\n", sb->length, sb->buffer); + string_buffer_remove(sb, sb->length - 3, 6); + sb = string_buffer_trim(sb); + printf("length=%d, buffer=%s\n", sb->length, string_buffer_devote(sb)); //00011110 - yuan ma //11100001 - fa ma diff --git a/libsearch/appsearch/app-match.cpp b/libsearch/appsearch/app-match.cpp index 6db2a13..900b893 100644 --- a/libsearch/appsearch/app-match.cpp +++ b/libsearch/appsearch/app-match.cpp @@ -23,9 +23,8 @@ static AppMatch *app_match_Class = nullptr; -AppMatch *AppMatch::getAppMatch() -{ - if (!app_match_Class) { +AppMatch *AppMatch::getAppMatch() { + if(!app_match_Class) { app_match_Class = new AppMatch; } return app_match_Class; @@ -33,141 +32,130 @@ AppMatch *AppMatch::getAppMatch() AppMatch::AppMatch(QObject *parent) : QThread(parent) // m_versionCommand(new QProcess(this)) { - m_watchAppDir=new QFileSystemWatcher(this); + m_watchAppDir = new QFileSystemWatcher(this); m_watchAppDir->addPath("/usr/share/applications/"); - QDir androidPath(QDir::homePath()+"/.local/share/applications/"); - if(androidPath.exists()){ - m_watchAppDir->addPath(QDir::homePath()+"/.local/share/applications/"); + QDir androidPath(QDir::homePath() + "/.local/share/applications/"); + if(androidPath.exists()) { + m_watchAppDir->addPath(QDir::homePath() + "/.local/share/applications/"); } - qDBusRegisterMetaType>(); - qDBusRegisterMetaType>>(); - m_interFace=new QDBusInterface ("com.kylin.softwarecenter.getsearchresults", "/com/kylin/softwarecenter/getsearchresults", - "com.kylin.getsearchresults", - QDBusConnection::sessionBus()); - if (!m_interFace->isValid()) - { + qDBusRegisterMetaType>(); + qDBusRegisterMetaType>>(); + m_interFace = new QDBusInterface("com.kylin.softwarecenter.getsearchresults", "/com/kylin/softwarecenter/getsearchresults", + "com.kylin.getsearchresults", + QDBusConnection::sessionBus()); + if(!m_interFace->isValid()) { qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message()); - } - qDebug()<<"AppMatch is new"; + } + qDebug() << "AppMatch is new"; } -AppMatch::~AppMatch(){ - if(m_interFace){ +AppMatch::~AppMatch() { + if(m_interFace) { delete m_interFace; } - m_interFace=NULL; - if(m_watchAppDir){ + m_interFace = NULL; + if(m_watchAppDir) { delete m_watchAppDir; } - m_watchAppDir=NULL; + m_watchAppDir = NULL; } -void AppMatch::startMatchApp(QString input,QMap &installed,QMap &softwarereturn){ - m_sourceText=input; +void AppMatch::startMatchApp(QString input, QMap &installed, QMap &softwarereturn) { + m_sourceText = input; getAppName(installed); softWareCenterSearch(softwarereturn); - qDebug()<<"match app is successful!"; + qDebug() << "match app is successful!"; } /** * @brief AppMatch::getAllDesktopFilePath 遍历所有desktop文件 * @param path 存放desktop文件夹 */ -void AppMatch::getAllDesktopFilePath(QString path){ +void AppMatch::getAllDesktopFilePath(QString path) { char* name; char* icon; QStringList applist; - GKeyFileFlags flags=G_KEY_FILE_NONE; - GKeyFile* keyfile=g_key_file_new (); + GKeyFileFlags flags = G_KEY_FILE_NONE; + GKeyFile* keyfile = g_key_file_new(); QDir dir(path); - if (!dir.exists()) { + if(!dir.exists()) { return; } - dir.setFilter(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot); + dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); dir.setSorting(QDir::DirsFirst); QFileInfoList list = dir.entryInfoList(); list.removeAll(QFileInfo("/usr/share/applications/screensavers")); - if(list.size()< 1 ) { + if(list.size() < 1) { return; } - int i=0; + int i = 0; //递归算法的核心部分 - do{ + do { QFileInfo fileInfo = list.at(i); //如果是文件夹,递归 bool isDir = fileInfo.isDir(); if(isDir) { getAllDesktopFilePath(fileInfo.filePath()); - } - else{ + } else { //过滤LXQt、KDE - QString filePathStr=fileInfo.filePath(); - if(filePathStr.contains("KDE",Qt::CaseInsensitive)|| + QString filePathStr = fileInfo.filePath(); + if(filePathStr.contains("KDE", Qt::CaseInsensitive) || // filePathStr.contains("mate",Qt::CaseInsensitive)|| - filePathStr.contains("LX",Qt::CaseInsensitive) ){ + filePathStr.contains("LX", Qt::CaseInsensitive)) { i++; continue; } //过滤后缀不是.desktop的文件 - if(!filePathStr.endsWith(".desktop")) - { + if(!filePathStr.endsWith(".desktop")) { i++; continue; } - QByteArray fpbyte=filePathStr.toLocal8Bit(); - char* filepath=fpbyte.data(); - g_key_file_load_from_file(keyfile,filepath,flags,nullptr); - char* ret_1=g_key_file_get_locale_string(keyfile,"Desktop Entry","NoDisplay", nullptr, nullptr); - if(ret_1!=nullptr) - { - QString str=QString::fromLocal8Bit(ret_1); - if(str.contains("true")) - { + QByteArray fpbyte = filePathStr.toLocal8Bit(); + char* filepath = fpbyte.data(); + g_key_file_load_from_file(keyfile, filepath, flags, nullptr); + char* ret_1 = g_key_file_get_locale_string(keyfile, "Desktop Entry", "NoDisplay", nullptr, nullptr); + if(ret_1 != nullptr) { + QString str = QString::fromLocal8Bit(ret_1); + if(str.contains("true")) { i++; continue; } } - char* ret_2=g_key_file_get_locale_string(keyfile,"Desktop Entry","NotShowIn", nullptr, nullptr); - if(ret_2!=nullptr) - { - QString str=QString::fromLocal8Bit(ret_2); - if(str.contains("UKUI")) - { + char* ret_2 = g_key_file_get_locale_string(keyfile, "Desktop Entry", "NotShowIn", nullptr, nullptr); + if(ret_2 != nullptr) { + QString str = QString::fromLocal8Bit(ret_2); + if(str.contains("UKUI")) { i++; continue; } } //过滤中英文名为空的情况 QLocale cn; - QString language=cn.languageToString(cn.language()); - if(QString::compare(language,"Chinese")==0) - { - char* nameCh=g_key_file_get_string(keyfile,"Desktop Entry","Name[zh_CN]", nullptr); - char* nameEn=g_key_file_get_string(keyfile,"Desktop Entry","Name", nullptr); - if(QString::fromLocal8Bit(nameCh).isEmpty() && QString::fromLocal8Bit(nameEn).isEmpty()) - { + QString language = cn.languageToString(cn.language()); + if(QString::compare(language, "Chinese") == 0) { + char* nameCh = g_key_file_get_string(keyfile, "Desktop Entry", "Name[zh_CN]", nullptr); + char* nameEn = g_key_file_get_string(keyfile, "Desktop Entry", "Name", nullptr); + if(QString::fromLocal8Bit(nameCh).isEmpty() && QString::fromLocal8Bit(nameEn).isEmpty()) { + i++; + continue; + } + } else { + char* name = g_key_file_get_string(keyfile, "Desktop Entry", "Name", nullptr); + if(QString::fromLocal8Bit(name).isEmpty()) { i++; continue; } } - else { - char* name=g_key_file_get_string(keyfile,"Desktop Entry","Name", nullptr); - if(QString::fromLocal8Bit(name).isEmpty()) - { - i++; - continue; - } - } - name=g_key_file_get_locale_string(keyfile,"Desktop Entry","Name", nullptr, nullptr); - icon=g_key_file_get_locale_string(keyfile,"Desktop Entry","Icon", nullptr, nullptr); - if(!m_filePathList.contains(filePathStr)){ + name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Name", nullptr, nullptr); + icon = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Icon", nullptr, nullptr); + if(!m_filePathList.contains(filePathStr)) { NameString appname; appname.app_name = QString::fromLocal8Bit(name); - m_installAppMap.insert(appname,applist< &installed) -{ +void AppMatch::getAppName(QMap &installed) { QMap::const_iterator i; - for(i=m_installAppMap.constBegin();i!=m_installAppMap.constEnd();++i){ - appNameMatch(i.key().app_name,installed); - } - qDebug()<<"installed app match is successful!"; + for(i = m_installAppMap.constBegin(); i != m_installAppMap.constEnd(); ++i) { + appNameMatch(i.key().app_name, installed); + } + qDebug() << "installed app match is successful!"; } /** @@ -254,67 +240,63 @@ void AppMatch::getAppName(QMap &installed) * @param appname * 应用名字 */ -void AppMatch::appNameMatch(QString appname,QMap &installed){ +void AppMatch::appNameMatch(QString appname, QMap &installed) { NameString name{appname}; QStringList list; QStringList pinyinlist; - pinyinlist=FileUtils::findMultiToneWords(appname); - QMapIterator iter(m_installAppMap); - while(iter.hasNext()) - { + pinyinlist = FileUtils::findMultiToneWords(appname); + QMapIterator iter(m_installAppMap); + while(iter.hasNext()) { iter.next(); - if (iter.key().app_name == appname) { + if(iter.key().app_name == appname) { list = iter.value(); break; } } - if(appname.contains(m_sourceText,Qt::CaseInsensitive)){ + if(appname.contains(m_sourceText, Qt::CaseInsensitive)) { // installed.insert(name,m_installAppMap.value(name)); - installed.insert(name,list); + installed.insert(name, list); return; } - for(int i = 0;i &softwarereturn){ - if(m_interFace->timeout()!=-1){ - qWarning()<<"softWareCente Dbus is timeout !"; +void AppMatch::softWareCenterSearch(QMap &softwarereturn) { + if(m_interFace->timeout() != -1) { + qWarning() << "softWareCente Dbus is timeout !"; return; } slotDBusCallFinished(softwarereturn); - qDebug()<<"softWareCenter match app is successful!"; + qDebug() << "softWareCenter match app is successful!"; } -void AppMatch::slotDBusCallFinished(QMap &softwarereturn){ - QDBusReply>> reply = m_interFace->call("get_search_result",m_sourceText); //阻塞,直到远程方法调用完成。 +void AppMatch::slotDBusCallFinished(QMap &softwarereturn) { + QDBusReply>> reply = m_interFace->call("get_search_result", m_sourceText); //阻塞,直到远程方法调用完成。 // QDBusPendingReply>> reply = *call; - if (reply.isValid()) - { - parseSoftWareCenterReturn(reply.value(),softwarereturn); - } - else - { - qWarning() << "value method called failed!"; - } + if(reply.isValid()) { + parseSoftWareCenterReturn(reply.value(), softwarereturn); + } else { + qWarning() << "value method called failed!"; + } // call->deleteLater(); } -void AppMatch::parseSoftWareCenterReturn(QList> list,QMap &softwarereturn){ +void AppMatch::parseSoftWareCenterReturn(QList> list, QMap &softwarereturn) { // qWarning()<> list,QMap< QStringList applist; QLocale locale; QString pkgname; - for(int i=0;istart("apt show "+appname); // m_versionCommand->startDetached(m_versionCommand->program()); @@ -360,21 +342,21 @@ void AppMatch::getInstalledAppsVersion(QString appname){ // m_versionCommand->close(); } -void AppMatch::run(){ - qDebug()<<"AppMatch is run"; +void AppMatch::run() { + qDebug() << "AppMatch is run"; this->getDesktopFilePath(); this->getAllDesktopFilePath("/usr/share/applications/"); - QDir androidPath(QDir::homePath()+"/.local/share/applications/"); + QDir androidPath(QDir::homePath() + "/.local/share/applications/"); if(androidPath.exists()) - this->getAllDesktopFilePath(QDir::homePath()+"/.local/share/applications/"); - connect(m_watchAppDir,&QFileSystemWatcher::directoryChanged,this,[=](const QString &path){ + this->getAllDesktopFilePath(QDir::homePath() + "/.local/share/applications/"); + connect(m_watchAppDir, &QFileSystemWatcher::directoryChanged, this, [ = ](const QString & path) { this->getDesktopFilePath(); - if(path=="/usr/share/applications/"){ - this->getAllDesktopFilePath("/usr/share/applications/"); + if(path == "/usr/share/applications/") { + this->getAllDesktopFilePath("/usr/share/applications/"); } - if(androidPath.exists()){ - if(path==QDir::homePath()+"/.local/share/applications/"){ - this->getAllDesktopFilePath(QDir::homePath()+"/.local/share/applications/"); + if(androidPath.exists()) { + if(path == QDir::homePath() + "/.local/share/applications/") { + this->getAllDesktopFilePath(QDir::homePath() + "/.local/share/applications/"); } } }); diff --git a/libsearch/appsearch/app-match.h b/libsearch/appsearch/app-match.h index a2aa801..5d76f4a 100644 --- a/libsearch/appsearch/app-match.h +++ b/libsearch/appsearch/app-match.h @@ -30,8 +30,7 @@ #include #include -class NameString -{ +class NameString { public: explicit NameString(const QString &str_) : app_name(str_) {} NameString() = default; @@ -52,25 +51,24 @@ public: // } //}; -class AppMatch : public QThread -{ +class AppMatch : public QThread { Q_OBJECT public: static AppMatch *getAppMatch(); - void startMatchApp(QString input,QMap &installed,QMap &softwarereturn); + void startMatchApp(QString input, QMap &installed, QMap &softwarereturn); private: explicit AppMatch(QObject *parent = nullptr); ~AppMatch(); void getAllDesktopFilePath(QString path); void getDesktopFilePath(); - void getAppName(QMap &installed); + void getAppName(QMap &installed); // void appNameMatch(QString appname,QString desktoppath,QString appicon); - void appNameMatch(QString appname,QMap &installed); + void appNameMatch(QString appname, QMap &installed); - void softWareCenterSearch(QMap &softwarereturn); + void softWareCenterSearch(QMap &softwarereturn); - void parseSoftWareCenterReturn(QList> list,QMap &softwarereturn); + void parseSoftWareCenterReturn(QList> list, QMap &softwarereturn); void getInstalledAppsVersion(QString appname); @@ -78,12 +76,12 @@ private: QString m_sourceText; QStringList m_filePathList; - QDBusInterface *m_interFace=nullptr; - QFileSystemWatcher *m_watchAppDir=nullptr; - QMap m_installAppMap; + QDBusInterface *m_interFace = nullptr; + QFileSystemWatcher *m_watchAppDir = nullptr; + QMap m_installAppMap; private Q_SLOTS: - void slotDBusCallFinished(QMap &softwarereturn); + void slotDBusCallFinished(QMap &softwarereturn); //Q_SIGNALS: diff --git a/libsearch/file-utils.cpp b/libsearch/file-utils.cpp index 91944e1..393de6b 100644 --- a/libsearch/file-utils.cpp +++ b/libsearch/file-utils.cpp @@ -28,13 +28,11 @@ unsigned short FileUtils::_index_status = 0; FileUtils::SearchMethod FileUtils::searchMethod = FileUtils::SearchMethod::DIRECTSEARCH; QMap FileUtils::map_chinese2pinyin = QMap(); -FileUtils::FileUtils() -{ +FileUtils::FileUtils() { } -std::string FileUtils::makeDocUterm(QString path) -{ - return QCryptographicHash::hash(path.toUtf8(),QCryptographicHash::Md5).toHex().toStdString(); +std::string FileUtils::makeDocUterm(QString path) { + return QCryptographicHash::hash(path.toUtf8(), QCryptographicHash::Md5).toHex().toStdString(); } /** @@ -43,30 +41,29 @@ std::string FileUtils::makeDocUterm(QString path) * @param checkValid * @return */ -QIcon FileUtils::getFileIcon(const QString &uri, bool checkValid) -{ +QIcon FileUtils::getFileIcon(const QString &uri, bool checkValid) { auto file = wrapGFile(g_file_new_for_uri(uri.toUtf8().constData())); auto info = wrapGFileInfo(g_file_query_info(file.get()->get(), - G_FILE_ATTRIBUTE_STANDARD_ICON, - G_FILE_QUERY_INFO_NONE, - nullptr, - nullptr)); - if (!G_IS_FILE_INFO (info.get()->get())) + G_FILE_ATTRIBUTE_STANDARD_ICON, + G_FILE_QUERY_INFO_NONE, + nullptr, + nullptr)); + if(!G_IS_FILE_INFO(info.get()->get())) return QIcon::fromTheme("unknown"); - GIcon *g_icon = g_file_info_get_icon (info.get()->get()); + GIcon *g_icon = g_file_info_get_icon(info.get()->get()); QString icon_name; //do not unref the GIcon from info. - if (G_IS_ICON(g_icon)) { - const gchar* const* icon_names = g_themed_icon_get_names(G_THEMED_ICON (g_icon)); - if (icon_names) { + if(G_IS_ICON(g_icon)) { + const gchar* const* icon_names = g_themed_icon_get_names(G_THEMED_ICON(g_icon)); + if(icon_names) { auto p = icon_names; - if (*p) - icon_name = QString (*p); - if (checkValid) { - while (*p) { + if(*p) + icon_name = QString(*p); + if(checkValid) { + while(*p) { QIcon icon = QIcon::fromTheme(*p); - if (!icon.isNull()) { - icon_name = QString (*p); + if(!icon.isNull()) { + icon_name = QString(*p); break; } else { p++; @@ -75,7 +72,7 @@ QIcon FileUtils::getFileIcon(const QString &uri, bool checkValid) } } } - if (QIcon::fromTheme(icon_name).isNull()) { + if(QIcon::fromTheme(icon_name).isNull()) { return QIcon::fromTheme("unknown"); } return QIcon::fromTheme(icon_name); @@ -91,13 +88,13 @@ QIcon FileUtils::getAppIcon(const QString &path) { ba = path.toUtf8(); GKeyFile * keyfile; keyfile = g_key_file_new(); - if (!g_key_file_load_from_file(keyfile, ba.data(), G_KEY_FILE_NONE, NULL)){ - g_key_file_free (keyfile); + if(!g_key_file_load_from_file(keyfile, ba.data(), G_KEY_FILE_NONE, NULL)) { + g_key_file_free(keyfile); return QIcon::fromTheme("unknown"); } QString icon = QString(g_key_file_get_locale_string(keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL, NULL)); g_key_file_free(keyfile); - if (QIcon::fromTheme(icon).isNull()) { + if(QIcon::fromTheme(icon).isNull()) { return QIcon(":/res/icons/desktop.png"); } return QIcon::fromTheme(icon); @@ -111,17 +108,17 @@ QIcon FileUtils::getAppIcon(const QString &path) { */ QIcon FileUtils::getSettingIcon(const QString& setting, const bool& is_white) { QString name = setting.left(setting.indexOf("/")); - if (! name.isEmpty()) { + if(! name.isEmpty()) { name.replace(QString(name.at(0)), QString(name.at(0).toUpper())); } QString path; - if (is_white) { + if(is_white) { path = QString("/usr/share/ukui-control-center/shell/res/secondaryleftmenu/%1White.svg").arg(name); } else { path = QString("/usr/share/ukui-control-center/shell/res/secondaryleftmenu/%1.svg").arg(name); } QFile file(path); - if (file.exists()) { + if(file.exists()) { return QIcon(path); } else { return QIcon::fromTheme("ukui-control-center"); //无插件图标时,返回控制面板应用图标 @@ -140,7 +137,7 @@ QIcon FileUtils::getSettingIcon(const QString& setting, const bool& is_white) { */ QString FileUtils::getFileName(const QString& uri) { QFileInfo info(uri); - if (info.exists()) { + if(info.exists()) { return info.fileName(); } else { return "Unknown File"; @@ -162,8 +159,8 @@ QString FileUtils::getAppName(const QString& path) { ba = path.toUtf8(); GKeyFile * keyfile; keyfile = g_key_file_new(); - if (!g_key_file_load_from_file(keyfile, ba.data(), G_KEY_FILE_NONE, NULL)){ - g_key_file_free (keyfile); + if(!g_key_file_load_from_file(keyfile, ba.data(), G_KEY_FILE_NONE, NULL)) { + g_key_file_free(keyfile); return "Unknown App"; } QString name = QString(g_key_file_get_locale_string(keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL)); @@ -181,10 +178,9 @@ QString FileUtils::getSettingName(const QString& setting) { } -void FileUtils::loadHanziTable(const QString &fileName) -{ +void FileUtils::loadHanziTable(const QString &fileName) { QFile file(fileName); - if (!file.open(QFile::ReadOnly | QFile::Text)) { + if(!file.open(QFile::ReadOnly | QFile::Text)) { qDebug("File: '%s' open failed!", file.fileName().toStdString().c_str()); return; } @@ -200,25 +196,23 @@ void FileUtils::loadHanziTable(const QString &fileName) return; } -QMimeType FileUtils::getMimetype(QString &path) -{ +QMimeType FileUtils::getMimetype(QString &path) { QMimeDatabase mdb; - QMimeType type = mdb.mimeTypeForFile(path,QMimeDatabase::MatchContent); + QMimeType type = mdb.mimeTypeForFile(path, QMimeDatabase::MatchContent); return type; } //aborted -QString FileUtils::find(const QString &hanzi) -{ +QString FileUtils::find(const QString &hanzi) { // static QMap map = loadHanziTable("://index/pinyinWithoutTone.txt"); // static QMap map; QString output; QStringList stringList = hanzi.split(""); /* 遍历查找汉字-拼音对照表的内容并将汉字替换为拼音 */ - for (const QString &str : stringList) { - if (FileUtils::map_chinese2pinyin.contains(str)) + for(const QString &str : stringList) { + if(FileUtils::map_chinese2pinyin.contains(str)) output += FileUtils::map_chinese2pinyin[str].first(); else output += str; @@ -228,93 +222,88 @@ QString FileUtils::find(const QString &hanzi) } //DFS多音字太多直接GG -void stitchMultiToneWordsDFS(const QString& hanzi, const QString& resultAllPinYin, const QString& resultFirst, QStringList& resultList){ - if (hanzi.size() == 0){ +void stitchMultiToneWordsDFS(const QString& hanzi, const QString& resultAllPinYin, const QString& resultFirst, QStringList& resultList) { + if(hanzi.size() == 0) { resultList.append(resultAllPinYin); resultList.append(resultFirst); return; } - if (FileUtils::map_chinese2pinyin.contains(hanzi.at(0))){ - for (auto i : FileUtils::map_chinese2pinyin[hanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(hanzi.at(0))) { + for(auto i : FileUtils::map_chinese2pinyin[hanzi.at(0)]) { stitchMultiToneWordsDFS(hanzi.right(hanzi.size() - 1), resultAllPinYin + i, resultFirst + i.at(0), resultList); } - } - else{ + } else { stitchMultiToneWordsDFS(hanzi.right(hanzi.size() - 1), resultAllPinYin + hanzi.at(0), resultFirst + hanzi.at(0), resultList); } } //BFS+Stack多音字太多会爆栈 -void stitchMultiToneWordsBFSStack(const QString& hanzi, QStringList& resultList){ +void stitchMultiToneWordsBFSStack(const QString& hanzi, QStringList& resultList) { QString tempHanzi, resultAllPinYin, resultFirst; QQueue tempQueue; tempHanzi = hanzi; int tempQueueSize = 0; - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue.enqueue(i); } - } - else{ + } else { tempQueue.enqueue(tempHanzi.at(0)); } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); - while (tempHanzi.size() != 0) { + while(tempHanzi.size() != 0) { tempQueueSize = tempQueue.size(); - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (int j = 0; j < tempQueueSize; ++j){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(int j = 0; j < tempQueueSize; ++j) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue.enqueue(tempQueue.head() + i); } tempQueue.dequeue(); } - } - else{ - for (int j = 0; j < tempQueueSize; ++j){ + } else { + for(int j = 0; j < tempQueueSize; ++j) { tempQueue.enqueue(tempQueue.head() + tempHanzi.at(0)); tempQueue.dequeue(); } } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); } - while(!tempQueue.empty()){ + while(!tempQueue.empty()) { resultList.append(tempQueue.dequeue()); } } //BFS+Heap,多音字太多会耗尽内存 -void stitchMultiToneWordsBFSHeap(const QString& hanzi, QStringList& resultList){ +void stitchMultiToneWordsBFSHeap(const QString& hanzi, QStringList& resultList) { QString tempHanzi, resultAllPinYin, resultFirst; QQueue* tempQueue = new QQueue; tempHanzi = hanzi; int tempQueueSize = 0; - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue->enqueue(i); } - } - else{ + } else { tempQueue->enqueue(tempHanzi.at(0)); } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); - while (tempHanzi.size() != 0) { + while(tempHanzi.size() != 0) { tempQueueSize = tempQueue->size(); - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (int j = 0; j < tempQueueSize; ++j){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(int j = 0; j < tempQueueSize; ++j) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue->enqueue(tempQueue->head() + i); } tempQueue->dequeue(); } - } - else{ - for (int j = 0; j < tempQueueSize; ++j){ + } else { + for(int j = 0; j < tempQueueSize; ++j) { tempQueue->enqueue(tempQueue->head() + tempHanzi.at(0)); tempQueue->dequeue(); } } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); } - while(!tempQueue->empty()){ + while(!tempQueue->empty()) { resultList.append(tempQueue->dequeue()); } delete tempQueue; @@ -322,28 +311,27 @@ void stitchMultiToneWordsBFSHeap(const QString& hanzi, QStringList& resultList){ } //BFS+Heap+超过3个多音字只建一个索引,比较折中的方案 -void stitchMultiToneWordsBFSHeapLess3(const QString& hanzi, QStringList& resultList){ +void stitchMultiToneWordsBFSHeapLess3(const QString& hanzi, QStringList& resultList) { QString tempHanzi, resultAllPinYin, resultFirst; QQueue* tempQueue = new QQueue; QQueue* tempQueueFirst = new QQueue; tempHanzi = hanzi; int tempQueueSize = 0; int multiToneWordNum = 0; - for (auto i : hanzi){ - if (FileUtils::map_chinese2pinyin.contains(i)){ - if (FileUtils::map_chinese2pinyin[i].size() > 1){ + for(auto i : hanzi) { + if(FileUtils::map_chinese2pinyin.contains(i)) { + if(FileUtils::map_chinese2pinyin[i].size() > 1) { ++multiToneWordNum; } } } - if (multiToneWordNum > 3){ + if(multiToneWordNum > 3) { QString oneResult, oneResultFirst; - for (auto i : hanzi){ - if (FileUtils::map_chinese2pinyin.contains(i)){ + for(auto i : hanzi) { + if(FileUtils::map_chinese2pinyin.contains(i)) { oneResult += FileUtils::map_chinese2pinyin[i].first(); oneResultFirst += FileUtils::map_chinese2pinyin[i].first().at(0); - } - else{ + } else { oneResult += i; oneResultFirst += i; } @@ -353,31 +341,29 @@ void stitchMultiToneWordsBFSHeapLess3(const QString& hanzi, QStringList& resultL return; } - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue->enqueue(i); tempQueueFirst->enqueue(i.at(0)); } - } - else{ + } else { tempQueue->enqueue(tempHanzi.at(0)); tempQueueFirst->enqueue(tempHanzi.at(0)); } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); - while (tempHanzi.size() != 0) { + while(tempHanzi.size() != 0) { tempQueueSize = tempQueue->size(); - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (int j = 0; j < tempQueueSize; ++j){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(int j = 0; j < tempQueueSize; ++j) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue->enqueue(tempQueue->head() + i); tempQueueFirst->enqueue(tempQueueFirst->head() + i.at(0)); } tempQueue->dequeue(); tempQueueFirst->dequeue(); } - } - else{ - for (int j = 0; j < tempQueueSize; ++j){ + } else { + for(int j = 0; j < tempQueueSize; ++j) { tempQueue->enqueue(tempQueue->head() + tempHanzi.at(0)); tempQueueFirst->enqueue(tempQueueFirst->head() + tempHanzi.at(0)); tempQueue->dequeue(); @@ -386,7 +372,7 @@ void stitchMultiToneWordsBFSHeapLess3(const QString& hanzi, QStringList& resultL } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); } - while(!tempQueue->empty()){ + while(!tempQueue->empty()) { resultList.append(tempQueue->dequeue()); resultList.append(tempQueueFirst->dequeue()); } @@ -398,28 +384,27 @@ void stitchMultiToneWordsBFSHeapLess3(const QString& hanzi, QStringList& resultL } //BFS+Stack+超过3个多音字只建一个索引,比较折中的方案 -void stitchMultiToneWordsBFSStackLess3(const QString& hanzi, QStringList& resultList){ +void stitchMultiToneWordsBFSStackLess3(const QString& hanzi, QStringList& resultList) { QString tempHanzi, resultAllPinYin, resultFirst; QQueue tempQueue; QQueue tempQueueFirst; tempHanzi = hanzi; int tempQueueSize = 0; int multiToneWordNum = 0; - for (auto i : hanzi){ - if (FileUtils::map_chinese2pinyin.contains(i)){ - if (FileUtils::map_chinese2pinyin[i].size() > 1){ + for(auto i : hanzi) { + if(FileUtils::map_chinese2pinyin.contains(i)) { + if(FileUtils::map_chinese2pinyin[i].size() > 1) { ++multiToneWordNum; } } } - if (multiToneWordNum > 3){ + if(multiToneWordNum > 3) { QString oneResult, oneResultFirst; - for (auto i : hanzi){ - if (FileUtils::map_chinese2pinyin.contains(i)){ + for(auto i : hanzi) { + if(FileUtils::map_chinese2pinyin.contains(i)) { oneResult += FileUtils::map_chinese2pinyin[i].first(); oneResultFirst += FileUtils::map_chinese2pinyin[i].first().at(0); - } - else{ + } else { oneResult += i; oneResultFirst += i; } @@ -429,31 +414,29 @@ void stitchMultiToneWordsBFSStackLess3(const QString& hanzi, QStringList& result return; } - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue.enqueue(i); tempQueueFirst.enqueue(i.at(0)); } - } - else{ + } else { tempQueue.enqueue(tempHanzi.at(0)); tempQueueFirst.enqueue(tempHanzi.at(0)); } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); - while (tempHanzi.size() != 0) { + while(tempHanzi.size() != 0) { tempQueueSize = tempQueue.size(); - if (FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))){ - for (int j = 0; j < tempQueueSize; ++j){ - for (auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]){ + if(FileUtils::map_chinese2pinyin.contains(tempHanzi.at(0))) { + for(int j = 0; j < tempQueueSize; ++j) { + for(auto i : FileUtils::map_chinese2pinyin[tempHanzi.at(0)]) { tempQueue.enqueue(tempQueue.head() + i); tempQueueFirst.enqueue(tempQueueFirst.head() + i.at(0)); } tempQueue.dequeue(); tempQueueFirst.dequeue(); } - } - else{ - for (int j = 0; j < tempQueueSize; ++j){ + } else { + for(int j = 0; j < tempQueueSize; ++j) { tempQueue.enqueue(tempQueue.head() + tempHanzi.at(0)); tempQueueFirst.enqueue(tempQueueFirst.head() + tempHanzi.at(0)); tempQueue.dequeue(); @@ -462,7 +445,7 @@ void stitchMultiToneWordsBFSStackLess3(const QString& hanzi, QStringList& result } tempHanzi = tempHanzi.right(tempHanzi.size() - 1); } - while(!tempQueue.empty()){ + while(!tempQueue.empty()) { resultList.append(tempQueue.dequeue()); resultList.append(tempQueueFirst.dequeue()); } @@ -473,8 +456,7 @@ void stitchMultiToneWordsBFSStackLess3(const QString& hanzi, QStringList& result return; } -QStringList FileUtils::findMultiToneWords(const QString& hanzi) -{ +QStringList FileUtils::findMultiToneWords(const QString& hanzi) { // QStringList* output = new QStringList(); QStringList output; QString tempAllPinYin, tempFirst; @@ -491,17 +473,16 @@ QStringList FileUtils::findMultiToneWords(const QString& hanzi) * @param path: abs path * @return docx to QString */ -void FileUtils::getDocxTextContent(QString &path,QString &textcontent) -{ +void FileUtils::getDocxTextContent(QString &path, QString &textcontent) { //fix me :optimized by xpath?? QFileInfo info = QFileInfo(path); - if(!info.exists()||info.isDir()) + if(!info.exists() || info.isDir()) return; QuaZip file(path); if(!file.open(QuaZip::mdUnzip)) return; - if(!file.setCurrentFile("word/document.xml",QuaZip::csSensitive)) + if(!file.setCurrentFile("word/document.xml", QuaZip::csSensitive)) return; QuaZipFile fileR(&file); @@ -512,18 +493,14 @@ void FileUtils::getDocxTextContent(QString &path,QString &textcontent) fileR.close(); QDomElement first = doc.firstChildElement("w:document"); QDomElement body = first.firstChildElement("w:body"); - while(!body.isNull()) - { - QDomElement wp= body.firstChildElement("w:p"); - while(!wp.isNull()) - { - QDomElement wr= wp.firstChildElement("w:r"); - while(!wr.isNull()) - { + while(!body.isNull()) { + QDomElement wp = body.firstChildElement("w:p"); + while(!wp.isNull()) { + QDomElement wr = wp.firstChildElement("w:r"); + while(!wr.isNull()) { QDomElement wt = wr.firstChildElement("w:t"); - textcontent.append(wt.text().replace("\n","")); - if(textcontent.length() >= MAX_CONTENT_LENGTH/3) - { + textcontent.append(wt.text().replace("\n", "")); + if(textcontent.length() >= MAX_CONTENT_LENGTH / 3) { file.close(); return; } @@ -537,20 +514,18 @@ void FileUtils::getDocxTextContent(QString &path,QString &textcontent) return; } -void FileUtils::getPptxTextContent(QString &path, QString &textcontent) -{ +void FileUtils::getPptxTextContent(QString &path, QString &textcontent) { QFileInfo info = QFileInfo(path); - if(!info.exists()||info.isDir()) + if(!info.exists() || info.isDir()) return; QuaZip file(path); if(!file.open(QuaZip::mdUnzip)) return; QString prefix("ppt/slides/slide"); QStringList fileList; - for(QString i : file.getFileNameList()) - { + for(QString i : file.getFileNameList()) { if(i.startsWith(prefix)) - fileList<= MAX_CONTENT_LENGTH/3) - { + textcontent.append(at.text().replace("\r", "")).replace("\t", ""); + if(textcontent.length() >= MAX_CONTENT_LENGTH / 3) { file.close(); return; } @@ -631,16 +598,15 @@ void FileUtils::getPptxTextContent(QString &path, QString &textcontent) return; } -void FileUtils::getXlsxTextContent(QString &path, QString &textcontent) -{ +void FileUtils::getXlsxTextContent(QString &path, QString &textcontent) { QFileInfo info = QFileInfo(path); - if(!info.exists()||info.isDir()) + if(!info.exists() || info.isDir()) return; QuaZip file(path); if(!file.open(QuaZip::mdUnzip)) return; - if(!file.setCurrentFile("xl/sharedStrings.xml",QuaZip::csSensitive)) + if(!file.setCurrentFile("xl/sharedStrings.xml", QuaZip::csSensitive)) return; QuaZipFile fileR(&file); @@ -653,25 +619,19 @@ void FileUtils::getXlsxTextContent(QString &path, QString &textcontent) QDomElement si; QDomElement r; QDomElement t; - while(!sst.isNull()) - { - si= sst.firstChildElement("si"); - while(!si.isNull()) - { - r= si.firstChildElement("r"); - if(r.isNull()) - { - t= si.firstChildElement("t"); - } - else - { + while(!sst.isNull()) { + si = sst.firstChildElement("si"); + while(!si.isNull()) { + r = si.firstChildElement("r"); + if(r.isNull()) { + t = si.firstChildElement("t"); + } else { t = r.firstChildElement("t"); } if(t.isNull()) continue; - textcontent.append(t.text().replace("\r","").replace("\n","")); - if(textcontent.length() >= MAX_CONTENT_LENGTH/3) - { + textcontent.append(t.text().replace("\r", "").replace("\n", "")); + if(textcontent.length() >= MAX_CONTENT_LENGTH / 3) { file.close(); return; } @@ -683,46 +643,43 @@ void FileUtils::getXlsxTextContent(QString &path, QString &textcontent) return; } -void FileUtils::getPdfTextContent(QString &path, QString &textcontent) -{ +void FileUtils::getPdfTextContent(QString &path, QString &textcontent) { Poppler::Document *doc = Poppler::Document::load(path); if(doc->isLocked()) return; const QRectF qf; int pageNum = doc->numPages(); - for(int i = 0; ipage(i)->text(qf).replace("\n","")); - if(textcontent.length() >= MAX_CONTENT_LENGTH/3) + for(int i = 0; i < pageNum; ++i) { + textcontent.append(doc->page(i)->text(qf).replace("\n", "")); + if(textcontent.length() >= MAX_CONTENT_LENGTH / 3) break; } delete doc; return; } -void FileUtils::getTxtContent(QString &path, QString &textcontent) -{ +void FileUtils::getTxtContent(QString &path, QString &textcontent) { QFile file(path); - if(!file.open(QIODevice::ReadOnly|QIODevice::Text)) + if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; QByteArray encodedString = file.read(MAX_CONTENT_LENGTH); uchardet_t chardet = uchardet_new(); - if(uchardet_handle_data(chardet,encodedString.constData(),encodedString.size()) !=0) - qWarning()<<"Txt file encoding format detect fail!"<setAtomicSyncRequired(false); - m_block_dirs_settings = new QSettings(BLOCK_DIRS,QSettings::IniFormat, this); + m_block_dirs_settings = new QSettings(BLOCK_DIRS, QSettings::IniFormat, this); m_block_dirs_settings->setIniCodec(QTextCodec::codecForName("UTF-8")); - m_search_record_settings = new QSettings(SEARCH_HISTORY, QSettings::IniFormat , this); + m_search_record_settings = new QSettings(SEARCH_HISTORY, QSettings::IniFormat, this); m_search_record_settings->setIniCodec(QTextCodec::codecForName("UTF-8")); - for(QString i:m_search_record_settings->allKeys()) - { + for(QString i : m_search_record_settings->allKeys()) { m_history.append(QUrl::fromPercentEncoding(i.toLocal8Bit())); } if(!QDBusConnection::sessionBus().connect("org.kylinssoclient.dbus", - "/org/kylinssoclient/path", - "org.freedesktop.kylinssoclient.interface", - "keyChanged", - this, SLOT(updateSearchHistory(QString)))) + "/org/kylinssoclient/path", + "org.freedesktop.kylinssoclient.interface", + "keyChanged", + this, SLOT(updateSearchHistory(QString)))) - qWarning()<<"Kylinssoclient Dbus connect fail!"; + qWarning() << "Kylinssoclient Dbus connect fail!"; this->forceSync(); //the default number of transparency in mainwindow is 0.7 //if someone changes the num in mainwindow, here should be modified too m_cache.insert(TRANSPARENCY_KEY, 0.7); - if (QGSettings::isSchemaInstalled(CONTROL_CENTER_PERSONALISE_GSETTINGS_ID)) { + if(QGSettings::isSchemaInstalled(CONTROL_CENTER_PERSONALISE_GSETTINGS_ID)) { m_trans_gsettings = new QGSettings(CONTROL_CENTER_PERSONALISE_GSETTINGS_ID, QByteArray(), this); - connect(m_trans_gsettings, &QGSettings::changed, this, [=](const QString& key) { - if (key == TRANSPARENCY_KEY) { + connect(m_trans_gsettings, &QGSettings::changed, this, [ = ](const QString & key) { + if(key == TRANSPARENCY_KEY) { m_cache.remove(TRANSPARENCY_KEY); m_cache.insert(TRANSPARENCY_KEY, m_trans_gsettings->get(TRANSPARENCY_KEY).toDouble()); qApp->paletteChanged(qApp->palette()); @@ -73,15 +70,15 @@ GlobalSettings::GlobalSettings(QObject *parent) : QObject(parent) m_cache.insert(STYLE_NAME_KEY, "ukui-light"); m_cache.insert(FONT_SIZE_KEY, 11); - if (QGSettings::isSchemaInstalled(THEME_GSETTINGS_ID)) { + if(QGSettings::isSchemaInstalled(THEME_GSETTINGS_ID)) { m_theme_gsettings = new QGSettings(THEME_GSETTINGS_ID, QByteArray(), this); - connect(m_theme_gsettings, &QGSettings::changed, this, [=](const QString& key) { - if (key == STYLE_NAME_KEY) { + connect(m_theme_gsettings, &QGSettings::changed, this, [ = ](const QString & key) { + if(key == STYLE_NAME_KEY) { //当前主题改变时也发出paletteChanged信号,通知主界面刷新 qApp->paletteChanged(qApp->palette()); m_cache.remove(STYLE_NAME_KEY); m_cache.insert(STYLE_NAME_KEY, m_theme_gsettings->get(STYLE_NAME_KEY).toString()); - } else if (key == FONT_SIZE_KEY) { + } else if(key == FONT_SIZE_KEY) { qApp->paletteChanged(qApp->palette()); m_cache.remove(FONT_SIZE_KEY); m_cache.insert(FONT_SIZE_KEY, m_theme_gsettings->get(FONT_SIZE_KEY).toDouble()); @@ -94,38 +91,34 @@ GlobalSettings::GlobalSettings(QObject *parent) : QObject(parent) } } -const QVariant GlobalSettings::getValue(const QString &key) -{ +const QVariant GlobalSettings::getValue(const QString &key) { return m_cache.value(key); } -bool GlobalSettings::isExist(const QString &key) -{ +bool GlobalSettings::isExist(const QString &key) { return !m_cache.value(key).isNull(); } -void GlobalSettings::reset(const QString &key) -{ +void GlobalSettings::reset(const QString &key) { m_cache.remove(key); - QtConcurrent::run([=]() { + QtConcurrent::run([ = ]() { // if (m_mutex.tryLock(1000)) { - m_settings->remove(key); - m_settings->sync(); + m_settings->remove(key); + m_settings->sync(); // m_mutex.unlock(); // } }); Q_EMIT this->valueChanged(key); } -void GlobalSettings::resetAll() -{ +void GlobalSettings::resetAll() { QStringList tmp = m_cache.keys(); m_cache.clear(); - for (auto key : tmp) { + for(auto key : tmp) { Q_EMIT this->valueChanged(key); } - QtConcurrent::run([=]() { - if (m_mutex.tryLock(1000)) { + QtConcurrent::run([ = ]() { + if(m_mutex.tryLock(1000)) { m_settings->clear(); m_settings->sync(); m_mutex.unlock(); @@ -133,12 +126,9 @@ void GlobalSettings::resetAll() }); } -bool GlobalSettings::setBlockDirs(const QString &path, int &returnCode, bool remove) -{ - if(remove) - { - if(path.isEmpty()) - { +bool GlobalSettings::setBlockDirs(const QString &path, int &returnCode, bool remove) { + if(remove) { + if(path.isEmpty()) { returnCode = PATH_EMPTY; return false; } @@ -146,21 +136,18 @@ bool GlobalSettings::setBlockDirs(const QString &path, int &returnCode, bool rem m_block_dirs_settings->remove(path); return true; } - if(!path.startsWith("/home")) - { + if(!path.startsWith("/home")) { // returnCode = QString(tr("I can only search your user directory, it doesn't make any sense if you block an directory which is not in user directory!")); returnCode = PATH_NOT_IN_HOME; return false; } //why QSetting's key can't start with "/"?? - QString pathKey = path.right(path.length()-1); + QString pathKey = path.right(path.length() - 1); QStringList blockDirs = m_block_dirs_settings->allKeys(); - for(QString i:blockDirs) - { - if(pathKey.startsWith(i)) - { + for(QString i : blockDirs) { + if(pathKey.startsWith(i)) { // returnCode = QString(tr("My parent folder has been blocked!")); returnCode = PATH_PARENT_BLOCKED; return false; @@ -169,12 +156,11 @@ bool GlobalSettings::setBlockDirs(const QString &path, int &returnCode, bool rem if(i.startsWith(pathKey)) m_block_dirs_settings->remove(i); } - m_block_dirs_settings->setValue(pathKey,"0"); + m_block_dirs_settings->setValue(pathKey, "0"); return true; } -QStringList GlobalSettings::getBlockDirs() -{ +QStringList GlobalSettings::getBlockDirs() { return m_block_dirs_settings->allKeys(); } @@ -198,19 +184,17 @@ QStringList GlobalSettings::getBlockDirs() // } //} -void GlobalSettings::setSearchRecord(const QString &word, const QDateTime &time) -{ +void GlobalSettings::setSearchRecord(const QString &word, const QDateTime &time) { QStringList keys = m_search_record_settings->allKeys(); if(keys.contains(QString(QUrl::toPercentEncoding(word)))) m_history.removeOne(word); - m_search_record_settings->setValue(QString(QUrl::toPercentEncoding(word)), time.toString("yyyy-MM-dd hh:mm:ss")); + m_search_record_settings->setValue(QString(QUrl::toPercentEncoding(word)), time.toString("yyyy-MM-dd hh:mm:ss")); if(keys.size() >= 20) - m_search_record_settings->remove(QString(QUrl::toPercentEncoding(m_history.takeFirst()))); + m_search_record_settings->remove(QString(QUrl::toPercentEncoding(m_history.takeFirst()))); m_history.append(word); } -QStringList GlobalSettings::getSearchRecord() -{ +QStringList GlobalSettings::getSearchRecord() { return m_history; } @@ -263,12 +247,11 @@ QStringList GlobalSettings::getSearchRecord() //here should be override //MouseZhangZh -void GlobalSettings::setValue(const QString &key, const QVariant &value) -{ +void GlobalSettings::setValue(const QString &key, const QVariant &value) { // qDebug()<<"setvalue========"<sync(); - QtConcurrent::run([=]() { + QtConcurrent::run([ = ]() { // qDebug()<status(); // if (m_mutex.tryLock(1000)) { // m_mutex.lock(); @@ -281,12 +264,11 @@ void GlobalSettings::setValue(const QString &key, const QVariant &value) }); } -void GlobalSettings::forceSync(const QString &key) -{ +void GlobalSettings::forceSync(const QString &key) { m_settings->sync(); - if (key.isNull()) { + if(key.isNull()) { m_cache.clear(); - for (auto key : m_settings->allKeys()) { + for(auto key : m_settings->allKeys()) { m_cache.insert(key, m_settings->value(key)); } } else { @@ -295,14 +277,11 @@ void GlobalSettings::forceSync(const QString &key) } } -void GlobalSettings::updateSearchHistory(QString key) -{ - if(key == "search") - { +void GlobalSettings::updateSearchHistory(QString key) { + if(key == "search") { m_search_record_settings->sync(); m_history.clear(); - for(QString i:m_search_record_settings->allKeys()) - { + for(QString i : m_search_record_settings->allKeys()) { m_history.append(QUrl::fromPercentEncoding(i.toLocal8Bit())); } } diff --git a/libsearch/global-settings.h b/libsearch/global-settings.h index 404a1c2..a68059e 100644 --- a/libsearch/global-settings.h +++ b/libsearch/global-settings.h @@ -56,8 +56,7 @@ //#define CLOUD_HISTORY "history" //#define CLOUD_APPLICATIONS "applications" -class LIBSEARCH_EXPORT GlobalSettings : public QObject -{ +class LIBSEARCH_EXPORT GlobalSettings : public QObject { Q_OBJECT public: static GlobalSettings *getInstance(); @@ -65,8 +64,8 @@ public: bool isExist(const QString&); Q_SIGNALS: - void valueChanged (const QString&); - void transparencyChanged (const double&); + void valueChanged(const QString&); + void transparencyChanged(const double&); public Q_SLOTS: void setValue(const QString&, const QVariant&); @@ -80,7 +79,7 @@ public Q_SLOTS: * @param true to remove blocking,false to set blocking,default set false. * @return */ - bool setBlockDirs(const QString& path, int &returnCode,bool remove = false); + bool setBlockDirs(const QString& path, int &returnCode, bool remove = false); QStringList getBlockDirs(); // void appendCloudData(const QString& key, const QString& value); void setSearchRecord(const QString &word, const QDateTime &time); diff --git a/libsearch/gobject-template.h b/libsearch/gobject-template.h index 0dd1968..8d69a45 100644 --- a/libsearch/gobject-template.h +++ b/libsearch/gobject-template.h @@ -25,21 +25,20 @@ template -class gobjecttemplate -{ +class gobjecttemplate { public: //do not use this constructor. gobjecttemplate(); gobjecttemplate(T *obj, bool ref = false) { m_obj = obj; - if (ref) { + if(ref) { g_object_ref(obj); } } ~gobjecttemplate() { //qDebug()<<"~GObjectTemplate"; - if (m_obj) + if(m_obj) g_object_unref(m_obj); } diff --git a/libsearch/index/construct-document.cpp b/libsearch/index/construct-document.cpp index 3b9b780..b7f0b57 100644 --- a/libsearch/index/construct-document.cpp +++ b/libsearch/index/construct-document.cpp @@ -27,16 +27,14 @@ //extern QList *_doc_list_path; //extern QMutex _mutex_doc_list_path; -ConstructDocumentForPath::ConstructDocumentForPath(QVector list) -{ +ConstructDocumentForPath::ConstructDocumentForPath(QVector list) { this->setAutoDelete(true); m_list = std::move(list); } -void ConstructDocumentForPath::run() -{ +void ConstructDocumentForPath::run() { // qDebug()<<"ConstructDocumentForPath"; - if (!_doc_list_path) + if(!_doc_list_path) _doc_list_path = new QList; // qDebug()<<_doc_list_path->size(); QString index_text = m_list.at(0).toLower(); @@ -45,7 +43,7 @@ void ConstructDocumentForPath::run() //多音字版 //现加入首字母 - QStringList pinyin_text_list = FileUtils::findMultiToneWords(QString(m_list.at(0)).replace(".","")); + QStringList pinyin_text_list = FileUtils::findMultiToneWords(QString(m_list.at(0)).replace(".", "")); // if(!pinyin_text_list.isEmpty()) // { // for (QString& i : pinyin_text_list){ @@ -56,7 +54,7 @@ void ConstructDocumentForPath::run() // } QString uniqueterm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath)); - QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath.section("/",0,-2,QString::SectionIncludeLeadingSep))); + QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath.section("/", 0, -2, QString::SectionIncludeLeadingSep))); // qDebug()<<"sourcePath"< p; // p.append(postingCount); - doc.addPosting(QUrl::toPercentEncoding(index_text.at(postingCount)).toStdString(),postingCount); + doc.addPosting(QUrl::toPercentEncoding(index_text.at(postingCount)).toStdString(), postingCount); ++postingCount; } int i = 0; - for (QString& s : pinyin_text_list) - { + for(QString& s : pinyin_text_list) { i = 0; - while(i < s.size()) - { - doc.addPosting(QUrl::toPercentEncoding(s.at(i)).toStdString(),postingCount); + while(i < s.size()) { + doc.addPosting(QUrl::toPercentEncoding(s.at(i)).toStdString(), postingCount); ++postingCount; ++i; } @@ -99,24 +94,22 @@ void ConstructDocumentForPath::run() return; } -ConstructDocumentForContent::ConstructDocumentForContent(QString path) -{ +ConstructDocumentForContent::ConstructDocumentForContent(QString path) { this->setAutoDelete(true); m_path = std::move(path); } -void ConstructDocumentForContent::run() -{ +void ConstructDocumentForContent::run() { // qDebug() << "ConstructDocumentForContent currentThreadId()" << QThread::currentThreadId(); // 构造文本索引的document - if (!_doc_list_content) + if(!_doc_list_content) _doc_list_content = new QList; QString content; - FileReader::getTextContent(m_path,content); + FileReader::getTextContent(m_path, content); if(content.isEmpty()) return; QString uniqueterm = QString::fromStdString(FileUtils::makeDocUterm(m_path)); - QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(m_path.section("/",0,-2,QString::SectionIncludeLeadingSep))); + QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(m_path.section("/", 0, -2, QString::SectionIncludeLeadingSep))); QVector term = ChineseSegmentation::getInstance()->callSegement(content.left(20480000)); @@ -125,9 +118,8 @@ void ConstructDocumentForContent::run() doc.setUniqueTerm(uniqueterm); doc.addTerm(upTerm); doc.addValue(m_path); - for(int i = 0;i(term.at(i).weight)); + for(int i = 0; i < term.size(); ++i) { + doc.addPosting(term.at(i).word, term.at(i).offsets, static_cast(term.at(i).weight)); } diff --git a/libsearch/index/construct-document.h b/libsearch/index/construct-document.h index 46fab04..340b233 100644 --- a/libsearch/index/construct-document.h +++ b/libsearch/index/construct-document.h @@ -28,8 +28,7 @@ //extern QList *_doc_list_path; //extern QMutex _mutex_doc_list_path; class IndexGenerator; -class ConstructDocumentForPath : public QRunnable -{ +class ConstructDocumentForPath : public QRunnable { public: explicit ConstructDocumentForPath(QVector list); ~ConstructDocumentForPath() = default; @@ -39,8 +38,7 @@ private: QVector m_list; }; -class ConstructDocumentForContent : public QRunnable -{ +class ConstructDocumentForContent : public QRunnable { public: explicit ConstructDocumentForContent(QString path); ~ConstructDocumentForContent() = default; diff --git a/libsearch/index/document.cpp b/libsearch/index/document.cpp index 88470ce..05d6693 100644 --- a/libsearch/index/document.cpp +++ b/libsearch/index/document.cpp @@ -20,50 +20,43 @@ #include "document.h" #include -void Document::setData(QString data) -{ +void Document::setData(QString data) { if(data.isEmpty()) return; m_document.set_data(data.toStdString()); } -void Document::addPosting(std::string term,QVector offset, int weight) -{ +void Document::addPosting(std::string term, QVector offset, int weight) { if(term == "") return; if(term.length() > 240) term = QString::fromStdString(term).left(30).toStdString(); - for(size_t i : offset) - { - m_document.add_posting(term,i,weight); + for(size_t i : offset) { + m_document.add_posting(term, i, weight); } } -void Document::addPosting(std::string term, unsigned int offset, int weight) -{ +void Document::addPosting(std::string term, unsigned int offset, int weight) { if(term == "") return; if(term.length() > 240) term = QString::fromStdString(term).left(30).toStdString(); - m_document.add_posting(term,offset,weight); + m_document.add_posting(term, offset, weight); } -void Document::addTerm(QString term) -{ +void Document::addTerm(QString term) { if(term.isEmpty()) return; m_document.add_term(term.toStdString()); } -void Document::addValue(QString value) -{ - m_document.add_value(1,value.toStdString()); +void Document::addValue(QString value) { + m_document.add_value(1, value.toStdString()); } -void Document::setUniqueTerm(QString term) -{ +void Document::setUniqueTerm(QString term) { if(term.isEmpty()) return; m_document.add_term(term.toStdString()); @@ -71,26 +64,22 @@ void Document::setUniqueTerm(QString term) // m_unique_term = new QString(term); m_unique_term = std::move(term); } -std::string Document::getUniqueTerm() -{ +std::string Document::getUniqueTerm() { // qDebug()<<"m_unique_term!"<<*m_unique_term; // qDebug() << QString::fromStdString(m_unique_term.toStdString()); return m_unique_term.toStdString(); } -void Document::setIndexText(QStringList indexText) -{ +void Document::setIndexText(QStringList indexText) { // QStringList indexTextList = indexText; // m_index_text = new QStringList(indexText); m_index_text = std::move(indexText); } -QStringList Document::getIndexText() -{ +QStringList Document::getIndexText() { return m_index_text; } -Xapian::Document Document::getXapianDocument() -{ +Xapian::Document Document::getXapianDocument() { return m_document; } diff --git a/libsearch/index/document.h b/libsearch/index/document.h index 7a55f00..3232567 100644 --- a/libsearch/index/document.h +++ b/libsearch/index/document.h @@ -25,24 +25,23 @@ #include #include -class Document -{ +class Document { public: Document() = default; - ~Document(){} - Document(const Document& other){ + ~Document() {} + Document(const Document& other) { m_document = other.m_document; m_index_text = other.m_index_text; m_unique_term = other.m_unique_term; } - void operator=(const Document& other){ - m_document = other.m_document; - m_index_text = other.m_index_text; - m_unique_term = other.m_unique_term; + void operator=(const Document& other) { + m_document = other.m_document; + m_index_text = other.m_index_text; + m_unique_term = other.m_unique_term; } void setData(QString data); - void addPosting(std::string term, QVector offset, int weight =1); - void addPosting(std::string term, unsigned int offset, int weight =1); + void addPosting(std::string term, QVector offset, int weight = 1); + void addPosting(std::string term, unsigned int offset, int weight = 1); void addTerm(QString term); void addValue(QString value); void setUniqueTerm(QString term); diff --git a/libsearch/index/file-reader.cpp b/libsearch/index/file-reader.cpp index 35afefa..5cc8550 100644 --- a/libsearch/index/file-reader.cpp +++ b/libsearch/index/file-reader.cpp @@ -21,48 +21,36 @@ #include "file-utils.h" #include "binary-parser.h" -FileReader::FileReader(QObject *parent) : QObject(parent) -{ +FileReader::FileReader(QObject *parent) : QObject(parent) { } -void FileReader::getTextContent(QString path, QString &textContent) -{ +void FileReader::getTextContent(QString path, QString &textContent) { QMimeType type = FileUtils::getMimetype(path); QString name = type.name(); QFileInfo file(path); QString strsfx = file.suffix(); - if(name== "application/zip") - { - if(strsfx.endsWith( "docx")) - FileUtils::getDocxTextContent(path,textContent); - if(strsfx.endsWith( "pptx")) - FileUtils::getPptxTextContent(path,textContent); - if(strsfx.endsWith( "xlsx")) - FileUtils::getXlsxTextContent(path,textContent); - } - else if(name == "text/plain") - { - if(strsfx.endsWith( "txt")) - FileUtils::getTxtContent(path,textContent); - } - else if(type.inherits("application/msword") || type.name() == "application/x-ole-storage") - { - if (strsfx.endsWith("doc") || strsfx.endsWith("dot") || strsfx.endsWith("wps") || strsfx.endsWith("ppt") || - strsfx.endsWith("pps") ||strsfx.endsWith("dps") || strsfx.endsWith("et") || strsfx.endsWith("xls")) - { + if(name == "application/zip") { + if(strsfx.endsWith("docx")) + FileUtils::getDocxTextContent(path, textContent); + if(strsfx.endsWith("pptx")) + FileUtils::getPptxTextContent(path, textContent); + if(strsfx.endsWith("xlsx")) + FileUtils::getXlsxTextContent(path, textContent); + } else if(name == "text/plain") { + if(strsfx.endsWith("txt")) + FileUtils::getTxtContent(path, textContent); + } else if(type.inherits("application/msword") || type.name() == "application/x-ole-storage") { + if(strsfx.endsWith("doc") || strsfx.endsWith("dot") || strsfx.endsWith("wps") || strsfx.endsWith("ppt") || + strsfx.endsWith("pps") || strsfx.endsWith("dps") || strsfx.endsWith("et") || strsfx.endsWith("xls")) { KBinaryParser searchdata; - searchdata.RunParser(path,textContent); + searchdata.RunParser(path, textContent); } - } - else if(name == "application/pdf") - { - if(strsfx.endsWith( "pdf")) - FileUtils::getPdfTextContent(path,textContent); - } - else - { - qWarning()<<"Unsupport format:["< #include -class FileReader : public QObject -{ +class FileReader : public QObject { Q_OBJECT public: explicit FileReader(QObject *parent = nullptr); - ~FileReader()=default; + ~FileReader() = default; static void getTextContent(QString path, QString &textContent); }; diff --git a/libsearch/index/file-searcher.cpp b/libsearch/index/file-searcher.cpp index 6da3d6b..6619ee0 100644 --- a/libsearch/index/file-searcher.cpp +++ b/libsearch/index/file-searcher.cpp @@ -32,30 +32,23 @@ size_t FileSearcher::uniqueSymbol3 = 0; QMutex FileSearcher::m_mutex1; QMutex FileSearcher::m_mutex2; QMutex FileSearcher::m_mutex3; -FileSearcher::FileSearcher(QObject *parent) : QObject(parent) -{ +FileSearcher::FileSearcher(QObject *parent) : QObject(parent) { } -FileSearcher::~FileSearcher() -{ +FileSearcher::~FileSearcher() { } -int FileSearcher::getCurrentIndexCount() -{ - try - { +int FileSearcher::getCurrentIndexCount() { + try { Xapian::Database db(INDEX_PATH); return db.get_doccount(); - } - catch(const Xapian::Error &e) - { - qWarning() < *searchResultFile,QQueue *searchResultDir,QQueue> *searchResultContent) -{ +void FileSearcher::onKeywordSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, QQueue> *searchResultContent) { m_mutex1.lock(); ++uniqueSymbol1; m_mutex1.unlock(); @@ -71,16 +64,15 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult m_search_result_content = searchResultContent; //file - QtConcurrent::run([&, uniqueSymbol1, keyword](){ + QtConcurrent::run([&, uniqueSymbol1, keyword]() { if(!m_search_result_file->isEmpty()) m_search_result_file->clear(); int begin = 0; int num = 5; int resultCount = 0; int total = 0; - while(total < 100) - { - resultCount = keywordSearchfile(uniqueSymbol1,keyword,"0",1,begin,num); + while(total < 100) { + resultCount = keywordSearchfile(uniqueSymbol1, keyword, "0", 1, begin, num); if(resultCount == 0 || resultCount == -1) break; total += resultCount; @@ -90,16 +82,15 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult }); // Q_EMIT this->resultFile(m_search_result_file); //dir - QtConcurrent::run([&, uniqueSymbol2, keyword](){ + QtConcurrent::run([&, uniqueSymbol2, keyword]() { if(!m_search_result_dir->isEmpty()) m_search_result_dir->clear(); int begin = 0; int num = 5; int resultCount = 0; int total = 0; - while(total<100) - { - resultCount = keywordSearchfile(uniqueSymbol2,keyword,"1",1,begin,num); + while(total < 100) { + resultCount = keywordSearchfile(uniqueSymbol2, keyword, "1", 1, begin, num); if(resultCount == 0 || resultCount == -1) break; total += resultCount; @@ -109,7 +100,7 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult }); // Q_EMIT this->resultDir(m_search_result_dir); //content - QtConcurrent::run([&, uniqueSymbol3, keyword](){ + QtConcurrent::run([&, uniqueSymbol3, keyword]() { if(!m_search_result_content->isEmpty()) m_search_result_content->clear(); int begin = 0; @@ -117,9 +108,8 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult int resultCount = 0; int total = 0; - while(total<50) - { - resultCount = keywordSearchContent(uniqueSymbol3,keyword,begin,num); + while(total < 50) { + resultCount = keywordSearchContent(uniqueSymbol3, keyword, begin, num); if(resultCount == 0 || resultCount == -1) break; total += resultCount; @@ -130,54 +120,45 @@ void FileSearcher::onKeywordSearch(QString keyword,QQueue *searchResult // Q_EMIT this->resultContent(m_search_result_content); } -int FileSearcher::keywordSearchfile(size_t uniqueSymbol, QString keyword, QString value, unsigned slot, int begin, int num) -{ - try - { +int FileSearcher::keywordSearchfile(size_t uniqueSymbol, QString keyword, QString value, unsigned slot, int begin, int num) { + try { qDebug() << "--keywordSearchfile start--"; Xapian::Database db(INDEX_PATH); - Xapian::Query query = creatQueryForFileSearch(keyword,db); + Xapian::Query query = creatQueryForFileSearch(keyword, db); Xapian::Enquire enquire(db); Xapian::Query queryFile; - if(!value.isEmpty()) - { + if(!value.isEmpty()) { std::string slotValue = value.toStdString(); - Xapian::Query queryValue = Xapian::Query(Xapian::Query::OP_VALUE_RANGE,slot,slotValue,slotValue); - queryFile = Xapian::Query(Xapian::Query::OP_AND,query,queryValue); - } - else - { + Xapian::Query queryValue = Xapian::Query(Xapian::Query::OP_VALUE_RANGE, slot, slotValue, slotValue); + queryFile = Xapian::Query(Xapian::Query::OP_AND, query, queryValue); + } else { queryFile = query; } - qDebug() << "keywordSearchfile:"< sKeyWord = ChineseSegmentation::getInstance()->callSegement(keyword); //Creat a query std::string words; - for(int i=0;i v; - for(int i=0;iappend(QString::fromStdString(data)); - qDebug()<enqueue(path); m_mutex1.unlock(); - } - else - { + } else { m_mutex1.unlock(); return -1; } @@ -304,13 +270,10 @@ int FileSearcher::getResult(size_t uniqueSymbol, Xapian::MSet &result, QString v break; case 0: m_mutex2.lock(); - if(uniqueSymbol == FileSearcher::uniqueSymbol2) - { + if(uniqueSymbol == FileSearcher::uniqueSymbol2) { m_search_result_file->enqueue(path); m_mutex2.unlock(); - } - else - { + } else { m_mutex2.unlock(); return -1; } @@ -320,27 +283,25 @@ int FileSearcher::getResult(size_t uniqueSymbol, Xapian::MSet &result, QString v } // searchResult.append(path); } - qDebug()<< "doc="<< path << ",weight=" < searchResult; - for (auto it = result.begin(); it != result.end(); ++it) - { + for(auto it = result.begin(); it != result.end(); ++it) { Xapian::Document doc = it.get_document(); std::string data = doc.get_data(); double docScoreWeight = it.get_weight(); @@ -352,50 +313,43 @@ int FileSearcher::getContentResult(size_t uniqueSymbol, Xapian::MSet &result, st QFileInfo info(path); - if(!info.exists()) - { + if(!info.exists()) { // pathTobeDelete->append(QString::fromStdString(data)); - qDebug()<enqueue(qMakePair(path,snippets)); + m_search_result_content->enqueue(qMakePair(path, snippets)); m_mutex3.unlock(); - } - else - { + } else { m_mutex3.unlock(); return -1; } // searchResult.insert(path,snippets); - qDebug()<< "path="<< path << ",weight=" < *searchResultFile,QQueue *searchResultDir,QQueue> *searchResultContent); + void onKeywordSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, QQueue> *searchResultContent); Q_SIGNALS: void resultFile(QQueue *); void resultDir(QQueue *); - void resultContent(QQueue> *); + void resultContent(QQueue> *); private: - int keywordSearchfile(size_t uniqueSymbol, QString keyword, QString value,unsigned slot = 1,int begin = 0, int num = 20); + int keywordSearchfile(size_t uniqueSymbol, QString keyword, QString value, unsigned slot = 1, int begin = 0, int num = 20); int keywordSearchContent(size_t uniqueSymbol, QString keyword, int begin = 0, int num = 20); /** @@ -70,13 +69,13 @@ private: Xapian::Query creatQueryForContentSearch(QString keyword, Xapian::Database &db); int getResult(size_t uniqueSymbol, Xapian::MSet &result, QString value); - int getContentResult(size_t uniqueSymbol, Xapian::MSet &result,std::string &keyWord); + int getContentResult(size_t uniqueSymbol, Xapian::MSet &result, std::string &keyWord); bool isBlocked(QString &path); QQueue *m_search_result_file = nullptr; QQueue *m_search_result_dir = nullptr; - QQueue> *m_search_result_content = nullptr; + QQueue> *m_search_result_content = nullptr; bool m_searching = false; }; diff --git a/libsearch/index/first-index.cpp b/libsearch/index/first-index.cpp index ba07138..b4a645a 100644 --- a/libsearch/index/first-index.cpp +++ b/libsearch/index/first-index.cpp @@ -25,12 +25,10 @@ #define NEW_QUEUE(a) a = new QQueue(); qDebug("---------------------------%s %s %s new at %d..",__FILE__,__FUNCTION__,#a,__LINE__); //#define DELETE_QUEUE(a ) -FirstIndex::FirstIndex() -{ +FirstIndex::FirstIndex() { } -FirstIndex::~FirstIndex() -{ +FirstIndex::~FirstIndex() { qDebug() << "~FirstIndex"; if(this->q_index) delete this->q_index; @@ -38,38 +36,37 @@ FirstIndex::~FirstIndex() if(this->q_content_index) delete this->q_content_index; this->q_content_index = nullptr; - if (this->p_indexGenerator) + if(this->p_indexGenerator) delete this->p_indexGenerator; this->p_indexGenerator = nullptr; qDebug() << "~FirstIndex end"; } -void FirstIndex::DoSomething(const QFileInfo& fileInfo){ +void FirstIndex::DoSomething(const QFileInfo& fileInfo) { // qDebug() << "there are some shit here"<q_index->enqueue(QVector() << fileInfo.fileName() << fileInfo.absoluteFilePath() << QString((fileInfo.isDir() && (!fileInfo.isSymLink())) ? "1" : "0")); - if ((fileInfo.fileName().split(".", QString::SkipEmptyParts).length() > 1) && (true == targetFileTypeMap[fileInfo.fileName().split(".").last()])){ + if((fileInfo.fileName().split(".", QString::SkipEmptyParts).length() > 1) && (true == targetFileTypeMap[fileInfo.fileName().split(".").last()])) { this->q_content_index->enqueue(fileInfo.absoluteFilePath()); } } -void FirstIndex::run(){ +void FirstIndex::run() { QTime t1 = QTime::currentTime(); // Create a fifo at ~/.config/org.ukui/ukui-search, the fifo is used to control the order of child processes' running. - QDir fifoDir = QDir(QDir::homePath()+"/.config/org.ukui/ukui-search"); + QDir fifoDir = QDir(QDir::homePath() + "/.config/org.ukui/ukui-search"); if(!fifoDir.exists()) - qDebug()<<"create fifo path"<getValue(INDEX_DATABASE_STATE).toString(); QString contentIndexDataBaseStatus = GlobalSettings::getInstance()->getValue(CONTENT_INDEX_DATABASE_STATE).toString(); @@ -80,16 +77,14 @@ void FirstIndex::run(){ qDebug() << "inotifyIndexStatus: " << inotifyIndexStatus; /* || contentIndexDataBaseStatus == ""*/ - if (indexDataBaseStatus == ""){ + if(indexDataBaseStatus == "") { this->bool_dataBaseExist = false; - } - else{ + } else { this->bool_dataBaseExist = true; } - if (indexDataBaseStatus != "2" || contentIndexDataBaseStatus != "2" || inotifyIndexStatus != "2"){ + if(indexDataBaseStatus != "2" || contentIndexDataBaseStatus != "2" || inotifyIndexStatus != "2") { this->bool_dataBaseStatusOK = false; - } - else{ + } else { this->bool_dataBaseStatusOK = true; } @@ -104,8 +99,7 @@ void FirstIndex::run(){ buffer[0] = 0x1; buffer[1] = '\0'; fifo_fd = open(UKUI_SEARCH_PIPE_PATH, O_RDWR); - if(fifo_fd == -1) - { + if(fifo_fd == -1) { perror("open fifo error\n"); assert(false); } @@ -119,23 +113,20 @@ void FirstIndex::run(){ pid_t pid; pid = fork(); - if(pid == 0) - { + if(pid == 0) { prctl(PR_SET_PDEATHSIG, SIGTERM); - prctl(PR_SET_NAME,"first-index"); - if (this->bool_dataBaseExist){ - if (this->bool_dataBaseStatusOK){ + prctl(PR_SET_NAME, "first-index"); + if(this->bool_dataBaseExist) { + if(this->bool_dataBaseStatusOK) { ::_exit(0); - } - else{ + } else { //if the parameter is false, index won't be rebuild //if it is true, index will be rebuild - p_indexGenerator = IndexGenerator::getInstance(true,this); + p_indexGenerator = IndexGenerator::getInstance(true, this); } - } - else{ + } else { // p_indexGenerator = IndexGenerator::getInstance(false,this); - p_indexGenerator = IndexGenerator::getInstance(true,this); + p_indexGenerator = IndexGenerator::getInstance(true, this); } QSemaphore sem(5); @@ -150,16 +141,16 @@ void FirstIndex::run(){ this->setPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); this->Traverse(); FileUtils::_max_index_count = this->q_index->length(); - qDebug()<<"max_index_count:"<>* tmp = new QQueue>(); - while (!this->q_index->empty()) { - for (size_t i = 0; (i < 8192) && (!this->q_index->empty()); ++i){ + while(!this->q_index->empty()) { + for(size_t i = 0; (i < 8192) && (!this->q_index->empty()); ++i) { tmp->enqueue(this->q_index->dequeue()); } this->p_indexGenerator->creatAllIndex(tmp); @@ -170,14 +161,14 @@ void FirstIndex::run(){ qDebug() << "index end;"; sem.release(2); }); - QtConcurrent::run([&](){ + QtConcurrent::run([&]() { sem.acquire(2); mutex3.unlock(); QQueue* tmp = new QQueue(); - qDebug()<<"q_content_index:"<size(); - while (!this->q_content_index->empty()) { + qDebug() << "q_content_index:" << q_content_index->size(); + while(!this->q_content_index->empty()) { // for (size_t i = 0; (i < this->u_send_length) && (!this->q_content_index->empty()); ++i){ - for (size_t i = 0; (i < 30) && (!this->q_content_index->empty()); ++i){ + for(size_t i = 0; (i < 30) && (!this->q_content_index->empty()); ++i) { tmp->enqueue(this->q_content_index->dequeue()); } this->p_indexGenerator->creatAllIndex(tmp); @@ -195,33 +186,28 @@ void FirstIndex::run(){ mutex2.unlock(); mutex3.unlock(); - if (this->q_index) + if(this->q_index) delete this->q_index; this->q_index = nullptr; - if (this->q_content_index) + if(this->q_content_index) delete this->q_content_index; this->q_content_index = nullptr; - if (p_indexGenerator) + if(p_indexGenerator) delete p_indexGenerator; p_indexGenerator = nullptr; // GlobalSettings::getInstance()->forceSync(); ::_exit(0); - } - else if(pid < 0) - { - qWarning()<<"First Index fork error!!"; - } - else - { - waitpid(pid,NULL,0); + } else if(pid < 0) { + qWarning() << "First Index fork error!!"; + } else { + waitpid(pid, NULL, 0); --FileUtils::_index_status; } GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "2"); int retval1 = write(fifo_fd, buffer, strlen(buffer)); - if(retval1 == -1) - { + if(retval1 == -1) { qWarning("write error\n"); } qDebug("write data ok!\n"); diff --git a/libsearch/index/first-index.h b/libsearch/index/first-index.h index 5a19edb..4ad3030 100644 --- a/libsearch/index/first-index.h +++ b/libsearch/index/first-index.h @@ -42,8 +42,7 @@ #include "inotify-index.h" #include "file-utils.h" -class FirstIndex : public QThread, public Traverse_BFS -{ +class FirstIndex : public QThread, public Traverse_BFS { public: FirstIndex(); ~FirstIndex(); diff --git a/libsearch/index/index-generator.cpp b/libsearch/index/index-generator.cpp index 3847cb3..81395e3 100644 --- a/libsearch/index/index-generator.cpp +++ b/libsearch/index/index-generator.cpp @@ -42,36 +42,32 @@ QList *_doc_list_path; QMutex _mutex_doc_list_path; QList *_doc_list_content; QMutex _mutex_doc_list_content; -IndexGenerator *IndexGenerator::getInstance(bool rebuild, QObject *parent) -{ +IndexGenerator *IndexGenerator::getInstance(bool rebuild, QObject *parent) { QMutexLocker locker(&m_mutex); - if (!global_instance) { - qDebug()<<"IndexGenerator================="; - global_instance = new IndexGenerator(rebuild,parent); + if(!global_instance) { + qDebug() << "IndexGenerator================="; + global_instance = new IndexGenerator(rebuild, parent); } qDebug() << "global_instance" << global_instance; qDebug() << "QThread::currentThreadId()" << QThread::currentThreadId(); return global_instance; } -bool IndexGenerator::setIndexdataPath() -{ +bool IndexGenerator::setIndexdataPath() { return true; } //文件名索引 -bool IndexGenerator::creatAllIndex(QQueue > *messageList) -{ +bool IndexGenerator::creatAllIndex(QQueue > *messageList) { // FileUtils::_index_status |= 0x1; // qDebug() << messageList->size(); HandlePathList(messageList); - if (_doc_list_path == NULL){ + if(_doc_list_path == NULL) { return false; } - qDebug()<<"begin creatAllIndex"; - GlobalSettings::getInstance()->setValue(INDEX_DATABASE_STATE,"0"); - try - { + qDebug() << "begin creatAllIndex"; + GlobalSettings::getInstance()->setValue(INDEX_DATABASE_STATE, "0"); + try { // m_indexer = new Xapian::TermGenerator(); // m_indexer.set_database(*m_database_path); //可以实现拼写纠正 @@ -80,7 +76,7 @@ bool IndexGenerator::creatAllIndex(QQueue > *messageList) // int count =0; - for (auto i : *_doc_list_path){ + for(auto i : *_doc_list_path) { insertIntoDatabase(i); // if(++count > 8999){ @@ -89,17 +85,15 @@ bool IndexGenerator::creatAllIndex(QQueue > *messageList) // } } m_database_path->commit(); - } - catch(const Xapian::Error &e) - { - qWarning()<<"creatAllIndex fail!"<setValue(INDEX_DATABASE_STATE,"1"); + GlobalSettings::getInstance()->setValue(INDEX_DATABASE_STATE, "1"); // FileUtils::_index_status &= ~0x1; assert(false); } - GlobalSettings::getInstance()->setValue(INDEX_DATABASE_STATE,"2"); - qDebug()<<"finish creatAllIndex"; + GlobalSettings::getInstance()->setValue(INDEX_DATABASE_STATE, "2"); + qDebug() << "finish creatAllIndex"; // FileUtils::_index_status &= ~0x1; _doc_list_path->clear(); delete _doc_list_path; @@ -107,41 +101,36 @@ bool IndexGenerator::creatAllIndex(QQueue > *messageList) return true; } //文件内容索引 -bool IndexGenerator::creatAllIndex(QQueue *messageList) -{ +bool IndexGenerator::creatAllIndex(QQueue *messageList) { // FileUtils::_index_status |= 0x2; HandlePathList(messageList); - qDebug()<<"begin creatAllIndex for content"; - if (_doc_list_content == NULL){ + qDebug() << "begin creatAllIndex for content"; + if(_doc_list_content == NULL) { return false; } int size = _doc_list_content->size(); - qDebug()<<"begin creatAllIndex for content"<setValue(CONTENT_INDEX_DATABASE_STATE,"0"); - try - { - int count =0; - for (auto i : *_doc_list_content){ + qDebug() << "begin creatAllIndex for content" << size; + if(!size == 0) { + GlobalSettings::getInstance()->setValue(CONTENT_INDEX_DATABASE_STATE, "0"); + try { + int count = 0; + for(auto i : *_doc_list_content) { insertIntoContentDatabase(i); - if(++count > 999){ + if(++count > 999) { count = 0; m_database_content->commit(); } - } + } m_database_content->commit(); - } - catch(const Xapian::Error &e) - { - qWarning()<<"creat content Index fail!"<setValue(CONTENT_INDEX_DATABASE_STATE,"1"); + } catch(const Xapian::Error &e) { + qWarning() << "creat content Index fail!" << QString::fromStdString(e.get_description()); + GlobalSettings::getInstance()->setValue(CONTENT_INDEX_DATABASE_STATE, "1"); // FileUtils::_index_status &= ~0x2; assert(false); } - GlobalSettings::getInstance()->setValue(CONTENT_INDEX_DATABASE_STATE,"2"); + GlobalSettings::getInstance()->setValue(CONTENT_INDEX_DATABASE_STATE, "2"); // FileUtils::_index_status &= ~0x2; - qDebug()<<"finish creatAllIndex for content"; + qDebug() << "finish creatAllIndex for content"; _doc_list_content->clear(); delete _doc_list_content; _doc_list_content = nullptr; @@ -151,36 +140,28 @@ bool IndexGenerator::creatAllIndex(QQueue *messageList) } -IndexGenerator::IndexGenerator(bool rebuild, QObject *parent) : QObject(parent) -{ +IndexGenerator::IndexGenerator(bool rebuild, QObject *parent) : QObject(parent) { QDir database(QString::fromStdString(INDEX_PATH)); - if(database.exists()) - { + if(database.exists()) { if(rebuild) - qDebug()<<"remove"<replace_document(doc.getUniqueTerm(),document); + Xapian::docid innerId = m_database_path->replace_document(doc.getUniqueTerm(), document); // qDebug()<<"replace doc docid="<(innerId); // qDebug()<< "--index finish--"; return; } //#define fun(a) a=new ;printf() -void IndexGenerator::insertIntoContentDatabase(Document& doc) -{ - Xapian::docid innerId= m_database_content->replace_document(doc.getUniqueTerm(),doc.getXapianDocument()); +void IndexGenerator::insertIntoContentDatabase(Document& doc) { + Xapian::docid innerId = m_database_content->replace_document(doc.getUniqueTerm(), doc.getXapianDocument()); // qDebug()<<"replace doc docid="<(innerId); // qDebug()<< "--index finish--"; return; } -void IndexGenerator::HandlePathList(QQueue> *messageList) -{ - qDebug()<<"Begin HandlePathList!"; - qDebug()<size(); +void IndexGenerator::HandlePathList(QQueue> *messageList) { + qDebug() << "Begin HandlePathList!"; + qDebug() << messageList->size(); // qDebug()< future = QtConcurrent::mapped(*messageList,&IndexGenerator::GenerateDocument); @@ -259,12 +237,11 @@ void IndexGenerator::HandlePathList(QQueue> *messageList) pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1); pool.setExpiryTimeout(100); ConstructDocumentForPath *constructer; - while(!messageList->isEmpty()) - { - constructer = new ConstructDocumentForPath(messageList->dequeue()); - pool.start(constructer); + while(!messageList->isEmpty()) { + constructer = new ConstructDocumentForPath(messageList->dequeue()); + pool.start(constructer); } - qDebug()<<"pool finish"<> *messageList) // m_doc_list_path = std::move(future.results()); // qDebug()< *messageList) -{ - qDebug()<<"Begin HandlePathList for content index!"; - qDebug()<size(); +void IndexGenerator::HandlePathList(QQueue *messageList) { + qDebug() << "Begin HandlePathList for content index!"; + qDebug() << messageList->size(); // qDebug()< *messageList) // pool.setMaxThreadCount(((QThread::idealThreadCount() - 1) / 2) + 1); pool.setMaxThreadCount(1); pool.setExpiryTimeout(100); - while(!messageList->isEmpty()) - { - constructer = new ConstructDocumentForContent(messageList->dequeue()); - pool.start(constructer); + while(!messageList->isEmpty()) { + constructer = new ConstructDocumentForContent(messageList->dequeue()); + pool.start(constructer); } - qDebug()<<"pool finish"< *messageList) // m_doc_list_content = std::move(future.results()); // future.cancel(); - qDebug()<<"Finish HandlePathList for content index!"; + qDebug() << "Finish HandlePathList for content index!"; return; } -Document IndexGenerator::GenerateDocument(const QVector &list) -{ +Document IndexGenerator::GenerateDocument(const QVector &list) { Document doc; // qDebug()< &list) //多音字版 //现加入首字母 - QStringList pinyin_text_list = FileUtils::findMultiToneWords(QString(list.at(0)).replace(".","")); - for (QString& i : pinyin_text_list){ + QStringList pinyin_text_list = FileUtils::findMultiToneWords(QString(list.at(0)).replace(".", "")); + for(QString& i : pinyin_text_list) { i.replace("", " "); i = i.simplified(); } QString uniqueterm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath)); - QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath.section("/",0,-2,QString::SectionIncludeLeadingSep))); + QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath.section("/", 0, -2, QString::SectionIncludeLeadingSep))); // QString uniqueterm1 = QString::fromStdString(QCryptographicHash::hash(sourcePath.toUtf8(),QCryptographicHash::Md5).toStdString()); -/*--------------------------------------------------------------------*/ + /*--------------------------------------------------------------------*/ //QByteArray 和 QString 之间会进行隐式转换,造成字符串被截断等意想不到的后果!!!!!!! zpf // if(uniqueterm1!=uniqueterm){ // qDebug()<<"-----------------------------------------start"; @@ -353,7 +327,7 @@ Document IndexGenerator::GenerateDocument(const QVector &list) // qDebug()< &list) } -Document IndexGenerator::GenerateContentDocument(const QString &path) -{ +Document IndexGenerator::GenerateContentDocument(const QString &path) { // 构造文本索引的document QString content; QStringList tmp; @@ -377,7 +350,7 @@ Document IndexGenerator::GenerateContentDocument(const QString &path) Document doc; QString uniqueterm; QString upTerm; - FileReader::getTextContent(path,content); + FileReader::getTextContent(path, content); term = ChineseSegmentation::getInstance()->callSegement(content); // QStringList term = content.split(""); @@ -386,9 +359,8 @@ Document IndexGenerator::GenerateContentDocument(const QString &path) doc.setUniqueTerm(uniqueterm); doc.addTerm(upTerm); doc.addValue(path); - for(int i = 0;i(term.at(i).weight)); + for(int i = 0; i < term.size(); ++i) { + doc.addPosting(term.at(i).word, term.at(i).offsets, static_cast(term.at(i).weight)); } @@ -408,8 +380,7 @@ Document IndexGenerator::GenerateContentDocument(const QString &path) return doc; } -bool IndexGenerator::isIndexdataExist() -{ +bool IndexGenerator::isIndexdataExist() { // Xapian::Database db(m_index_data_path->toStdString()); return true; @@ -417,12 +388,10 @@ bool IndexGenerator::isIndexdataExist() } -QStringList IndexGenerator::IndexSearch(QString indexText) -{ +QStringList IndexGenerator::IndexSearch(QString indexText) { QStringList searchResult; - try - { - qDebug()<<"--search start--"; + try { + qDebug() << "--search start--"; Xapian::Database db(INDEX_PATH); Xapian::Enquire enquire(db); @@ -431,33 +400,32 @@ QStringList IndexGenerator::IndexSearch(QString indexText) qp.set_database(db); auto userInput = indexText; - std::string queryStr = indexText.replace(""," ").toStdString(); + std::string queryStr = indexText.replace("", " ").toStdString(); // std::string s =db.get_spelling_suggestion(queryStr,10); // qDebug()<<"spelling_suggestion!"< v; - for(int i=0;iisEmpty()) return true; - for(int i = 0;isize();i++) - { + for(int i = 0; i < list->size(); i++) { QString doc = list->at(i); std::string uniqueterm = FileUtils::makeDocUterm(doc); - try - { - qDebug()<<"--delete start--"; + try { + qDebug() << "--delete start--"; m_database_path->delete_document(uniqueterm); m_database_content->delete_document(uniqueterm); - qDebug()<<"delete path"<commit(); m_database_content->commit(); - qDebug()<< "--delete finish--"; + qDebug() << "--delete finish--"; // qDebug()<<"m_database_path->get_lastdocid()!!!"<get_lastdocid(); // qDebug()<<"m_database_path->get_doccount()!!!"<get_doccount(); - } - catch(const Xapian::Error &e) - { - qWarning()< *_doc_list_content; extern QMutex _mutex_doc_list_content; -class IndexGenerator : public QObject -{ +class IndexGenerator : public QObject { Q_OBJECT public: - static IndexGenerator *getInstance(bool rebuild = false,QObject *parent = nullptr); + static IndexGenerator *getInstance(bool rebuild = false, QObject *parent = nullptr); ~IndexGenerator(); bool setIndexdataPath(); bool isIndexdataExist(); @@ -58,7 +57,7 @@ public Q_SLOTS: bool deleteAllIndex(QStringList *pathlist); private: - explicit IndexGenerator(bool rebuild = false,QObject *parent = nullptr); + explicit IndexGenerator(bool rebuild = false, QObject *parent = nullptr); static QMutex m_mutex; //For file name index void HandlePathList(QQueue > *messageList); @@ -72,7 +71,7 @@ private: // QList *m_doc_list_path; //for path index // QList *m_doc_list_content; // for text content index - QMap m_index_map; + QMap m_index_map; QString m_index_data_path; Xapian::WritableDatabase* m_database_path; Xapian::WritableDatabase* m_database_content; diff --git a/libsearch/index/inotify-index.cpp b/libsearch/index/inotify-index.cpp index 2923fc8..9256a42 100644 --- a/libsearch/index/inotify-index.cpp +++ b/libsearch/index/inotify-index.cpp @@ -46,8 +46,7 @@ CREATE_FILE_NAME_INDEX \ CREATE_FILE_CONTENT_INDEX -InotifyIndex::InotifyIndex(const QString& path) : Traverse_BFS(path) -{ +InotifyIndex::InotifyIndex(const QString& path) : Traverse_BFS(path) { qDebug() << "setInotifyMaxUserWatches start"; UkuiSearchQDBus usQDBus; usQDBus.setInotifyMaxUserWatches(); @@ -55,24 +54,23 @@ InotifyIndex::InotifyIndex(const QString& path) : Traverse_BFS(path) } -InotifyIndex::~InotifyIndex() -{ +InotifyIndex::~InotifyIndex() { IndexGenerator::getInstance()->~IndexGenerator(); qWarning() << "~InotifyIndex"; } -void InotifyIndex::firstTraverse(){ +void InotifyIndex::firstTraverse() { QQueue bfs; bfs.enqueue(this->path); QFileInfoList list; QDir dir; dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); dir.setSorting(QDir::DirsFirst); - while (!bfs.empty()) { + while(!bfs.empty()) { dir.setPath(bfs.dequeue()); list = dir.entryInfoList(); - for (auto i : list){ - if (i.isDir() && (!(i.isSymLink()))){ + for(auto i : list) { + if(i.isDir() && (!(i.isSymLink()))) { this->AddWatch(i.absoluteFilePath()); bfs.enqueue(i.absoluteFilePath()); } @@ -80,24 +78,24 @@ void InotifyIndex::firstTraverse(){ } } -void InotifyIndex::DoSomething(const QFileInfo& fileInfo){ +void InotifyIndex::DoSomething(const QFileInfo& fileInfo) { qDebug() << fileInfo.fileName() << "-------" << fileInfo.absoluteFilePath(); - if(fileInfo.isDir() && (!fileInfo.isSymLink())){ + if(fileInfo.isDir() && (!fileInfo.isSymLink())) { this->AddWatch(fileInfo.absoluteFilePath()); } QQueue > tempFile; tempFile.enqueue(QVector() << fileInfo.fileName() << fileInfo.absoluteFilePath() << QString((fileInfo.isDir() && (!fileInfo.isSymLink())) ? "1" : "0")); IndexGenerator::getInstance()->creatAllIndex(&tempFile); - if ((fileInfo.fileName().split(".", QString::SkipEmptyParts).length() > 1) && (true == targetFileTypeMap[fileInfo.fileName().split(".").last()])){ + if((fileInfo.fileName().split(".", QString::SkipEmptyParts).length() > 1) && (true == targetFileTypeMap[fileInfo.fileName().split(".").last()])) { QQueue tmp; tmp.enqueue(fileInfo.absoluteFilePath()); IndexGenerator::getInstance()->creatAllIndex(&tmp); } } -bool InotifyIndex::AddWatch(const QString &path){ +bool InotifyIndex::AddWatch(const QString &path) { int ret = inotify_add_watch(m_fd, path.toStdString().c_str(), (IN_MOVED_FROM | IN_MOVED_TO | IN_CREATE | IN_DELETE | IN_MODIFY)); - if (ret == -1) { + if(ret == -1) { qDebug() << "AddWatch error:" << path; return false; } @@ -108,67 +106,63 @@ bool InotifyIndex::AddWatch(const QString &path){ return true; } -bool InotifyIndex::RemoveWatch(const QString &path, bool removeFromDatabase){ +bool InotifyIndex::RemoveWatch(const QString &path, bool removeFromDatabase) { int ret = inotify_rm_watch(m_fd, currentPath.key(path)); - if (ret){ + if(ret) { qDebug() << "remove path error"; return false; } // Q_ASSERT(ret == 0); assert(ret == 0); - if (removeFromDatabase) { - for (QMap::Iterator i = currentPath.begin(); i != currentPath.end();) { - // qDebug() << i.value(); - if (i.value().length() > path.length()){ - // if (i.value().mid(0, path.length()) == path){ - // if (path.startsWith(i.value())){ - if (i.value().startsWith(path)){ + if(removeFromDatabase) { + for(QMap::Iterator i = currentPath.begin(); i != currentPath.end();) { + // qDebug() << i.value(); + if(i.value().length() > path.length()) { + // if (i.value().mid(0, path.length()) == path){ + // if (path.startsWith(i.value())){ + if(i.value().startsWith(path)) { qDebug() << "remove path: " << i.value(); ret = inotify_rm_watch(m_fd, currentPath.key(path)); - if (ret){ + if(ret) { qDebug() << "remove path error"; - // return false; + // return false; } - // assert(ret == 0); + // assert(ret == 0); /*--------------------------------*/ //在此调用删除索引 qDebug() << i.value(); IndexGenerator::getInstance()->deleteAllIndex(new QStringList(i.value())); /*--------------------------------*/ currentPath.erase(i++); - // i++; - } - else{ + // i++; + } else { i++; } - } - else{ + } else { i++; } } } else { - for (QMap::Iterator i = currentPath.begin(); i != currentPath.end();) { - // qDebug() << i.value(); - if (i.value().length() > path.length()){ - // if (i.value().mid(0, path.length()) == path){ - // if (path.startsWith(i.value())){ - if (i.value().startsWith(path)){ + for(QMap::Iterator i = currentPath.begin(); i != currentPath.end();) { + // qDebug() << i.value(); + if(i.value().length() > path.length()) { + // if (i.value().mid(0, path.length()) == path){ + // if (path.startsWith(i.value())){ + if(i.value().startsWith(path)) { qDebug() << "remove path: " << i.value(); ret = inotify_rm_watch(m_fd, currentPath.key(path)); - if (ret){ + if(ret) { qDebug() << "remove path error"; - // return false; + // return false; } - // assert(ret == 0); + // assert(ret == 0); currentPath.erase(i++); - // i++; - } - else{ + // i++; + } else { i++; } - } - else{ + } else { i++; } } @@ -179,7 +173,7 @@ bool InotifyIndex::RemoveWatch(const QString &path, bool removeFromDatabase){ return true; } -void InotifyIndex::eventProcess(const char* buf, ssize_t tmp){ +void InotifyIndex::eventProcess(const char* buf, ssize_t tmp) { QQueue>* indexQueue = new QQueue>(); QQueue* contentIndexQueue = new QQueue(); @@ -187,27 +181,27 @@ void InotifyIndex::eventProcess(const char* buf, ssize_t tmp){ numRead = tmp; char * p = const_cast(buf); - for (; p < buf + numRead;) { + for(; p < buf + numRead;) { struct inotify_event * event = reinterpret_cast(p); qDebug() << "Read Event event->wd: " << event->wd; qDebug() << "Read Event: " << currentPath[event->wd] << QString(event->name) << event->cookie << event->wd << event->mask; - if(event->name[0] != '.'){ + if(event->name[0] != '.') { qDebug() << QString(currentPath[event->wd] + '/' + event->name); // switch (event->mask) { - if (event->mask & IN_CREATE){ + if(event->mask & IN_CREATE) { //Create top dir first, traverse it last. qDebug() << "IN_CREATE"; CREATE_FILE - if (event->mask & IN_ISDIR){ + if(event->mask & IN_ISDIR) { TRAVERSE_DIR } goto next; } - if ((event->mask & IN_DELETE) | (event->mask & IN_MOVED_FROM)){ + if((event->mask & IN_DELETE) | (event->mask & IN_MOVED_FROM)) { qDebug() << "IN_DELETE or IN_MOVED_FROM"; - if (event->mask & IN_ISDIR){ + if(event->mask & IN_ISDIR) { RemoveWatch(currentPath[event->wd] + '/' + event->name); } //delete once more @@ -215,24 +209,23 @@ void InotifyIndex::eventProcess(const char* buf, ssize_t tmp){ goto next; } - if (event->mask & IN_MODIFY){ + if(event->mask & IN_MODIFY) { qDebug() << "IN_MODIFY"; - if (!(event->mask & IN_ISDIR)){ + if(!(event->mask & IN_ISDIR)) { // IndexGenerator::getInstance()->deleteAllIndex(new QStringList(currentPath[event->wd] + '/' + event->name)); CREATE_FILE } goto next; } - if (event->mask & IN_MOVED_TO){ + if(event->mask & IN_MOVED_TO) { qDebug() << "IN_MOVED_TO"; - if (event->mask & IN_ISDIR){ + if(event->mask & IN_ISDIR) { RemoveWatch(currentPath[event->wd] + '/' + event->name); // IndexGenerator::getInstance()->deleteAllIndex(new QStringList(currentPath[event->wd] + '/' + event->name)); CREATE_FILE TRAVERSE_DIR - } - else { + } else { IndexGenerator::getInstance()->deleteAllIndex(new QStringList(currentPath[event->wd] + '/' + event->name)); CREATE_FILE } @@ -249,9 +242,9 @@ next: contentIndexQueue = nullptr; } -void InotifyIndex::run(){ +void InotifyIndex::run() { m_fd = inotify_init(); - qDebug() << "m_fd----------->" <" << m_fd; this->AddWatch(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); this->setPath(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); @@ -261,14 +254,12 @@ void InotifyIndex::run(){ char buffer[2]; memset(buffer, 0, sizeof(buffer)); fifo_fd = open(UKUI_SEARCH_PIPE_PATH, O_RDWR); - if(fifo_fd == -1) - { + if(fifo_fd == -1) { perror("open fifo error\n"); assert(false); } int retval = read(fifo_fd, buffer, sizeof(buffer)); - if(retval == -1) - { + if(retval == -1) { perror("read error\n"); assert(false); } @@ -276,7 +267,7 @@ void InotifyIndex::run(){ printf("read data ok\n"); close(fifo_fd); - if (buffer[0] & 0x1){ + if(buffer[0] & 0x1) { printf("data confirmed\n"); } unlink(UKUI_SEARCH_PIPE_PATH); @@ -285,12 +276,12 @@ void InotifyIndex::run(){ ssize_t numRead; - while (FileUtils::SearchMethod::INDEXSEARCH == FileUtils::searchMethod) { + while(FileUtils::SearchMethod::INDEXSEARCH == FileUtils::searchMethod) { // for (;;) { /* Read events forever */ memset(buf, 0x00, BUF_LEN); numRead = read(m_fd, buf, BUF_LEN); - if (numRead == -1){ + if(numRead == -1) { printf("\033[1;31;40mread event error\033[0m\n"); GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "1"); fflush(stdout); @@ -300,16 +291,16 @@ void InotifyIndex::run(){ char * tmp = const_cast(buf); - for (; tmp < buf + numRead;) { + for(; tmp < buf + numRead;) { struct inotify_event * event = reinterpret_cast(tmp); - // qDebug() << "Read Event: " << currentPath[event->wd] << QString(event->name) << event->cookie << event->wd << event->mask; - if(event->name[0] != '.'){ + // qDebug() << "Read Event: " << currentPath[event->wd] << QString(event->name) << event->cookie << event->wd << event->mask; + if(event->name[0] != '.') { GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "0"); break; } tmp += sizeof(struct inotify_event) + event->len; } - if (tmp >= buf + numRead) { + if(tmp >= buf + numRead) { continue; } @@ -317,14 +308,13 @@ void InotifyIndex::run(){ pid_t pid; pid = fork(); - if(pid == 0) - { + if(pid == 0) { prctl(PR_SET_PDEATHSIG, SIGTERM); - prctl(PR_SET_NAME,"inotify-index"); - if (numRead == 0) { + prctl(PR_SET_NAME, "inotify-index"); + if(numRead == 0) { qDebug() << "read() from inotify fd returned 0!"; } - if (numRead == -1) { + if(numRead == -1) { qDebug() << "read"; } eventProcess(buf, numRead); @@ -336,29 +326,27 @@ void InotifyIndex::run(){ read_timeout->tv_sec = 40; read_timeout->tv_usec = 0; - for(;;) - { + for(;;) { FD_ZERO(&read_fds); FD_SET(m_fd, &read_fds); qDebug() << read_timeout->tv_sec; rc = select(m_fd + 1, &read_fds, NULL, NULL, read_timeout); - if ( rc < 0 ) { + if(rc < 0) { // error qWarning() << "select result < 0, error!"; GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "1"); assert(false); - } - else if ( rc == 0 ) { + } else if(rc == 0) { qDebug() << "select timeout!"; ::free(read_timeout); IndexGenerator::getInstance()->~IndexGenerator(); // GlobalSettings::getInstance()->forceSync(); - ::_exit(0); - }else{ + ::_exit(0); + } else { GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "0"); memset(buf, 0x00, BUF_LEN); numRead = read(m_fd, buf, BUF_LEN); - if (numRead == -1){ + if(numRead == -1) { printf("\033[1;31;40mread event error\033[0m\n"); fflush(stdout); assert(false); @@ -368,18 +356,16 @@ void InotifyIndex::run(){ GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "2"); } } - } - else if (pid > 0){ + } else if(pid > 0) { memset(buf, 0x00, BUF_LEN); waitpid(pid, NULL, 0); --FileUtils::_index_status; - } - else{ + } else { assert(false); } } - if (FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) { + if(FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) { GlobalSettings::getInstance()->setValue(INOTIFY_NORMAL_EXIT, "3"); RemoveWatch(QStandardPaths::writableLocation(QStandardPaths::HomeLocation), false); } diff --git a/libsearch/index/inotify-index.h b/libsearch/index/inotify-index.h index d8c5227..ff44395 100644 --- a/libsearch/index/inotify-index.h +++ b/libsearch/index/inotify-index.h @@ -34,12 +34,11 @@ #define BUF_LEN 1024000 class InotifyIndex; static InotifyIndex* global_instance_of_index = nullptr; -class InotifyIndex : public QThread, public Traverse_BFS -{ +class InotifyIndex : public QThread, public Traverse_BFS { Q_OBJECT public: - static InotifyIndex* getInstance(const QString& path){ - if (!global_instance_of_index) { + static InotifyIndex* getInstance(const QString& path) { + if(!global_instance_of_index) { global_instance_of_index = new InotifyIndex(path); } return global_instance_of_index; diff --git a/libsearch/index/search-manager.cpp b/libsearch/index/search-manager.cpp index 5651039..a6ba44b 100644 --- a/libsearch/index/search-manager.cpp +++ b/libsearch/index/search-manager.cpp @@ -25,18 +25,15 @@ size_t SearchManager::uniqueSymbol3 = 0; QMutex SearchManager::m_mutex1; QMutex SearchManager::m_mutex2; QMutex SearchManager::m_mutex3; -SearchManager::SearchManager(QObject *parent) : QObject(parent) -{ +SearchManager::SearchManager(QObject *parent) : QObject(parent) { m_pool.setMaxThreadCount(2); m_pool.setExpiryTimeout(1000); } -SearchManager::~SearchManager() -{ +SearchManager::~SearchManager() { } -int SearchManager::getCurrentIndexCount() -{ +int SearchManager::getCurrentIndexCount() { try { Xapian::Database db(INDEX_PATH); return db.get_doccount(); @@ -46,9 +43,8 @@ int SearchManager::getCurrentIndexCount() } } -void SearchManager::onKeywordSearch(QString keyword,QQueue *searchResultFile,QQueue *searchResultDir, - QQueue> *searchResultContent) -{ +void SearchManager::onKeywordSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, + QQueue> *searchResultContent) { m_mutex1.lock(); ++uniqueSymbol1; m_mutex1.unlock(); @@ -59,21 +55,21 @@ void SearchManager::onKeywordSearch(QString keyword,QQueue *searchResul ++uniqueSymbol3; m_mutex3.unlock(); - if (FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) { + if(FileUtils::SearchMethod::DIRECTSEARCH == FileUtils::searchMethod) { DirectSearch *directSearch; directSearch = new DirectSearch(keyword, searchResultFile, searchResultDir, uniqueSymbol1); m_pool.start(directSearch); - } else if (FileUtils::SearchMethod::INDEXSEARCH == FileUtils::searchMethod) { + } else if(FileUtils::SearchMethod::INDEXSEARCH == FileUtils::searchMethod) { FileSearch *filesearch; - filesearch = new FileSearch(searchResultFile,uniqueSymbol1,keyword,"0",1,0,5); + filesearch = new FileSearch(searchResultFile, uniqueSymbol1, keyword, "0", 1, 0, 5); m_pool.start(filesearch); FileSearch *dirsearch; - dirsearch = new FileSearch(searchResultDir,uniqueSymbol2,keyword,"1",1,0,5); + dirsearch = new FileSearch(searchResultDir, uniqueSymbol2, keyword, "1", 1, 0, 5); m_pool.start(dirsearch); FileContentSearch *contentSearch; - contentSearch = new FileContentSearch(searchResultContent,uniqueSymbol3,keyword,0,5); + contentSearch = new FileContentSearch(searchResultContent, uniqueSymbol3, keyword, 0, 5); m_pool.start(contentSearch); } else { qWarning() << "Unknown search method! FileUtils::searchMethod: " << static_cast(FileUtils::searchMethod); @@ -81,11 +77,9 @@ void SearchManager::onKeywordSearch(QString keyword,QQueue *searchResul return; } -bool SearchManager::isBlocked(QString &path) -{ +bool SearchManager::isBlocked(QString &path) { QStringList blockList = GlobalSettings::getInstance()->getBlockDirs(); - for(QString i : blockList) - { + for(QString i : blockList) { if(path.startsWith(i.prepend("/"))) return true; } @@ -93,8 +87,7 @@ bool SearchManager::isBlocked(QString &path) } -FileSearch::FileSearch(QQueue *searchResult,size_t uniqueSymbol, QString keyword, QString value, unsigned slot, int begin, int num) -{ +FileSearch::FileSearch(QQueue *searchResult, size_t uniqueSymbol, QString keyword, QString value, unsigned slot, int begin, int num) { this->setAutoDelete(true); m_search_result = searchResult; m_uniqueSymbol = uniqueSymbol; @@ -105,21 +98,19 @@ FileSearch::FileSearch(QQueue *searchResult,size_t uniqueSymbol, QStrin m_num = num; } -FileSearch::~FileSearch() -{ +FileSearch::~FileSearch() { m_search_result = nullptr; } -void FileSearch::run() -{ - if (!m_search_result->isEmpty()){ +void FileSearch::run() { + if(!m_search_result->isEmpty()) { m_search_result->clear(); } int resultCount = 0; int total = 0; - while (total < 100) { + while(total < 100) { resultCount = keywordSearchfile(); - if (resultCount == 0 || resultCount == -1) + if(resultCount == 0 || resultCount == -1) break; total += resultCount; m_begin += m_num; @@ -127,8 +118,7 @@ void FileSearch::run() return; } -int FileSearch::keywordSearchfile() -{ +int FileSearch::keywordSearchfile() { try { qDebug() << "--keywordSearchfile start--"; Xapian::Database db(INDEX_PATH); @@ -136,49 +126,47 @@ int FileSearch::keywordSearchfile() Xapian::Enquire enquire(db); Xapian::Query queryFile; - if (!m_value.isEmpty()) { + if(!m_value.isEmpty()) { std::string slotValue = m_value.toStdString(); - Xapian::Query queryValue = Xapian::Query(Xapian::Query::OP_VALUE_RANGE,m_slot,slotValue,slotValue); - queryFile = Xapian::Query(Xapian::Query::OP_AND,query,queryValue); + Xapian::Query queryValue = Xapian::Query(Xapian::Query::OP_VALUE_RANGE, m_slot, slotValue, slotValue); + queryFile = Xapian::Query(Xapian::Query::OP_AND, query, queryValue); } else { queryFile = query; } - qDebug() << "keywordSearchfile:"< v; - for (int i=0;iappend(QString::fromStdString(data)); - qDebug()<enqueue(path); SearchManager::m_mutex1.unlock(); } else { @@ -230,8 +218,7 @@ int FileSearch::getResult(Xapian::MSet &result) return 0; } -FileContentSearch::FileContentSearch(QQueue> *searchResult, size_t uniqueSymbol, QString keyword, int begin, int num) -{ +FileContentSearch::FileContentSearch(QQueue> *searchResult, size_t uniqueSymbol, QString keyword, int begin, int num) { this->setAutoDelete(true); m_search_result = searchResult; m_uniqueSymbol = uniqueSymbol; @@ -240,22 +227,20 @@ FileContentSearch::FileContentSearch(QQueue> *searchR m_num = num; } -FileContentSearch::~FileContentSearch() -{ +FileContentSearch::~FileContentSearch() { m_search_result = nullptr; } -void FileContentSearch::run() -{ - if (!m_search_result->isEmpty()) { +void FileContentSearch::run() { + if(!m_search_result->isEmpty()) { m_search_result->clear(); } int resultCount = 0; int total = 0; - while (total<50) { + while(total < 50) { resultCount = keywordSearchContent(); - if (resultCount == 0 || resultCount == -1) { + if(resultCount == 0 || resultCount == -1) { break; } total += resultCount; @@ -264,34 +249,33 @@ void FileContentSearch::run() return; } -int FileContentSearch::keywordSearchContent() -{ +int FileContentSearch::keywordSearchContent() { try { - qDebug()<<"--keywordSearchContent search start--"; + qDebug() << "--keywordSearchContent search start--"; Xapian::Database db(CONTENT_INDEX_PATH); Xapian::Enquire enquire(db); Xapian::QueryParser qp; qp.set_default_op(Xapian::Query::OP_AND); qp.set_database(db); -/* - ::friso::ResultMap ret; - ::friso::FrisoSegmentation::getInstance()->callSegement(ret, keyword.toLocal8Bit().data()); - for (::friso::ResultMap::iterator it_map = ret.begin(); it_map != ret.end(); ++it_map){ - target_str += it_map->first; - target_str += " "; - it_map->second.first.clear(); - ::std::vector().swap(it_map->second.first); - } + /* + ::friso::ResultMap ret; + ::friso::FrisoSegmentation::getInstance()->callSegement(ret, keyword.toLocal8Bit().data()); + for (::friso::ResultMap::iterator it_map = ret.begin(); it_map != ret.end(); ++it_map){ + target_str += it_map->first; + target_str += " "; + it_map->second.first.clear(); + ::std::vector().swap(it_map->second.first); + } - ret.clear(); - ret.erase(ret.begin(), ret.end()); - ::friso::ResultMap().swap(ret); -*/ + ret.clear(); + ret.erase(ret.begin(), ret.end()); + ::friso::ResultMap().swap(ret); + */ QVector sKeyWord = ChineseSegmentation::getInstance()->callSegement(m_keyword); //Creat a query std::string words; - for (int i=0; iappend(QString::fromStdString(data)); qDebug() << path << "is not exist!!"; continue; @@ -367,15 +350,15 @@ int FileContentSearch::getResult(Xapian::MSet &result, std::string &keyWord) // snippets.append(QString::fromStdString( result.snippet(doc.get_data(),400))); // qWarning()< 6 + QString::fromStdString(keyWord).size()){ - snippet.replace(0,3,"...").replace(snippet.size()-3,3,"..."); + if(snippet.size() > 6 + QString::fromStdString(keyWord).size()) { + snippet.replace(0, 3, "...").replace(snippet.size() - 3, 3, "..."); } else { snippet.append("...").prepend("..."); } @@ -402,8 +385,8 @@ int FileContentSearch::getResult(Xapian::MSet &result, std::string &keyWord) // } SearchManager::m_mutex3.lock(); - if (m_uniqueSymbol == SearchManager::uniqueSymbol3) { - m_search_result->enqueue(qMakePair(path,snippets)); + if(m_uniqueSymbol == SearchManager::uniqueSymbol3) { + m_search_result->enqueue(qMakePair(path, snippets)); SearchManager::m_mutex3.unlock(); snippets.clear(); QStringList().swap(snippets); @@ -419,8 +402,7 @@ int FileContentSearch::getResult(Xapian::MSet &result, std::string &keyWord) return 0; } -DirectSearch::DirectSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, size_t uniqueSymbol) -{ +DirectSearch::DirectSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, size_t uniqueSymbol) { this->setAutoDelete(true); m_keyword = keyword; m_searchResultFile = searchResultFile; @@ -428,8 +410,7 @@ DirectSearch::DirectSearch(QString keyword, QQueue *searchResultFile, Q m_uniqueSymbol = uniqueSymbol; } -void DirectSearch::run() -{ +void DirectSearch::run() { QQueue bfs; bfs.enqueue(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); QFileInfoList list; @@ -437,25 +418,25 @@ void DirectSearch::run() // QDir::Hidden dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); dir.setSorting(QDir::DirsFirst); - while (!bfs.empty()) { + while(!bfs.empty()) { dir.setPath(bfs.dequeue()); list = dir.entryInfoList(); - for (auto i : list) { - if (i.isDir() && (!(i.isSymLink()))) { + for(auto i : list) { + if(i.isDir() && (!(i.isSymLink()))) { bfs.enqueue(i.absoluteFilePath()); } - if (i.fileName().contains(m_keyword, Qt::CaseInsensitive)) { + if(i.fileName().contains(m_keyword, Qt::CaseInsensitive)) { SearchManager::m_mutex1.lock(); // qWarning() << i.fileName() << m_keyword; - if (m_uniqueSymbol == SearchManager::uniqueSymbol1) { + if(m_uniqueSymbol == SearchManager::uniqueSymbol1) { // TODO - if (i.isDir() && m_searchResultDir->length() < 51) { + if(i.isDir() && m_searchResultDir->length() < 51) { m_searchResultDir->enqueue(i.absoluteFilePath()); - } else if (m_searchResultFile->length() < 51) { + } else if(m_searchResultFile->length() < 51) { m_searchResultFile->enqueue(i.absoluteFilePath()); } SearchManager::m_mutex1.unlock(); - if (m_searchResultDir->length() > 49 && m_searchResultFile->length() > 49) { + if(m_searchResultDir->length() > 49 && m_searchResultFile->length() > 49) { return; } } else { diff --git a/libsearch/index/search-manager.h b/libsearch/index/search-manager.h index 04f3ee7..04fee83 100644 --- a/libsearch/index/search-manager.h +++ b/libsearch/index/search-manager.h @@ -46,8 +46,7 @@ #define CONTENT_INDEX_PATH (QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+"/.config/org.ukui/ukui-search/content_index_data").toStdString() -class SearchManager : public QObject -{ +class SearchManager : public QObject { friend class FileSearch; friend class FileContentSearch; Q_OBJECT @@ -65,12 +64,12 @@ public: static QMutex m_mutex3; public Q_SLOTS: - void onKeywordSearch(QString keyword,QQueue *searchResultFile,QQueue *searchResultDir,QQueue> *searchResultContent); + void onKeywordSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, QQueue> *searchResultContent); Q_SIGNALS: void resultFile(QQueue *); void resultDir(QQueue *); - void resultContent(QQueue> *); + void resultContent(QQueue> *); private: // int keywordSearchfile(size_t uniqueSymbol, QString keyword, QString value,unsigned slot = 1,int begin = 0, int num = 20); // int keywordSearchContent(size_t uniqueSymbol, QString keyword, int begin = 0, int num = 20); @@ -96,10 +95,9 @@ private: QThreadPool m_pool; }; -class FileSearch : public QRunnable -{ +class FileSearch : public QRunnable { public: - explicit FileSearch(QQueue *searchResult,size_t uniqueSymbol, QString keyword, QString value,unsigned slot = 1,int begin = 0, int num = 20); + explicit FileSearch(QQueue *searchResult, size_t uniqueSymbol, QString keyword, QString value, unsigned slot = 1, int begin = 0, int num = 20); ~FileSearch(); protected: void run(); @@ -117,26 +115,24 @@ private: int m_num = 20; }; -class FileContentSearch : public QRunnable -{ +class FileContentSearch : public QRunnable { public: - explicit FileContentSearch(QQueue> *searchResult,size_t uniqueSymbol, QString keyword, int begin = 0, int num = 20); + explicit FileContentSearch(QQueue> *searchResult, size_t uniqueSymbol, QString keyword, int begin = 0, int num = 20); ~FileContentSearch(); protected: void run(); private: int keywordSearchContent(); - int getResult(Xapian::MSet &result,std::string &keyWord); + int getResult(Xapian::MSet &result, std::string &keyWord); - QQueue> *m_search_result = nullptr; + QQueue> *m_search_result = nullptr; size_t m_uniqueSymbol; QString m_keyword; int m_begin = 0; int m_num = 20; }; -class DirectSearch : public QRunnable -{ +class DirectSearch : public QRunnable { public: explicit DirectSearch(QString keyword, QQueue *searchResultFile, QQueue *searchResultDir, size_t uniqueSymbol); protected: diff --git a/libsearch/index/searchmethodmanager.cpp b/libsearch/index/searchmethodmanager.cpp index 8e35d43..1024fe5 100644 --- a/libsearch/index/searchmethodmanager.cpp +++ b/libsearch/index/searchmethodmanager.cpp @@ -1,15 +1,14 @@ #include "searchmethodmanager.h" -void SearchMethodManager::searchMethod(FileUtils::SearchMethod sm) -{ +void SearchMethodManager::searchMethod(FileUtils::SearchMethod sm) { qWarning() << "searchMethod start: " << static_cast(sm); - if (FileUtils::SearchMethod::INDEXSEARCH == sm || FileUtils::SearchMethod::DIRECTSEARCH == sm) { + if(FileUtils::SearchMethod::INDEXSEARCH == sm || FileUtils::SearchMethod::DIRECTSEARCH == sm) { FileUtils::searchMethod = sm; } else { printf("enum class error!!!\n"); qWarning("enum class error!!!\n"); } - if (FileUtils::SearchMethod::INDEXSEARCH == sm && 0 == FileUtils::_index_status) { + if(FileUtils::SearchMethod::INDEXSEARCH == sm && 0 == FileUtils::_index_status) { qWarning() << "start first index"; // m_fi = FirstIndex("/home/zhangzihao/Desktop"); m_fi.start(); @@ -17,10 +16,10 @@ void SearchMethodManager::searchMethod(FileUtils::SearchMethod sm) // InotifyIndex ii("/home"); // ii.start(); this->m_ii = InotifyIndex::getInstance("/home"); - if (!this->m_ii->isRunning()) { + if(!this->m_ii->isRunning()) { this->m_ii->start(); } - qDebug()<<"Search method has been set to INDEXSEARCH"; + qDebug() << "Search method has been set to INDEXSEARCH"; } qWarning() << "searchMethod end: " << static_cast(FileUtils::searchMethod); } diff --git a/libsearch/index/searchmethodmanager.h b/libsearch/index/searchmethodmanager.h index ec6267a..76bb0ae 100644 --- a/libsearch/index/searchmethodmanager.h +++ b/libsearch/index/searchmethodmanager.h @@ -4,8 +4,7 @@ #include "first-index.h" #include "inotify-index.h" -class SearchMethodManager -{ +class SearchMethodManager { public: SearchMethodManager() = default; void searchMethod(FileUtils::SearchMethod sm); diff --git a/libsearch/index/traverse_bfs.cpp b/libsearch/index/traverse_bfs.cpp index bf0cb71..8a5e04f 100644 --- a/libsearch/index/traverse_bfs.cpp +++ b/libsearch/index/traverse_bfs.cpp @@ -19,13 +19,12 @@ */ #include "traverse_bfs.h" -Traverse_BFS::Traverse_BFS(const QString& path) -{ +Traverse_BFS::Traverse_BFS(const QString& path) { Q_ASSERT('/' == path.at(0)); this->path = path; } -void Traverse_BFS::Traverse(){ +void Traverse_BFS::Traverse() { QQueue bfs; bfs.enqueue(this->path); QFileInfoList list; @@ -33,11 +32,11 @@ void Traverse_BFS::Traverse(){ // QDir::Hidden dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); dir.setSorting(QDir::DirsFirst); - while (!bfs.empty()) { + while(!bfs.empty()) { dir.setPath(bfs.dequeue()); list = dir.entryInfoList(); - for (auto i : list){ - if (i.isDir() && (!(i.isSymLink()))){ + for(auto i : list) { + if(i.isDir() && (!(i.isSymLink()))) { bfs.enqueue(i.absoluteFilePath()); } DoSomething(i); @@ -45,6 +44,6 @@ void Traverse_BFS::Traverse(){ } } -void Traverse_BFS::setPath(const QString& path){ +void Traverse_BFS::setPath(const QString& path) { this->path = path; } diff --git a/libsearch/index/traverse_bfs.h b/libsearch/index/traverse_bfs.h index d8a4e1d..e056046 100644 --- a/libsearch/index/traverse_bfs.h +++ b/libsearch/index/traverse_bfs.h @@ -25,8 +25,7 @@ #include #include -class Traverse_BFS -{ +class Traverse_BFS { public: Traverse_BFS() = default; void Traverse(); diff --git a/libsearch/index/ukui-search-qdbus.cpp b/libsearch/index/ukui-search-qdbus.cpp index ce39f37..aee407f 100644 --- a/libsearch/index/ukui-search-qdbus.cpp +++ b/libsearch/index/ukui-search-qdbus.cpp @@ -20,25 +20,23 @@ #include "ukui-search-qdbus.h" #include -UkuiSearchQDBus::UkuiSearchQDBus() -{ +UkuiSearchQDBus::UkuiSearchQDBus() { this->tmpSystemQDBusInterface = new QDBusInterface("com.ukui.search.qt.systemdbus", - "/", - "com.ukui.search.interface", - QDBusConnection::systemBus()); - if (!tmpSystemQDBusInterface->isValid()){ + "/", + "com.ukui.search.interface", + QDBusConnection::systemBus()); + if(!tmpSystemQDBusInterface->isValid()) { qCritical() << "Create Client Interface Failed When execute chage: " << QDBusConnection::systemBus().lastError(); return; } } -UkuiSearchQDBus::~UkuiSearchQDBus(){ +UkuiSearchQDBus::~UkuiSearchQDBus() { delete this->tmpSystemQDBusInterface; this->tmpSystemQDBusInterface = nullptr; } //一键三连 -void UkuiSearchQDBus::setInotifyMaxUserWatches() -{ +void UkuiSearchQDBus::setInotifyMaxUserWatches() { // /proc/sys/fs/inotify/max_user_watches this->tmpSystemQDBusInterface->call("setInotifyMaxUserWatchesStep1"); // sysctl diff --git a/libsearch/index/ukui-search-qdbus.h b/libsearch/index/ukui-search-qdbus.h index 39e2600..9c6d011 100644 --- a/libsearch/index/ukui-search-qdbus.h +++ b/libsearch/index/ukui-search-qdbus.h @@ -22,8 +22,7 @@ #include -class UkuiSearchQDBus -{ +class UkuiSearchQDBus { public: UkuiSearchQDBus(); ~UkuiSearchQDBus(); diff --git a/libsearch/libsearch.h b/libsearch/libsearch.h index f0217ab..bd6ab87 100644 --- a/libsearch/libsearch.h +++ b/libsearch/libsearch.h @@ -32,8 +32,7 @@ #include "index/inotify-index.h" #include "index/search-manager.h" -class LIBSEARCH_EXPORT GlobalSearch -{ +class LIBSEARCH_EXPORT GlobalSearch { public: static QStringList fileSearch(QString keyword, int begin = 0, int num = -1); diff --git a/libsearch/parser/binary-parser.cpp b/libsearch/parser/binary-parser.cpp index f6f29c8..698297a 100644 --- a/libsearch/parser/binary-parser.cpp +++ b/libsearch/parser/binary-parser.cpp @@ -17,3398 +17,3398 @@ using namespace std; static QDateTime DtFlag1; struct Properties { - ushort category : 8; /* 5 needed */ - ushort line_break_class : 8; /* 6 needed */ - ushort direction : 8; /* 5 needed */ - ushort combiningClass : 8; - ushort joining : 2; - signed short digitValue : 6; /* 5 needed */ - ushort unicodeVersion : 4; - ushort lowerCaseSpecial : 1; - ushort upperCaseSpecial : 1; - ushort titleCaseSpecial : 1; - ushort caseFoldSpecial : 1; /* currently unused */ - signed short mirrorDiff : 16; - signed short lowerCaseDiff : 16; - signed short upperCaseDiff : 16; - signed short titleCaseDiff : 16; - signed short caseFoldDiff : 16; - ushort graphemeBreak : 8; /* 4 needed */ - ushort wordBreak : 8; /* 4 needed */ - ushort sentenceBreak : 8; /* 4 needed */ + ushort category : 8; /* 5 needed */ + ushort line_break_class : 8; /* 6 needed */ + ushort direction : 8; /* 5 needed */ + ushort combiningClass : 8; + ushort joining : 2; + signed short digitValue : 6; /* 5 needed */ + ushort unicodeVersion : 4; + ushort lowerCaseSpecial : 1; + ushort upperCaseSpecial : 1; + ushort titleCaseSpecial : 1; + ushort caseFoldSpecial : 1; /* currently unused */ + signed short mirrorDiff : 16; + signed short lowerCaseDiff : 16; + signed short upperCaseDiff : 16; + signed short titleCaseDiff : 16; + signed short caseFoldDiff : 16; + ushort graphemeBreak : 8; /* 4 needed */ + ushort wordBreak : 8; /* 4 needed */ + ushort sentenceBreak : 8; /* 4 needed */ }; static const unsigned short uc_property_trie[] = { - // 0 - 0x11000 - - 6256, 6288, 6320, 6352, 6384, 6416, 6448, 6480, - 6512, 6544, 6576, 6608, 6640, 6672, 6704, 6736, - 6768, 6800, 6832, 6864, 6896, 6928, 6960, 6992, - 7024, 7056, 7088, 7120, 7152, 7184, 7216, 7248, - 7280, 7312, 7344, 6512, 7376, 6512, 7408, 7440, - 7472, 7504, 7536, 7568, 7600, 7632, 7664, 7696, - 7728, 7760, 7792, 7824, 7856, 7888, 7920, 7952, - 7984, 8016, 8048, 8080, 8112, 8144, 8176, 8208, - 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - 8272, 8304, 8336, 8368, 8400, 8432, 8464, 8496, - 8528, 8560, 8592, 8624, 8656, 8688, 8720, 8752, - 8400, 8784, 8816, 8848, 8880, 8912, 8944, 8976, - 9008, 9040, 9072, 9104, 9136, 9168, 9200, 9232, - 9136, 9264, 9296, 9104, 9328, 9360, 9392, 9424, - 9456, 9488, 9520, 9552, 9584, 9616, 9648, 9552, - 9680, 9712, 9744, 9776, 9808, 9840, 9872, 9552, - - 9904, 9936, 9968, 9552, 9552, 10000, 10032, 10064, - 10096, 10096, 10128, 10160, 10160, 10192, 10224, 10256, - 10288, 10320, 10352, 10320, 10384, 10416, 10448, 10480, - 10512, 10320, 10544, 10576, 10608, 10320, 10320, 10640, - 10672, 10320, 10320, 10320, 10320, 10320, 10320, 10320, - 10320, 10320, 10320, 10320, 10320, 10320, 10320, 10320, - 10320, 10320, 10320, 10704, 10736, 10320, 10320, 10768, - 10800, 10832, 10864, 10896, 9904, 10928, 10960, 10992, - 11024, 10320, 11056, 11088, 10320, 11120, 9552, 9552, - 11152, 11184, 11216, 11248, 11280, 11312, 11344, 11376, - 11408, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 11440, 11472, 11504, 11536, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 11568, 11600, 11632, 11664, 11696, 11728, 11760, 11792, - 6512, 6512, 6512, 6512, 11824, 6512, 6512, 11856, - 11888, 11920, 11952, 11984, 12016, 12048, 12080, 12112, - - 12144, 12176, 12208, 12240, 12272, 12304, 12336, 12368, - 12400, 12432, 12464, 12496, 12528, 12560, 12592, 12624, - 12656, 12688, 12720, 12752, 12784, 12816, 12848, 12880, - 12912, 12944, 12976, 13008, 13040, 13072, 13104, 13136, - 13168, 13200, 13232, 13264, 13296, 13328, 13360, 13392, - 13168, 13168, 13168, 13168, 13424, 13456, 13488, 13520, - 13552, 13168, 13168, 13584, 13616, 13648, 9552, 9552, - 13680, 13712, 13744, 13776, 13808, 13840, 13872, 13904, - 13936, 13936, 13936, 13936, 13936, 13936, 13936, 13936, - 13968, 13968, 13968, 13968, 14000, 14032, 14064, 14096, - 13968, 14128, 13968, 14160, 14192, 14224, 14256, 14288, - 14320, 14352, 9552, 9552, 9552, 9552, 9552, 9552, - 14384, 14416, 14448, 14480, 14512, 14512, 14512, 14544, - 14576, 14608, 14640, 14672, 14704, 14736, 14736, 9552, - 14768, 9552, 9552, 9552, 14800, 14832, 14832, 14864, - 14832, 14832, 14832, 14832, 14832, 14832, 14896, 14928, - - 14960, 14992, 15024, 15056, 15088, 15120, 15152, 15184, - 15216, 15248, 15280, 15280, 15312, 15344, 15376, 15408, - 15440, 15472, 15504, 15536, 15472, 15568, 15600, 15632, - 15664, 15664, 15664, 15696, 15664, 15664, 15728, 15760, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, - 15792, 15792, 15792, 15792, 15792, 15824, 11376, 11376, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 15856, 15856, 15856, 15856, 15888, 9552, 9552, - - 15920, 15952, 15952, 15952, 15952, 15952, 15952, 15952, - 15952, 15952, 15952, 15952, 15952, 15952, 15952, 15952, - 15952, 15952, 15952, 15952, 15952, 15952, 15952, 15952, - 15952, 15952, 15952, 15952, 15952, 15952, 15952, 15952, - 15952, 15952, 15952, 15952, 15984, 16016, 16048, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 16080, 16112, 9552, 9552, 9552, 9552, 9552, 9552, - 16144, 16176, 16208, 16240, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, - 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, - 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, - - 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, - 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, - 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, - 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, - 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, - 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, - 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, - 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, - 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, - 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, - 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, - 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, - - 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, - 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, - 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, - 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, - 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, - 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, - 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, - 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, - 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, - 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, - 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - - 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, - 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, - 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, - 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, - 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, - 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, - 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, - 16304, 16336, 16368, 16400, 16432, 16496, 9552, 9552, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, - - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, - 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, - 15856, 16592, 16624, 16656, 16688, 16688, 16720, 9552, - 16752, 16784, 16816, 16848, 16848, 16880, 16912, 16848, - 16848, 16848, 16848, 16848, 16848, 16848, 16848, 16848, - 16848, 16944, 16976, 16848, 17008, 16848, 17040, 17072, - 17104, 17136, 17168, 17200, 16848, 16848, 16848, 17232, - 17264, 17296, 17328, 17360, 17392, 17424, 17456, 17488, - - 17520, 17552, 17584, 9552, 17616, 17616, 17616, 17648, - 17680, 17712, 17744, 17776, 17808, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 17840, 17872, 17904, 9552, 17936, 14640, 17968, 9552, - 18000, 18032, 18064, 17616, 18096, 18128, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, - 18160, 18192, 8240, 8240, 8240, 8240, 8240, 8240, - 18224, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - 18256, 18288, 18320, 8240, 8240, 8240, 8240, 8240, - 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, - - // 0x11000 - 0x110000 - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18608, 18608, 18608, 18864, 19120, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 19376, 19632, 19888, 20144, 20400, 20656, 20912, 21168, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, - 21680, 21680, 21680, 21680, 21680, 21680, 21936, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 21680, 21680, 22192, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 22448, 22704, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, - 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 23216, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, - 22960, 22960, 22960, 22960, 22960, 22960, 22960, 23216, - - - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 2, 3, 4, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6, 6, 6, 7, - - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 14, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 9, - - 14, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 39, 40, 41, 42, 43, - - 42, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 39, 45, 41, 36, 0, - - 0, 0, 0, 0, 0, 46, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - - 47, 14, 48, 12, 12, 12, 49, 49, - 42, 49, 50, 51, 36, 52, 49, 42, - 53, 54, 55, 56, 57, 58, 49, 59, - 42, 60, 50, 61, 62, 62, 62, 14, - - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 36, - 38, 38, 38, 38, 38, 38, 38, 63, - - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 36, - 44, 44, 44, 44, 44, 44, 44, 64, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 67, 68, 65, 66, 65, 66, 65, 66, - 50, 65, 66, 65, 66, 65, 66, 65, - - 66, 65, 66, 65, 66, 65, 66, 65, - 66, 69, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 70, 65, 66, 65, 66, 65, 66, 71, - - 72, 73, 65, 66, 65, 66, 74, 65, - 66, 75, 75, 65, 66, 50, 76, 77, - 78, 65, 66, 75, 79, 80, 81, 82, - 65, 66, 83, 50, 81, 84, 85, 86, - - 65, 66, 65, 66, 65, 66, 87, 65, - 66, 87, 50, 50, 65, 66, 87, 65, - 66, 88, 88, 65, 66, 65, 66, 89, - 65, 66, 50, 90, 65, 66, 50, 91, - - 90, 90, 90, 90, 92, 93, 94, 92, - 93, 94, 92, 93, 94, 65, 66, 65, - 66, 65, 66, 65, 66, 65, 66, 65, - 66, 65, 66, 65, 66, 95, 65, 66, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 96, 92, 93, 94, 65, 66, 97, 98, - 99, 100, 65, 66, 65, 66, 65, 66, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 99, 100, 99, 100, 99, 100, 99, 100, - - 101, 102, 99, 100, 99, 100, 99, 100, - 99, 100, 99, 100, 99, 100, 99, 100, - 99, 100, 99, 100, 102, 102, 102, 103, - 103, 103, 104, 105, 106, 107, 108, 103, - - 103, 105, 109, 110, 111, 112, 113, 109, - 113, 109, 113, 109, 113, 109, 113, 109, - 50, 50, 50, 114, 115, 50, 116, 116, - 50, 117, 50, 118, 50, 50, 50, 50, - - 116, 50, 50, 119, 50, 50, 50, 50, - 120, 121, 50, 122, 50, 50, 50, 121, - 50, 50, 123, 50, 50, 124, 50, 50, - 50, 50, 50, 50, 50, 125, 50, 50, - - 126, 50, 50, 126, 50, 50, 50, 50, - 126, 127, 128, 128, 129, 50, 50, 50, - 50, 50, 130, 50, 90, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, - - 50, 50, 50, 50, 50, 50, 50, 50, - 50, 131, 131, 131, 131, 131, 102, 102, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 133, 133, 134, 134, 134, 134, 134, - - 132, 132, 42, 42, 42, 42, 133, 133, - 135, 133, 133, 133, 135, 133, 133, 133, - 134, 134, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 136, - - 132, 132, 132, 132, 132, 42, 42, 42, - 42, 42, 136, 136, 136, 136, 137, 138, - 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, - - 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 140, 141, 141, - 141, 141, 140, 142, 141, 141, 141, 141, - - 141, 143, 143, 141, 141, 141, 141, 143, - 143, 141, 141, 141, 141, 141, 141, 141, - 141, 141, 141, 141, 144, 144, 144, 144, - 144, 141, 141, 141, 141, 139, 139, 139, - - 139, 139, 139, 139, 139, 145, 146, 147, - 147, 147, 146, 146, 146, 147, 147, 148, - 149, 149, 149, 150, 150, 150, 150, 149, - 151, 152, 152, 153, 154, 155, 155, 156, - - 157, 157, 158, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, - 160, 160, 160, 160, 42, 42, 160, 160, - 160, 160, 132, 161, 161, 161, 34, 160, - - 160, 160, 160, 160, 42, 42, 162, 14, - 163, 163, 163, 160, 164, 160, 165, 165, - 166, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, - - 38, 38, 160, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 167, 168, 168, 168, - 169, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - - 44, 44, 170, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 171, 172, 172, 160, - 173, 174, 175, 175, 175, 176, 177, 131, - 178, 179, 65, 100, 65, 100, 65, 100, - - 65, 100, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 180, 181, 182, 50, 183, 184, 185, 186, - 187, 188, 186, 187, 103, 189, 189, 189, - - 190, 191, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 190, 191, 191, - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, - - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - - 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, - 192, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 192, 193, 193, - - 65, 66, 194, 139, 139, 139, 139, 160, - 195, 195, 178, 179, 99, 100, 99, 100, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - - 196, 65, 66, 65, 66, 178, 179, 65, - 66, 178, 179, 65, 66, 178, 179, 197, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 99, 100, 65, 66, - 65, 66, 65, 66, 65, 66, 105, 106, - 65, 66, 113, 109, 113, 109, 113, 109, - - 178, 179, 178, 179, 178, 179, 178, 179, - 178, 179, 178, 179, 178, 179, 178, 179, - 113, 109, 113, 109, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, - - 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 160, - 160, 134, 199, 199, 200, 199, 200, 199, - - 160, 201, 201, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 201, 201, 201, 201, - - 201, 201, 201, 201, 201, 201, 201, 202, - 160, 203, 204, 160, 160, 160, 160, 160, - 205, 206, 207, 207, 207, 207, 206, 207, - 207, 207, 208, 206, 207, 207, 207, 207, - - 207, 207, 152, 206, 206, 206, 206, 206, - 207, 207, 206, 207, 207, 208, 209, 207, - 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, - - 226, 227, 228, 226, 207, 152, 229, 230, - 205, 205, 205, 205, 205, 205, 205, 205, - 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, - - 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 205, 205, 205, 205, 205, - 231, 231, 231, 232, 233, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, - - 234, 234, 234, 234, 235, 235, 235, 235, - 235, 235, 235, 236, 237, 238, 239, 239, - 149, 149, 149, 149, 149, 149, 235, 235, - 235, 235, 235, 240, 235, 235, 241, 242, - - 235, 243, 244, 244, 244, 244, 245, 244, - 245, 244, 245, 245, 245, 245, 245, 244, - 244, 244, 244, 245, 245, 245, 245, 245, - 245, 245, 245, 235, 235, 235, 235, 235, - - 246, 245, 245, 245, 245, 245, 245, 245, - 244, 245, 245, 247, 248, 249, 250, 251, - 252, 253, 254, 146, 146, 147, 150, 149, - 149, 153, 153, 153, 152, 153, 153, 235, - - 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 266, 267, 268, 268, - 269, 244, 244, 244, 243, 244, 244, 244, - 245, 245, 245, 245, 245, 245, 245, 245, - - 245, 245, 245, 245, 245, 245, 245, 245, - 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 244, - 244, 244, 245, 245, 245, 245, 245, 245, - - 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, - 270, 270, 245, 245, 245, 245, 245, 270, - - 244, 245, 245, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 245, 244, 245, 271, - 245, 245, 244, 244, 242, 244, 139, 139, - 139, 139, 139, 139, 139, 272, 273, 139, - - 139, 139, 139, 141, 139, 274, 274, 139, - 139, 49, 141, 139, 139, 141, 275, 275, - 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 270, 270, 270, 276, 276, 277, - - 278, 278, 278, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 235, 280, - 271, 281, 270, 270, 270, 271, 271, 271, - 271, 271, 270, 270, 270, 270, 271, 270, - - 270, 270, 270, 270, 270, 270, 270, 270, - 271, 270, 271, 270, 271, 277, 277, 275, - 146, 147, 146, 146, 147, 146, 146, 147, - 147, 147, 146, 147, 147, 146, 147, 146, - - 146, 146, 147, 146, 147, 146, 147, 146, - 147, 146, 146, 235, 235, 275, 277, 277, - 282, 282, 282, 282, 282, 282, 282, 282, - 282, 283, 283, 283, 282, 282, 282, 282, - - 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 283, 283, 282, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, - - 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, - - 284, 284, 284, 284, 284, 284, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, - 285, 286, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, - - 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 297, 297, 297, 297, 297, - 297, 297, 297, 297, 297, 297, 297, 297, - 297, 297, 297, 297, 297, 297, 297, 297, - - 297, 297, 297, 297, 297, 297, 297, 297, - 297, 297, 297, 298, 298, 298, 298, 298, - 298, 298, 299, 298, 300, 300, 301, 302, - 303, 304, 305, 205, 205, 205, 205, 205, - - 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, - - 160, 306, 306, 307, 308, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 160, 160, 309, 90, 307, 307, - - 307, 306, 306, 306, 306, 306, 306, 306, - 306, 307, 307, 307, 307, 310, 160, 160, - 90, 139, 141, 139, 139, 160, 160, 160, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 306, 306, 311, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 199, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 322, 322, 323, 322, 322, - - 160, 306, 307, 307, 160, 90, 90, 90, - 90, 90, 90, 90, 90, 160, 160, 90, - 90, 160, 160, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 160, 160, 160, 90, 90, - 90, 90, 160, 160, 309, 308, 324, 307, - - 307, 306, 306, 306, 306, 160, 160, 307, - 307, 160, 160, 307, 307, 310, 323, 160, - 160, 160, 160, 160, 160, 160, 160, 324, - 160, 160, 160, 160, 90, 90, 160, 90, - - 90, 90, 306, 306, 160, 160, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 90, 90, 12, 12, 325, 325, 325, 325, - 325, 325, 194, 160, 160, 160, 160, 160, - - 160, 326, 306, 327, 160, 90, 90, 90, - 90, 90, 90, 160, 160, 160, 160, 90, - 90, 160, 160, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 160, 90, 90, 160, - 90, 90, 160, 160, 309, 160, 307, 307, - - 307, 306, 306, 160, 160, 160, 160, 306, - 306, 160, 160, 306, 306, 310, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 90, 90, 90, 90, 160, 90, 160, - - 160, 160, 160, 160, 160, 160, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 306, 306, 90, 90, 90, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 306, 306, 307, 160, 90, 90, 90, - 90, 90, 90, 90, 308, 90, 160, 90, - 90, 90, 160, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 160, 90, 90, 90, - 90, 90, 160, 160, 309, 90, 307, 307, - - 307, 306, 306, 306, 306, 306, 160, 306, - 306, 307, 160, 307, 307, 310, 160, 160, - 90, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 90, 308, 326, 326, 160, 160, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 160, 328, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 160, 308, 90, 90, - 90, 90, 160, 160, 309, 90, 324, 306, - - 307, 306, 306, 306, 160, 160, 160, 307, - 307, 160, 160, 307, 307, 310, 160, 160, - 160, 160, 160, 160, 160, 160, 306, 324, - 160, 160, 160, 160, 90, 90, 160, 90, - - 90, 90, 160, 160, 160, 160, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 194, 308, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 306, 90, 160, 90, 90, 90, - 90, 90, 90, 160, 160, 160, 90, 90, - 90, 160, 90, 90, 90, 90, 160, 160, - 160, 90, 90, 160, 90, 160, 90, 90, - - 160, 160, 160, 90, 90, 160, 160, 160, - 90, 90, 90, 160, 160, 160, 90, 90, - 90, 90, 90, 90, 90, 90, 323, 90, - 90, 90, 160, 160, 160, 160, 324, 307, - - 306, 307, 307, 160, 160, 160, 307, 307, - 307, 160, 307, 307, 307, 310, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 324, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 329, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 325, 325, 325, 239, 239, 239, 239, 239, - 239, 328, 239, 160, 160, 160, 160, 160, - - 160, 307, 307, 307, 160, 90, 90, 90, - 90, 90, 90, 90, 90, 160, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 160, 90, 90, 90, - 90, 90, 160, 160, 160, 160, 306, 306, - - 306, 307, 307, 307, 307, 160, 306, 306, - 306, 160, 306, 306, 306, 310, 160, 160, - 160, 160, 160, 160, 160, 330, 331, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 90, 90, 160, 160, 160, 160, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 307, 307, 160, 90, 90, 90, - 90, 90, 90, 90, 90, 160, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 160, 90, 90, 90, - 90, 90, 160, 160, 332, 308, 307, 333, - - 307, 307, 324, 307, 307, 160, 333, 307, - 307, 160, 307, 307, 306, 310, 160, 160, - 160, 160, 160, 160, 160, 324, 324, 160, - 160, 160, 160, 160, 160, 160, 90, 160, - - 90, 90, 334, 334, 160, 160, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, - 160, 301, 301, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 160, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 160, 160, 160, 160, 324, 307, - - 307, 306, 306, 306, 160, 160, 307, 307, - 307, 160, 307, 307, 307, 310, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 324, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 335, 335, 160, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 160, - 160, 160, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 160, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 160, 336, 160, 160, - - 336, 336, 336, 336, 336, 336, 336, 160, - 160, 160, 337, 160, 160, 160, 160, 338, - 335, 335, 285, 285, 285, 160, 285, 160, - 335, 335, 335, 335, 335, 335, 335, 338, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 335, 335, 339, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 340, 340, 340, 340, 340, 340, 340, - 340, 340, 340, 340, 340, 340, 340, 340, - 340, 340, 340, 340, 340, 340, 340, 340, - 340, 340, 340, 340, 340, 340, 340, 340, - - 340, 340, 340, 340, 340, 340, 340, 340, - 340, 340, 340, 340, 340, 340, 340, 340, - 340, 341, 340, 340, 341, 341, 341, 341, - 342, 342, 343, 160, 160, 160, 160, 12, - - 340, 340, 340, 340, 340, 340, 344, 341, - 345, 345, 345, 345, 341, 341, 341, 199, - 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 346, 346, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 340, 340, 160, 340, 160, 160, 340, - 340, 160, 340, 160, 160, 340, 160, 160, - 160, 160, 160, 160, 340, 340, 340, 340, - 160, 340, 340, 340, 340, 340, 340, 340, - - 160, 340, 340, 340, 160, 340, 160, 340, - 160, 160, 340, 340, 160, 340, 340, 340, - 340, 341, 340, 340, 341, 341, 341, 341, - 347, 347, 160, 341, 341, 340, 160, 160, - - 340, 340, 340, 340, 340, 160, 344, 160, - 348, 348, 348, 348, 341, 341, 160, 160, - 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 160, 160, 340, 340, 160, 160, - - 349, 350, 350, 350, 351, 352, 351, 351, - 353, 351, 351, 354, 353, 355, 355, 355, - 355, 355, 353, 356, 357, 356, 356, 356, - 206, 206, 356, 356, 356, 356, 356, 356, - - 358, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 369, 206, 356, 206, - 356, 370, 371, 372, 371, 372, 373, 373, - - 349, 349, 349, 349, 349, 349, 349, 349, - 160, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, - - 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 336, 160, 160, 160, 160, 160, - 160, 374, 375, 376, 377, 376, 376, 376, - 376, 376, 375, 375, 375, 375, 376, 378, - - 375, 376, 207, 207, 379, 354, 207, 207, - 349, 349, 349, 349, 160, 160, 160, 160, - 376, 376, 376, 376, 376, 376, 285, 376, - 160, 376, 376, 376, 376, 376, 376, 376, - - 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 285, 285, - 285, 376, 376, 376, 376, 376, 376, 376, - 285, 376, 285, 285, 285, 160, 380, 380, - - 381, 381, 381, 381, 381, 381, 147, 381, - 381, 381, 381, 381, 381, 160, 160, 381, - 382, 382, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, - - 383, 383, 160, 383, 383, 383, 383, 383, - 160, 383, 383, 160, 384, 385, 385, 385, - 385, 384, 385, 160, 160, 160, 385, 386, - 384, 387, 160, 160, 160, 160, 160, 160, - - 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 398, 339, 339, 339, 339, - 383, 383, 383, 383, 383, 383, 384, 384, - 385, 385, 160, 160, 160, 160, 160, 160, - - 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, - - 399, 399, 399, 399, 399, 399, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 400, - 400, 323, 323, 199, 401, 160, 160, 160, - - 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, - - 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 160, 160, 160, 160, 160, 402, - - 403, 403, 403, 403, 403, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, - - 403, 403, 403, 160, 160, 160, 160, 160, - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 404, 404, 404, 404, 404, 404, - 404, 404, 160, 160, 160, 160, 160, 160, - - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 160, 336, 336, 336, 336, 160, 160, - 336, 336, 336, 336, 336, 336, 336, 160, - 336, 160, 336, 336, 336, 336, 160, 160, - - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 160, 336, 336, 336, 336, 160, 160, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 160, 336, 336, 336, 336, 160, 160, - 336, 336, 336, 336, 336, 336, 336, 160, - - 336, 160, 336, 336, 336, 336, 160, 160, - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 336, 336, 336, 336, 336, 336, 160, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 160, 336, 336, 336, 336, 160, 160, - 336, 336, 336, 336, 336, 336, 336, 323, - - 336, 336, 336, 336, 336, 336, 336, 323, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 160, 160, 160, 160, 153, - - 405, 406, 407, 339, 339, 339, 339, 407, - 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 417, 417, 417, 417, 417, - 417, 417, 417, 417, 417, 160, 160, 160, - - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 160, 160, 160, 160, 160, 160, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 339, 407, 336, - 336, 336, 336, 336, 336, 336, 336, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 419, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 420, 421, 160, 160, 160, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 406, 406, 406, 422, 422, - 422, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 160, 400, 400, - 400, 400, 423, 423, 424, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 423, 423, 424, 425, 425, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 423, 423, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 160, 400, 400, - 400, 160, 423, 423, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 383, 383, 383, 383, - 383, 383, 383, 383, 426, 426, 384, 385, - 385, 385, 385, 385, 385, 385, 384, 384, - - 384, 384, 384, 384, 384, 384, 385, 384, - 384, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 387, 385, 406, 406, 427, 428, - 406, 339, 406, 429, 383, 430, 160, 160, - - 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 160, 160, 160, 160, 160, 160, - 431, 431, 431, 431, 431, 431, 431, 431, - 431, 431, 160, 160, 160, 160, 160, 160, - - 432, 432, 433, 434, 433, 433, 435, 432, - 433, 434, 432, 285, 285, 285, 436, 160, - 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 160, 160, 160, 160, 160, 160, - - 336, 336, 336, 137, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 336, - 160, 160, 160, 160, 160, 160, 160, 160, - - 336, 336, 336, 336, 336, 336, 336, 336, - 336, 437, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 160, 160, 160, - - 326, 326, 326, 327, 327, 327, 327, 326, - 326, 438, 438, 438, 160, 160, 160, 160, - 327, 327, 326, 327, 327, 327, 327, 327, - 327, 439, 149, 150, 160, 160, 160, 160, - - 239, 160, 160, 160, 440, 440, 441, 442, - 443, 444, 445, 446, 447, 448, 449, 450, - 451, 451, 451, 451, 451, 451, 451, 451, - 451, 451, 451, 451, 451, 451, 451, 451, - - 451, 451, 451, 451, 451, 451, 451, 451, - 451, 451, 451, 451, 451, 451, 160, 160, - 451, 451, 451, 451, 451, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, - - 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 160, 160, 160, 160, 160, 160, - 453, 453, 453, 453, 453, 453, 453, 453, - 453, 453, 453, 453, 453, 453, 453, 453, - - 453, 452, 452, 452, 452, 452, 452, 452, - 453, 453, 160, 160, 160, 160, 160, 160, - 329, 454, 455, 456, 457, 458, 459, 460, - 461, 462, 160, 160, 160, 160, 463, 463, - - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 153, - 152, 464, 464, 464, 160, 160, 465, 466, - - 334, 334, 334, 334, 467, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 468, 467, 334, 334, - 334, 334, 334, 467, 334, 467, 467, 467, - - 467, 467, 334, 467, 469, 322, 322, 322, - 322, 322, 322, 322, 160, 160, 160, 160, - 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 480, 481, 481, 480, 480, - - 481, 482, 482, 482, 482, 482, 482, 482, - 482, 482, 482, 298, 299, 298, 298, 298, - 298, 298, 298, 298, 482, 482, 482, 482, - 482, 482, 482, 482, 482, 160, 160, 160, - - 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, - - 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 483, 483, - - 483, 483, 483, 483, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 483, 483, - 483, 483, 483, 483, 483, 483, 483, 483, - - 483, 483, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, - 484, 103, 103, 103, 103, 485, 103, 103, - - 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 484, 484, 484, 484, 484, - - 484, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 484, 484, 484, 484, 484, 484, - - 153, 153, 152, 153, 298, 298, 298, 298, - 298, 298, 299, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 298, 299, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 486, 487, - 488, 489, 490, 491, 160, 160, 160, 160, - - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 65, 66, 65, 66, 65, 66, - 65, 66, 160, 160, 160, 160, 160, 160, - - 492, 492, 492, 492, 492, 492, 492, 492, - 493, 493, 493, 493, 493, 493, 493, 493, - 492, 492, 492, 492, 492, 492, 160, 160, - 493, 493, 493, 493, 493, 493, 160, 160, - - 492, 492, 492, 492, 492, 492, 492, 492, - 493, 493, 493, 493, 493, 493, 493, 493, - 492, 492, 492, 492, 492, 492, 492, 492, - 493, 493, 493, 493, 493, 493, 493, 493, - - 492, 492, 492, 492, 492, 492, 160, 160, - 493, 493, 493, 493, 493, 493, 160, 160, - 494, 492, 495, 492, 496, 492, 497, 492, - 160, 493, 160, 493, 160, 493, 160, 493, - - 492, 492, 492, 492, 492, 492, 492, 492, - 493, 493, 493, 493, 493, 493, 493, 493, - 498, 498, 499, 499, 499, 499, 500, 500, - 501, 501, 502, 502, 503, 503, 160, 160, - - 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 516, 517, 518, 519, - 520, 521, 522, 523, 524, 525, 526, 527, - 528, 529, 530, 531, 532, 533, 534, 535, - - 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, - 492, 492, 552, 553, 554, 160, 555, 556, - 493, 493, 557, 557, 558, 42, 559, 42, - - 42, 42, 560, 561, 562, 160, 563, 564, - 565, 565, 565, 565, 566, 42, 42, 42, - 492, 492, 567, 166, 160, 160, 568, 569, - 493, 493, 570, 570, 160, 42, 42, 42, - - 492, 492, 571, 169, 572, 182, 573, 574, - 493, 493, 575, 575, 576, 42, 42, 42, - 160, 160, 577, 578, 579, 160, 580, 581, - 582, 582, 583, 583, 584, 42, 42, 160, - - 585, 585, 585, 585, 585, 585, 585, 586, - 585, 585, 585, 587, 588, 589, 590, 591, - 592, 593, 592, 592, 594, 595, 14, 14, - 596, 597, 598, 599, 596, 600, 598, 599, - - 14, 14, 14, 14, 601, 601, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, - 13, 13, 13, 13, 13, 611, 611, 611, - 14, 596, 600, 14, 612, 612, 14, 43, - - 43, 14, 14, 14, 613, 16, 17, 614, - 615, 615, 432, 432, 432, 432, 616, 616, - 616, 616, 185, 617, 618, 619, 620, 616, - 620, 620, 620, 620, 619, 620, 620, 621, - - 622, 623, 623, 623, 160, 160, 160, 160, - 160, 160, 624, 624, 624, 624, 624, 624, - 625, 626, 160, 160, 627, 628, 629, 630, - 631, 632, 633, 633, 36, 16, 17, 50, - - 625, 60, 55, 56, 627, 628, 629, 630, - 631, 632, 633, 633, 36, 16, 17, 160, - 484, 484, 484, 484, 484, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 12, 12, 12, 12, 12, 12, 12, 48, - 12, 12, 12, 634, 635, 429, 429, 429, - 636, 636, 637, 637, 637, 637, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 139, 139, 144, 144, 139, 139, 139, 139, - 144, 144, 144, 139, 139, 273, 273, 273, - - 273, 139, 195, 195, 638, 639, 639, 159, - 640, 159, 639, 641, 299, 299, 299, 299, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 49, 49, 175, 642, 49, 49, 49, 175, - 49, 642, 50, 175, 175, 175, 50, 50, - 175, 175, 175, 50, 49, 175, 643, 49, - 49, 175, 175, 175, 175, 175, 49, 49, - - 49, 49, 49, 49, 175, 49, 644, 49, - 175, 49, 645, 646, 175, 175, 647, 50, - 175, 175, 648, 175, 50, 90, 90, 90, - 90, 131, 649, 239, 103, 626, 650, 650, - - 185, 185, 185, 185, 185, 650, 626, 626, - 626, 626, 651, 185, 418, 301, 652, 160, - 160, 160, 160, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, - - 653, 653, 653, 653, 653, 653, 653, 653, - 653, 653, 653, 653, 653, 653, 653, 653, - 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, - - 655, 655, 655, 99, 109, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 36, 36, 36, 36, 36, 49, 49, 49, - 49, 49, 36, 36, 49, 49, 49, 49, - - 36, 49, 49, 36, 49, 49, 36, 49, - 49, 49, 49, 49, 49, 49, 36, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 36, 36, - 49, 49, 36, 49, 36, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - - 36, 36, 36, 36, 36, 36, 36, 36, - 656, 656, 656, 657, 657, 657, 36, 36, - 36, 36, 18, 54, 36, 658, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 659, 660, 36, 36, - - 36, 36, 36, 661, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 659, 660, 659, 660, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 659, 660, 659, 660, - 659, 660, 659, 660, 36, 36, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, - - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 36, 36, 36, 659, - 660, 659, 660, 36, 36, 36, 36, 36, - 662, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 659, 660, 36, 36, 663, 36, - 664, 665, 36, 665, 36, 36, 36, 36, - 659, 660, 659, 660, 659, 660, 659, 660, - 36, 36, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 659, 660, 659, 660, 666, 36, 36, - 659, 660, 36, 36, 36, 36, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, - - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 659, 660, 36, 36, - 659, 660, 667, 667, 667, 185, 668, 668, - 185, 185, 669, 669, 669, 670, 670, 185, - - 49, 649, 49, 49, 49, 49, 49, 49, - 659, 660, 659, 660, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 36, 36, 49, 49, 49, 49, 49, 49, - 49, 16, 17, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 649, 185, 649, 649, 649, - - 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 649, 381, 649, 649, - 649, 649, 649, 185, 185, 185, 185, 185, - - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 651, - - 651, 651, 651, 651, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 239, - 239, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 671, 671, 671, 671, - - 671, 671, 301, 301, 301, 301, 301, 301, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 649, 649, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 672, 673, 674, 675, - 676, 677, 678, 679, 680, 62, 62, 62, - - 62, 62, 62, 62, 62, 62, 62, 62, - 60, 55, 56, 627, 628, 629, 630, 631, - 632, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 194, 194, 194, 194, - - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, - - 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, - 683, 683, 683, 683, 683, 683, 683, 683, - 683, 683, 683, 683, 683, 683, 683, 683, - - 683, 683, 683, 683, 683, 683, 683, 683, - 683, 683, 684, 685, 685, 685, 685, 685, - 685, 685, 685, 685, 685, 686, 687, 688, - 689, 690, 691, 692, 693, 694, 685, 695, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 651, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 36, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 36, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 649, 649, 649, 649, 649, 649, 649, 649, - 185, 185, 185, 185, 185, 185, 185, 185, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 239, 239, 651, 651, - 418, 649, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 36, - 649, 649, 651, 651, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 418, 418, - - 651, 651, 651, 651, 651, 651, 651, 651, - 651, 651, 239, 239, 239, 239, 239, 239, - 239, 239, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 160, 160, 160, - - 239, 239, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 405, 418, 418, 418, - 418, 418, 301, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 49, 49, 49, 49, 160, 49, 49, - 49, 49, 160, 160, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 160, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 160, 49, 160, 49, - 49, 49, 49, 160, 160, 160, 49, 160, - 49, 49, 49, 696, 696, 696, 696, 160, - - 160, 49, 697, 697, 49, 49, 49, 49, - 698, 699, 698, 699, 698, 699, 698, 699, - 698, 699, 698, 699, 698, 699, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 62, - - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 62, 672, 673, 674, 675, 676, 677, - 678, 679, 680, 62, 49, 160, 160, 160, - 49, 49, 49, 49, 49, 49, 49, 49, - - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 160, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 160, - - 700, 700, 700, 701, 702, 703, 704, 671, - 671, 671, 671, 160, 160, 160, 160, 160, - 185, 185, 185, 185, 185, 705, 706, 185, - 185, 185, 185, 185, 185, 705, 706, 185, - - 185, 185, 705, 706, 705, 706, 698, 699, - 698, 699, 698, 699, 160, 160, 160, 160, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - - 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 381, 381, 381, 381, 381, 381, - - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - - 185, 185, 185, 698, 699, 698, 699, 698, - 699, 698, 699, 698, 699, 707, 708, 709, - 710, 698, 699, 698, 699, 698, 699, 698, - 699, 185, 185, 185, 185, 185, 185, 185, - - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 711, 185, 185, 185, 185, 185, 185, 185, - - 705, 706, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 705, - 706, 705, 706, 185, 705, 706, 185, 185, - 698, 699, 698, 699, 185, 185, 185, 185, - - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 712, 185, 185, - 705, 706, 185, 185, 698, 699, 185, 185, - - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, - 185, 705, 706, 185, 185, 705, 706, 705, - - 706, 705, 706, 705, 706, 185, 185, 185, - 185, 185, 185, 705, 706, 185, 185, 185, - 185, 705, 706, 705, 706, 705, 706, 705, - 706, 705, 706, 705, 706, 185, 185, 185, - - 185, 705, 706, 185, 185, 185, 705, 706, - 705, 706, 705, 706, 705, 706, 185, 705, - 706, 185, 185, 705, 706, 185, 185, 185, - 185, 185, 185, 705, 706, 705, 706, 705, - - 706, 705, 706, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 185, 705, 706, 705, - 706, 705, 706, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 185, 185, 713, 185, - - 185, 185, 185, 714, 715, 714, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 705, - 706, 705, 706, 185, 185, 185, 185, 185, - - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 418, 418, - 418, 418, 418, 418, 301, 301, 301, 301, - 301, 301, 301, 160, 160, 160, 160, 160, - - 301, 301, 301, 301, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 160, - 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 717, - - 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 160, - - 113, 109, 718, 719, 720, 721, 722, 113, - 109, 113, 109, 113, 109, 160, 160, 160, - 160, 160, 160, 160, 723, 113, 109, 723, - 160, 160, 160, 160, 160, 160, 160, 160, - - 105, 106, 105, 106, 105, 106, 105, 106, - 105, 106, 105, 106, 105, 106, 105, 106, - 105, 106, 105, 106, 105, 106, 105, 106, - 105, 106, 105, 106, 105, 106, 105, 106, - - 105, 106, 105, 106, 103, 418, 418, 418, - 418, 418, 418, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 620, 620, 620, 620, 724, 620, 620, - - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - - 725, 725, 725, 725, 725, 725, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - - 323, 323, 323, 323, 323, 323, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 401, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 323, 323, 323, 323, 323, 323, 323, 160, - 323, 323, 323, 323, 323, 323, 323, 160, - 323, 323, 323, 323, 323, 323, 323, 160, - 323, 323, 323, 323, 323, 323, 323, 160, - - 726, 726, 727, 728, 727, 728, 726, 726, - 726, 727, 728, 726, 727, 728, 620, 620, - 620, 620, 620, 620, 620, 620, 619, 729, - 160, 160, 160, 160, 727, 728, 160, 160, - - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 160, 730, 730, 730, 730, 730, - - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 160, 160, 160, 160, - - 731, 732, 733, 734, 735, 736, 737, 738, - 16, 17, 16, 17, 16, 17, 16, 17, - 16, 17, 735, 735, 16, 17, 16, 17, - 16, 17, 16, 17, 739, 16, 17, 740, - - 735, 738, 738, 738, 738, 738, 738, 738, - 738, 738, 741, 742, 140, 743, 744, 744, - 745, 746, 746, 746, 746, 746, 735, 735, - 747, 747, 747, 748, 749, 750, 730, 735, - - 160, 751, 737, 751, 737, 751, 737, 751, - 737, 751, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - - 737, 737, 737, 751, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - - 737, 737, 737, 751, 737, 751, 737, 751, - 737, 737, 737, 737, 737, 737, 751, 737, - 737, 737, 737, 737, 737, 752, 752, 160, - 160, 753, 753, 754, 754, 755, 755, 756, - - 757, 758, 759, 758, 759, 758, 759, 758, - 759, 758, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - - 759, 759, 759, 758, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - - 759, 759, 759, 758, 759, 758, 759, 758, - 759, 759, 759, 759, 759, 759, 758, 759, - 759, 759, 759, 759, 759, 758, 758, 759, - 759, 759, 759, 760, 761, 761, 761, 762, - - 160, 160, 160, 160, 160, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 160, 160, 160, - 160, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 160, - 764, 764, 765, 765, 765, 765, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 160, 160, 160, 160, 160, 160, 160, 160, - - 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 769, 769, 160, - - 765, 765, 765, 765, 765, 765, 765, 765, - 765, 765, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 769, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 769, 769, 767, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 769, 769, 769, 769, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 160, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 769, - 769, 769, 769, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 769, 769, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 769, - - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - - 737, 737, 737, 737, 737, 737, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 160, 160, 160, 160, - - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 773, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - - 730, 730, 774, 774, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 774, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - - 730, 774, 730, 730, 730, 774, 730, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 776, - 776, 776, 776, 160, 160, 160, 160, 160, - - 777, 777, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 323, 323, 778, 323, 323, 323, 779, 323, - 323, 323, 323, 780, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, - - 323, 323, 323, 464, 464, 780, 780, 464, - 418, 418, 418, 418, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 781, 781, 304, 304, - 160, 160, 160, 160, 160, 160, 160, 160, - - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - - 785, 785, 785, 785, 785, 785, 785, 785, - 785, 785, 785, 785, 785, 785, 785, 785, - 785, 785, 785, 785, 785, 785, 785, 785, - 785, 785, 785, 785, 785, 785, 785, 785, - - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 160, 160, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 160, 160, 160, 160, 160, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 160, 160, 160, 160, 160, 160, - - 787, 788, 789, 790, 791, 792, 792, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 793, 794, 795, 796, 797, - 160, 160, 160, 160, 160, 798, 799, 231, - - 231, 231, 231, 231, 231, 231, 231, 231, - 231, 633, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 205, - 231, 231, 231, 231, 231, 205, 231, 205, - - 231, 231, 205, 231, 231, 205, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, - - 235, 235, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 598, 740, - - 235, 235, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 235, 235, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, - 235, 235, 235, 235, 235, 235, 235, 235, - 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 800, - - 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 800, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 801, 239, 235, 235, - - 423, 423, 423, 423, 423, 423, 423, 423, - 423, 423, 423, 423, 423, 423, 423, 423, - 802, 803, 803, 802, 802, 804, 804, 805, - 806, 807, 160, 160, 160, 160, 160, 160, - - 139, 139, 139, 139, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 734, 745, 745, 808, 808, 598, 740, 598, - 740, 598, 740, 598, 740, 598, 740, 598, - - 740, 598, 740, 598, 740, 750, 750, 809, - 810, 734, 734, 734, 734, 808, 808, 808, - 811, 734, 812, 160, 760, 813, 9, 9, - 745, 16, 17, 16, 17, 16, 17, 814, - - 734, 734, 815, 816, 817, 818, 819, 160, - 734, 12, 13, 734, 160, 160, 160, 160, - 243, 243, 243, 286, 243, 235, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 235, 235, 820, - - 160, 9, 734, 814, 12, 13, 734, 734, - 16, 17, 734, 815, 811, 816, 812, 821, - 822, 823, 824, 825, 826, 827, 828, 829, - 830, 831, 813, 760, 832, 819, 833, 9, - - 734, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 39, 734, 41, 835, 808, - - 835, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 39, 819, 41, 819, 698, - - 699, 733, 16, 17, 732, 760, 837, 758, - 758, 758, 758, 758, 758, 758, 758, 758, - 761, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 761, 761, - - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 160, - - 160, 160, 90, 90, 90, 90, 90, 90, - 160, 160, 90, 90, 90, 90, 90, 90, - 160, 160, 90, 90, 90, 90, 90, 90, - 160, 160, 90, 90, 90, 160, 160, 160, - - 48, 12, 819, 835, 735, 12, 12, 160, - 49, 36, 36, 36, 36, 49, 49, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 838, 838, 838, 839, 49, 840, 840, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 160, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - - 308, 308, 308, 308, 308, 308, 308, 160, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 160, 308, 308, 160, 308, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 160, 160, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 160, 160, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 160, 160, 160, 160, 160, - - 841, 842, 843, 160, 160, 160, 160, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 160, 160, 160, 845, - 845, 845, 845, 845, 845, 845, 845, 845, - - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 724, 724, 724, - 724, 418, 418, 418, 418, 418, 418, 418, - - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 724, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 160, - - 848, 848, 848, 848, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - - 847, 849, 847, 847, 847, 847, 847, 847, - 847, 847, 849, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 160, 841, - - 323, 323, 323, 323, 160, 160, 160, 160, - 323, 323, 323, 323, 323, 323, 323, 323, - 465, 850, 850, 850, 850, 850, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - - 851, 851, 851, 851, 851, 851, 852, 852, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 853, 853, - - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 854, 854, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 160, 160, - - 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 855, 855, 855, 855, 855, 855, 205, 205, - 855, 205, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 205, 855, - 855, 205, 205, 205, 855, 205, 205, 855, - - 856, 856, 856, 856, 856, 856, 856, 856, - 856, 856, 856, 856, 856, 856, 856, 856, - 856, 856, 856, 856, 856, 856, 857, 857, - 857, 857, 205, 205, 205, 205, 205, 858, - - 859, 780, 780, 780, 205, 780, 780, 205, - 205, 205, 205, 205, 780, 152, 780, 153, - 859, 859, 859, 859, 205, 859, 859, 859, - 205, 859, 859, 859, 859, 859, 859, 859, - - 859, 859, 859, 859, 859, 859, 859, 859, - 859, 859, 859, 859, 859, 859, 859, 859, - 859, 859, 859, 859, 205, 205, 205, 205, - 153, 641, 152, 205, 205, 205, 205, 779, - - 860, 861, 862, 863, 864, 864, 864, 864, - 205, 205, 205, 205, 205, 205, 205, 205, - 865, 865, 865, 865, 865, 865, 865, 865, - 866, 205, 205, 205, 205, 205, 205, 205, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 481, 481, 481, 481, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 160, - 160, 160, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 869, 870, 871, - 871, 871, 868, 868, 868, 872, 869, 869, - 869, 869, 869, 873, 873, 873, 873, 873, - 873, 873, 873, 874, 874, 874, 874, 874, - 874, 874, 874, 868, 868, 875, 875, 875, - 875, 875, 874, 874, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 875, 875, 875, 875, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 153, 153, 153, 418, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 878, 878, 878, 160, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 160, 877, 877, - 160, 160, 877, 160, 160, 877, 877, 160, - 160, 877, 877, 877, 877, 160, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 160, 878, 160, 878, 878, 878, - 878, 102, 878, 878, 160, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - - 878, 878, 878, 878, 877, 877, 160, 877, - 877, 877, 877, 160, 160, 877, 877, 877, - 877, 877, 877, 877, 877, 160, 877, 877, - 877, 877, 877, 877, 877, 160, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 160, 877, 877, 877, 877, 160, - 877, 877, 877, 877, 877, 160, 877, 160, - 160, 160, 877, 877, 877, 877, 877, 877, - 877, 160, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 103, 103, 160, 160, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 879, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 879, 878, 878, 878, 878, - 878, 878, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 879, 878, 878, 878, 878, - - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 879, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 879, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 879, - 878, 878, 878, 878, 878, 878, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 879, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 879, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 879, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 879, 878, 878, 878, 878, - 878, 878, 880, 723, 160, 160, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, - 881, 882, 883, 884, 885, 886, 887, 888, - 889, 890, 881, 882, 883, 884, 885, 886, - 887, 888, 889, 890, 881, 882, 883, 884, - 885, 886, 887, 888, 889, 890, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 891, 891, - - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 873, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 891, 891, + // 0 - 0x11000 + + 6256, 6288, 6320, 6352, 6384, 6416, 6448, 6480, + 6512, 6544, 6576, 6608, 6640, 6672, 6704, 6736, + 6768, 6800, 6832, 6864, 6896, 6928, 6960, 6992, + 7024, 7056, 7088, 7120, 7152, 7184, 7216, 7248, + 7280, 7312, 7344, 6512, 7376, 6512, 7408, 7440, + 7472, 7504, 7536, 7568, 7600, 7632, 7664, 7696, + 7728, 7760, 7792, 7824, 7856, 7888, 7920, 7952, + 7984, 8016, 8048, 8080, 8112, 8144, 8176, 8208, + 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + 8272, 8304, 8336, 8368, 8400, 8432, 8464, 8496, + 8528, 8560, 8592, 8624, 8656, 8688, 8720, 8752, + 8400, 8784, 8816, 8848, 8880, 8912, 8944, 8976, + 9008, 9040, 9072, 9104, 9136, 9168, 9200, 9232, + 9136, 9264, 9296, 9104, 9328, 9360, 9392, 9424, + 9456, 9488, 9520, 9552, 9584, 9616, 9648, 9552, + 9680, 9712, 9744, 9776, 9808, 9840, 9872, 9552, + + 9904, 9936, 9968, 9552, 9552, 10000, 10032, 10064, + 10096, 10096, 10128, 10160, 10160, 10192, 10224, 10256, + 10288, 10320, 10352, 10320, 10384, 10416, 10448, 10480, + 10512, 10320, 10544, 10576, 10608, 10320, 10320, 10640, + 10672, 10320, 10320, 10320, 10320, 10320, 10320, 10320, + 10320, 10320, 10320, 10320, 10320, 10320, 10320, 10320, + 10320, 10320, 10320, 10704, 10736, 10320, 10320, 10768, + 10800, 10832, 10864, 10896, 9904, 10928, 10960, 10992, + 11024, 10320, 11056, 11088, 10320, 11120, 9552, 9552, + 11152, 11184, 11216, 11248, 11280, 11312, 11344, 11376, + 11408, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 11440, 11472, 11504, 11536, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 11568, 11600, 11632, 11664, 11696, 11728, 11760, 11792, + 6512, 6512, 6512, 6512, 11824, 6512, 6512, 11856, + 11888, 11920, 11952, 11984, 12016, 12048, 12080, 12112, + + 12144, 12176, 12208, 12240, 12272, 12304, 12336, 12368, + 12400, 12432, 12464, 12496, 12528, 12560, 12592, 12624, + 12656, 12688, 12720, 12752, 12784, 12816, 12848, 12880, + 12912, 12944, 12976, 13008, 13040, 13072, 13104, 13136, + 13168, 13200, 13232, 13264, 13296, 13328, 13360, 13392, + 13168, 13168, 13168, 13168, 13424, 13456, 13488, 13520, + 13552, 13168, 13168, 13584, 13616, 13648, 9552, 9552, + 13680, 13712, 13744, 13776, 13808, 13840, 13872, 13904, + 13936, 13936, 13936, 13936, 13936, 13936, 13936, 13936, + 13968, 13968, 13968, 13968, 14000, 14032, 14064, 14096, + 13968, 14128, 13968, 14160, 14192, 14224, 14256, 14288, + 14320, 14352, 9552, 9552, 9552, 9552, 9552, 9552, + 14384, 14416, 14448, 14480, 14512, 14512, 14512, 14544, + 14576, 14608, 14640, 14672, 14704, 14736, 14736, 9552, + 14768, 9552, 9552, 9552, 14800, 14832, 14832, 14864, + 14832, 14832, 14832, 14832, 14832, 14832, 14896, 14928, + + 14960, 14992, 15024, 15056, 15088, 15120, 15152, 15184, + 15216, 15248, 15280, 15280, 15312, 15344, 15376, 15408, + 15440, 15472, 15504, 15536, 15472, 15568, 15600, 15632, + 15664, 15664, 15664, 15696, 15664, 15664, 15728, 15760, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15792, 15792, 15792, + 15792, 15792, 15792, 15792, 15792, 15824, 11376, 11376, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 15856, 15856, 15856, 15856, 15888, 9552, 9552, + + 15920, 15952, 15952, 15952, 15952, 15952, 15952, 15952, + 15952, 15952, 15952, 15952, 15952, 15952, 15952, 15952, + 15952, 15952, 15952, 15952, 15952, 15952, 15952, 15952, + 15952, 15952, 15952, 15952, 15952, 15952, 15952, 15952, + 15952, 15952, 15952, 15952, 15984, 16016, 16048, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 16080, 16112, 9552, 9552, 9552, 9552, 9552, 9552, + 16144, 16176, 16208, 16240, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, + 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, + 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, + + 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, + 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, + 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, + 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, + 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, + 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, + 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, + 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, + 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, + 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, + 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, + 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, + + 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, + 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, + 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, + 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, + 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, + 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, + 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, + 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, + 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, + 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, + 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + + 16304, 16336, 16368, 16400, 16432, 16464, 16272, 16304, + 16336, 16368, 16400, 16432, 16464, 16272, 16304, 16336, + 16368, 16400, 16432, 16464, 16272, 16304, 16336, 16368, + 16400, 16432, 16464, 16272, 16304, 16336, 16368, 16400, + 16432, 16464, 16272, 16304, 16336, 16368, 16400, 16432, + 16464, 16272, 16304, 16336, 16368, 16400, 16432, 16464, + 16272, 16304, 16336, 16368, 16400, 16432, 16464, 16272, + 16304, 16336, 16368, 16400, 16432, 16496, 9552, 9552, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + 16528, 16528, 16528, 16528, 16528, 16528, 16528, 16528, + + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 16560, 16560, 16560, 16560, 16560, 16560, 16560, 16560, + 15856, 15856, 15856, 15856, 15856, 15856, 15856, 15856, + 15856, 16592, 16624, 16656, 16688, 16688, 16720, 9552, + 16752, 16784, 16816, 16848, 16848, 16880, 16912, 16848, + 16848, 16848, 16848, 16848, 16848, 16848, 16848, 16848, + 16848, 16944, 16976, 16848, 17008, 16848, 17040, 17072, + 17104, 17136, 17168, 17200, 16848, 16848, 16848, 17232, + 17264, 17296, 17328, 17360, 17392, 17424, 17456, 17488, + + 17520, 17552, 17584, 9552, 17616, 17616, 17616, 17648, + 17680, 17712, 17744, 17776, 17808, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 17840, 17872, 17904, 9552, 17936, 14640, 17968, 9552, + 18000, 18032, 18064, 17616, 18096, 18128, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 9552, 9552, 9552, 9552, 9552, 9552, 9552, 9552, + 18160, 18192, 8240, 8240, 8240, 8240, 8240, 8240, + 18224, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + 18256, 18288, 18320, 8240, 8240, 8240, 8240, 8240, + 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + 8240, 8240, 8240, 8240, 8240, 8240, 8240, 8240, + + // 0x11000 - 0x110000 + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18608, 18608, 18608, 18864, 19120, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 19376, 19632, 19888, 20144, 20400, 20656, 20912, 21168, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21680, 21680, + 21680, 21680, 21680, 21680, 21680, 21680, 21936, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 21680, 21680, 22192, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 22448, 22704, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 18352, + 18352, 18352, 18352, 18352, 18352, 18352, 18352, 21424, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 23216, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 22960, + 22960, 22960, 22960, 22960, 22960, 22960, 22960, 23216, + + + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 2, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 6, 6, 7, + + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 14, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 9, + + 14, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 39, 40, 41, 42, 43, + + 42, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 39, 45, 41, 36, 0, + + 0, 0, 0, 0, 0, 46, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 47, 14, 48, 12, 12, 12, 49, 49, + 42, 49, 50, 51, 36, 52, 49, 42, + 53, 54, 55, 56, 57, 58, 49, 59, + 42, 60, 50, 61, 62, 62, 62, 14, + + 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 36, + 38, 38, 38, 38, 38, 38, 38, 63, + + 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 36, + 44, 44, 44, 44, 44, 44, 44, 64, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 67, 68, 65, 66, 65, 66, 65, 66, + 50, 65, 66, 65, 66, 65, 66, 65, + + 66, 65, 66, 65, 66, 65, 66, 65, + 66, 69, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 70, 65, 66, 65, 66, 65, 66, 71, + + 72, 73, 65, 66, 65, 66, 74, 65, + 66, 75, 75, 65, 66, 50, 76, 77, + 78, 65, 66, 75, 79, 80, 81, 82, + 65, 66, 83, 50, 81, 84, 85, 86, + + 65, 66, 65, 66, 65, 66, 87, 65, + 66, 87, 50, 50, 65, 66, 87, 65, + 66, 88, 88, 65, 66, 65, 66, 89, + 65, 66, 50, 90, 65, 66, 50, 91, + + 90, 90, 90, 90, 92, 93, 94, 92, + 93, 94, 92, 93, 94, 65, 66, 65, + 66, 65, 66, 65, 66, 65, 66, 65, + 66, 65, 66, 65, 66, 95, 65, 66, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 96, 92, 93, 94, 65, 66, 97, 98, + 99, 100, 65, 66, 65, 66, 65, 66, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 99, 100, 99, 100, 99, 100, 99, 100, + + 101, 102, 99, 100, 99, 100, 99, 100, + 99, 100, 99, 100, 99, 100, 99, 100, + 99, 100, 99, 100, 102, 102, 102, 103, + 103, 103, 104, 105, 106, 107, 108, 103, + + 103, 105, 109, 110, 111, 112, 113, 109, + 113, 109, 113, 109, 113, 109, 113, 109, + 50, 50, 50, 114, 115, 50, 116, 116, + 50, 117, 50, 118, 50, 50, 50, 50, + + 116, 50, 50, 119, 50, 50, 50, 50, + 120, 121, 50, 122, 50, 50, 50, 121, + 50, 50, 123, 50, 50, 124, 50, 50, + 50, 50, 50, 50, 50, 125, 50, 50, + + 126, 50, 50, 126, 50, 50, 50, 50, + 126, 127, 128, 128, 129, 50, 50, 50, + 50, 50, 130, 50, 90, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 131, 131, 131, 131, 131, 102, 102, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 133, 133, 134, 134, 134, 134, 134, + + 132, 132, 42, 42, 42, 42, 133, 133, + 135, 133, 133, 133, 135, 133, 133, 133, + 134, 134, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 136, + + 132, 132, 132, 132, 132, 42, 42, 42, + 42, 42, 136, 136, 136, 136, 137, 138, + 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, + + 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 140, 141, 141, + 141, 141, 140, 142, 141, 141, 141, 141, + + 141, 143, 143, 141, 141, 141, 141, 143, + 143, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 141, 141, 144, 144, 144, 144, + 144, 141, 141, 141, 141, 139, 139, 139, + + 139, 139, 139, 139, 139, 145, 146, 147, + 147, 147, 146, 146, 146, 147, 147, 148, + 149, 149, 149, 150, 150, 150, 150, 149, + 151, 152, 152, 153, 154, 155, 155, 156, + + 157, 157, 158, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, + 160, 160, 160, 160, 42, 42, 160, 160, + 160, 160, 132, 161, 161, 161, 34, 160, + + 160, 160, 160, 160, 42, 42, 162, 14, + 163, 163, 163, 160, 164, 160, 165, 165, + 166, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, + + 38, 38, 160, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 167, 168, 168, 168, + 169, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, + + 44, 44, 170, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 171, 172, 172, 160, + 173, 174, 175, 175, 175, 176, 177, 131, + 178, 179, 65, 100, 65, 100, 65, 100, + + 65, 100, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 180, 181, 182, 50, 183, 184, 185, 186, + 187, 188, 186, 187, 103, 189, 189, 189, + + 190, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 190, 191, 191, + 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, + + 38, 38, 38, 38, 38, 38, 38, 38, + 38, 38, 38, 38, 38, 38, 38, 38, + 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, + + 44, 44, 44, 44, 44, 44, 44, 44, + 44, 44, 44, 44, 44, 44, 44, 44, + 192, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 192, 193, 193, + + 65, 66, 194, 139, 139, 139, 139, 160, + 195, 195, 178, 179, 99, 100, 99, 100, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + + 196, 65, 66, 65, 66, 178, 179, 65, + 66, 178, 179, 65, 66, 178, 179, 197, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 99, 100, 65, 66, + 65, 66, 65, 66, 65, 66, 105, 106, + 65, 66, 113, 109, 113, 109, 113, 109, + + 178, 179, 178, 179, 178, 179, 178, 179, + 178, 179, 178, 179, 178, 179, 178, 179, + 113, 109, 113, 109, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, + + 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 160, + 160, 134, 199, 199, 200, 199, 200, 199, + + 160, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, + + 201, 201, 201, 201, 201, 201, 201, 202, + 160, 203, 204, 160, 160, 160, 160, 160, + 205, 206, 207, 207, 207, 207, 206, 207, + 207, 207, 208, 206, 207, 207, 207, 207, + + 207, 207, 152, 206, 206, 206, 206, 206, + 207, 207, 206, 207, 207, 208, 209, 207, + 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, + + 226, 227, 228, 226, 207, 152, 229, 230, + 205, 205, 205, 205, 205, 205, 205, 205, + 231, 231, 231, 231, 231, 231, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 231, + + 231, 231, 231, 231, 231, 231, 231, 231, + 231, 231, 231, 205, 205, 205, 205, 205, + 231, 231, 231, 232, 233, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, + + 234, 234, 234, 234, 235, 235, 235, 235, + 235, 235, 235, 236, 237, 238, 239, 239, + 149, 149, 149, 149, 149, 149, 235, 235, + 235, 235, 235, 240, 235, 235, 241, 242, + + 235, 243, 244, 244, 244, 244, 245, 244, + 245, 244, 245, 245, 245, 245, 245, 244, + 244, 244, 244, 245, 245, 245, 245, 245, + 245, 245, 245, 235, 235, 235, 235, 235, + + 246, 245, 245, 245, 245, 245, 245, 245, + 244, 245, 245, 247, 248, 249, 250, 251, + 252, 253, 254, 146, 146, 147, 150, 149, + 149, 153, 153, 153, 152, 153, 153, 235, + + 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 266, 267, 268, 268, + 269, 244, 244, 244, 243, 244, 244, 244, + 245, 245, 245, 245, 245, 245, 245, 245, + + 245, 245, 245, 245, 245, 245, 245, 245, + 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 245, 245, 245, 245, 245, 245, + + 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, + 270, 270, 245, 245, 245, 245, 245, 270, + + 244, 245, 245, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 245, 244, 245, 271, + 245, 245, 244, 244, 242, 244, 139, 139, + 139, 139, 139, 139, 139, 272, 273, 139, + + 139, 139, 139, 141, 139, 274, 274, 139, + 139, 49, 141, 139, 139, 141, 275, 275, + 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 270, 270, 270, 276, 276, 277, + + 278, 278, 278, 279, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 235, 280, + 271, 281, 270, 270, 270, 271, 271, 271, + 271, 271, 270, 270, 270, 270, 271, 270, + + 270, 270, 270, 270, 270, 270, 270, 270, + 271, 270, 271, 270, 271, 277, 277, 275, + 146, 147, 146, 146, 147, 146, 146, 147, + 147, 147, 146, 147, 147, 146, 147, 146, + + 146, 146, 147, 146, 147, 146, 147, 146, + 147, 146, 146, 235, 235, 275, 277, 277, + 282, 282, 282, 282, 282, 282, 282, 282, + 282, 283, 283, 283, 282, 282, 282, 282, + + 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 283, 283, 282, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, + + 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, + + 284, 284, 284, 284, 284, 284, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, + 285, 286, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, + + 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, + + 297, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 298, 298, 298, 298, 298, + 298, 298, 299, 298, 300, 300, 301, 302, + 303, 304, 305, 205, 205, 205, 205, 205, + + 205, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, + + 160, 306, 306, 307, 308, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 160, 160, 309, 90, 307, 307, + + 307, 306, 306, 306, 306, 306, 306, 306, + 306, 307, 307, 307, 307, 310, 160, 160, + 90, 139, 141, 139, 139, 160, 160, 160, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 306, 306, 311, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 199, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 322, 322, 323, 322, 322, + + 160, 306, 307, 307, 160, 90, 90, 90, + 90, 90, 90, 90, 90, 160, 160, 90, + 90, 160, 160, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 160, 160, 160, 90, 90, + 90, 90, 160, 160, 309, 308, 324, 307, + + 307, 306, 306, 306, 306, 160, 160, 307, + 307, 160, 160, 307, 307, 310, 323, 160, + 160, 160, 160, 160, 160, 160, 160, 324, + 160, 160, 160, 160, 90, 90, 160, 90, + + 90, 90, 306, 306, 160, 160, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 90, 90, 12, 12, 325, 325, 325, 325, + 325, 325, 194, 160, 160, 160, 160, 160, + + 160, 326, 306, 327, 160, 90, 90, 90, + 90, 90, 90, 160, 160, 160, 160, 90, + 90, 160, 160, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 160, 90, 90, 160, + 90, 90, 160, 160, 309, 160, 307, 307, + + 307, 306, 306, 160, 160, 160, 160, 306, + 306, 160, 160, 306, 306, 310, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 90, 90, 90, 90, 160, 90, 160, + + 160, 160, 160, 160, 160, 160, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 306, 306, 90, 90, 90, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 306, 306, 307, 160, 90, 90, 90, + 90, 90, 90, 90, 308, 90, 160, 90, + 90, 90, 160, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 160, 90, 90, 90, + 90, 90, 160, 160, 309, 90, 307, 307, + + 307, 306, 306, 306, 306, 306, 160, 306, + 306, 307, 160, 307, 307, 310, 160, 160, + 90, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 90, 308, 326, 326, 160, 160, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 160, 328, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 160, 308, 90, 90, + 90, 90, 160, 160, 309, 90, 324, 306, + + 307, 306, 306, 306, 160, 160, 160, 307, + 307, 160, 160, 307, 307, 310, 160, 160, + 160, 160, 160, 160, 160, 160, 306, 324, + 160, 160, 160, 160, 90, 90, 160, 90, + + 90, 90, 160, 160, 160, 160, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 194, 308, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 306, 90, 160, 90, 90, 90, + 90, 90, 90, 160, 160, 160, 90, 90, + 90, 160, 90, 90, 90, 90, 160, 160, + 160, 90, 90, 160, 90, 160, 90, 90, + + 160, 160, 160, 90, 90, 160, 160, 160, + 90, 90, 90, 160, 160, 160, 90, 90, + 90, 90, 90, 90, 90, 90, 323, 90, + 90, 90, 160, 160, 160, 160, 324, 307, + + 306, 307, 307, 160, 160, 160, 307, 307, + 307, 160, 307, 307, 307, 310, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 324, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 329, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 325, 325, 325, 239, 239, 239, 239, 239, + 239, 328, 239, 160, 160, 160, 160, 160, + + 160, 307, 307, 307, 160, 90, 90, 90, + 90, 90, 90, 90, 90, 160, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 160, 90, 90, 90, + 90, 90, 160, 160, 160, 160, 306, 306, + + 306, 307, 307, 307, 307, 160, 306, 306, + 306, 160, 306, 306, 306, 310, 160, 160, + 160, 160, 160, 160, 160, 330, 331, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 90, 90, 160, 160, 160, 160, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 307, 307, 160, 90, 90, 90, + 90, 90, 90, 90, 90, 160, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 160, 90, 90, 90, + 90, 90, 160, 160, 332, 308, 307, 333, + + 307, 307, 324, 307, 307, 160, 333, 307, + 307, 160, 307, 307, 306, 310, 160, 160, + 160, 160, 160, 160, 160, 324, 324, 160, + 160, 160, 160, 160, 160, 160, 90, 160, + + 90, 90, 334, 334, 160, 160, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, + 160, 301, 301, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 160, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 160, 160, 160, 160, 324, 307, + + 307, 306, 306, 306, 160, 160, 307, 307, + 307, 160, 307, 307, 307, 310, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 324, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 335, 335, 160, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 160, + 160, 160, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 160, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 160, 336, 160, 160, + + 336, 336, 336, 336, 336, 336, 336, 160, + 160, 160, 337, 160, 160, 160, 160, 338, + 335, 335, 285, 285, 285, 160, 285, 160, + 335, 335, 335, 335, 335, 335, 335, 338, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 335, 335, 339, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 340, 340, 340, + 340, 341, 340, 340, 341, 341, 341, 341, + 342, 342, 343, 160, 160, 160, 160, 12, + + 340, 340, 340, 340, 340, 340, 344, 341, + 345, 345, 345, 345, 341, 341, 341, 199, + 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 346, 346, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 340, 340, 160, 340, 160, 160, 340, + 340, 160, 340, 160, 160, 340, 160, 160, + 160, 160, 160, 160, 340, 340, 340, 340, + 160, 340, 340, 340, 340, 340, 340, 340, + + 160, 340, 340, 340, 160, 340, 160, 340, + 160, 160, 340, 340, 160, 340, 340, 340, + 340, 341, 340, 340, 341, 341, 341, 341, + 347, 347, 160, 341, 341, 340, 160, 160, + + 340, 340, 340, 340, 340, 160, 344, 160, + 348, 348, 348, 348, 341, 341, 160, 160, + 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 160, 160, 340, 340, 160, 160, + + 349, 350, 350, 350, 351, 352, 351, 351, + 353, 351, 351, 354, 353, 355, 355, 355, + 355, 355, 353, 356, 357, 356, 356, 356, + 206, 206, 356, 356, 356, 356, 356, 356, + + 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 368, 368, 368, 368, 368, + 368, 368, 368, 368, 369, 206, 356, 206, + 356, 370, 371, 372, 371, 372, 373, 373, + + 349, 349, 349, 349, 349, 349, 349, 349, + 160, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, + + 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 336, 160, 160, 160, 160, 160, + 160, 374, 375, 376, 377, 376, 376, 376, + 376, 376, 375, 375, 375, 375, 376, 378, + + 375, 376, 207, 207, 379, 354, 207, 207, + 349, 349, 349, 349, 160, 160, 160, 160, + 376, 376, 376, 376, 376, 376, 285, 376, + 160, 376, 376, 376, 376, 376, 376, 376, + + 376, 376, 376, 376, 376, 376, 376, 376, + 376, 376, 376, 376, 376, 376, 285, 285, + 285, 376, 376, 376, 376, 376, 376, 376, + 285, 376, 285, 285, 285, 160, 380, 380, + + 381, 381, 381, 381, 381, 381, 147, 381, + 381, 381, 381, 381, 381, 160, 160, 381, + 382, 382, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, + + 383, 383, 160, 383, 383, 383, 383, 383, + 160, 383, 383, 160, 384, 385, 385, 385, + 385, 384, 385, 160, 160, 160, 385, 386, + 384, 387, 160, 160, 160, 160, 160, 160, + + 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 398, 339, 339, 339, 339, + 383, 383, 383, 383, 383, 383, 384, 384, + 385, 385, 160, 160, 160, 160, 160, 160, + + 399, 399, 399, 399, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, + 399, 399, 399, 399, 399, 399, 399, 399, + + 399, 399, 399, 399, 399, 399, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 400, + 400, 323, 323, 199, 401, 160, 160, 160, + + 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, + + 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 160, 160, 160, 160, 160, 402, + + 403, 403, 403, 403, 403, 403, 403, 403, + 403, 403, 403, 403, 403, 403, 403, 403, + 403, 403, 403, 403, 403, 403, 403, 403, + 403, 403, 403, 403, 403, 403, 403, 403, + + 403, 403, 403, 160, 160, 160, 160, 160, + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 404, 404, 404, 404, 404, 404, + 404, 404, 160, 160, 160, 160, 160, 160, + + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 160, 336, 336, 336, 336, 160, 160, + 336, 336, 336, 336, 336, 336, 336, 160, + 336, 160, 336, 336, 336, 336, 160, 160, + + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 160, 336, 336, 336, 336, 160, 160, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 160, 336, 336, 336, 336, 160, 160, + 336, 336, 336, 336, 336, 336, 336, 160, + + 336, 160, 336, 336, 336, 336, 160, 160, + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 336, 336, 336, 336, 336, 336, 160, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 160, 336, 336, 336, 336, 160, 160, + 336, 336, 336, 336, 336, 336, 336, 323, + + 336, 336, 336, 336, 336, 336, 336, 323, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 160, 160, 160, 160, 153, + + 405, 406, 407, 339, 339, 339, 339, 407, + 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 417, 417, 417, 417, 417, + 417, 417, 417, 417, 417, 160, 160, 160, + + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 160, 160, 160, 160, 160, 160, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 339, 407, 336, + 336, 336, 336, 336, 336, 336, 336, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 419, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 420, 421, 160, 160, 160, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 406, 406, 406, 422, 422, + 422, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 400, 400, 160, 400, 400, + 400, 400, 423, 423, 424, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 423, 423, 424, 425, 425, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 423, 423, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 400, 400, 160, 400, 400, + 400, 160, 423, 423, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 426, 426, 384, 385, + 385, 385, 385, 385, 385, 385, 384, 384, + + 384, 384, 384, 384, 384, 384, 385, 384, + 384, 385, 385, 385, 385, 385, 385, 385, + 385, 385, 387, 385, 406, 406, 427, 428, + 406, 339, 406, 429, 383, 430, 160, 160, + + 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 160, 160, 160, 160, 160, 160, + 431, 431, 431, 431, 431, 431, 431, 431, + 431, 431, 160, 160, 160, 160, 160, 160, + + 432, 432, 433, 434, 433, 433, 435, 432, + 433, 434, 432, 285, 285, 285, 436, 160, + 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 160, 160, 160, 160, 160, 160, + + 336, 336, 336, 137, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 336, + 160, 160, 160, 160, 160, 160, 160, 160, + + 336, 336, 336, 336, 336, 336, 336, 336, + 336, 437, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 160, 160, 160, + + 326, 326, 326, 327, 327, 327, 327, 326, + 326, 438, 438, 438, 160, 160, 160, 160, + 327, 327, 326, 327, 327, 327, 327, 327, + 327, 439, 149, 150, 160, 160, 160, 160, + + 239, 160, 160, 160, 440, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, + 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, + + 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 160, 160, + 451, 451, 451, 451, 451, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 452, 452, 452, 452, 452, 452, 452, 452, + 452, 452, 452, 452, 452, 452, 452, 452, + 452, 452, 452, 452, 452, 452, 452, 452, + 452, 452, 452, 452, 452, 452, 452, 452, + + 452, 452, 452, 452, 452, 452, 452, 452, + 452, 452, 160, 160, 160, 160, 160, 160, + 453, 453, 453, 453, 453, 453, 453, 453, + 453, 453, 453, 453, 453, 453, 453, 453, + + 453, 452, 452, 452, 452, 452, 452, 452, + 453, 453, 160, 160, 160, 160, 160, 160, + 329, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 160, 160, 160, 160, 463, 463, + + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 153, + 152, 464, 464, 464, 160, 160, 465, 466, + + 334, 334, 334, 334, 467, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 468, 467, 334, 334, + 334, 334, 334, 467, 334, 467, 467, 467, + + 467, 467, 334, 467, 469, 322, 322, 322, + 322, 322, 322, 322, 160, 160, 160, 160, + 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 480, 481, 481, 480, 480, + + 481, 482, 482, 482, 482, 482, 482, 482, + 482, 482, 482, 298, 299, 298, 298, 298, + 298, 298, 298, 298, 482, 482, 482, 482, + 482, 482, 482, 482, 482, 160, 160, 160, + + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 483, 483, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, + + 483, 483, 483, 483, 483, 483, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, + 483, 483, 483, 483, 483, 483, 483, 483, + + 483, 483, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, + 484, 103, 103, 103, 103, 485, 103, 103, + + 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 484, 484, 484, 484, 484, + + 484, 484, 484, 484, 484, 484, 484, 484, + 484, 484, 484, 484, 484, 484, 484, 484, + 484, 484, 484, 484, 484, 484, 484, 484, + 484, 484, 484, 484, 484, 484, 484, 484, + + 153, 153, 152, 153, 298, 298, 298, 298, + 298, 298, 299, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 298, 299, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 486, 487, + 488, 489, 490, 491, 160, 160, 160, 160, + + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 65, 66, 65, 66, 65, 66, + 65, 66, 160, 160, 160, 160, 160, 160, + + 492, 492, 492, 492, 492, 492, 492, 492, + 493, 493, 493, 493, 493, 493, 493, 493, + 492, 492, 492, 492, 492, 492, 160, 160, + 493, 493, 493, 493, 493, 493, 160, 160, + + 492, 492, 492, 492, 492, 492, 492, 492, + 493, 493, 493, 493, 493, 493, 493, 493, + 492, 492, 492, 492, 492, 492, 492, 492, + 493, 493, 493, 493, 493, 493, 493, 493, + + 492, 492, 492, 492, 492, 492, 160, 160, + 493, 493, 493, 493, 493, 493, 160, 160, + 494, 492, 495, 492, 496, 492, 497, 492, + 160, 493, 160, 493, 160, 493, 160, 493, + + 492, 492, 492, 492, 492, 492, 492, 492, + 493, 493, 493, 493, 493, 493, 493, 493, + 498, 498, 499, 499, 499, 499, 500, 500, + 501, 501, 502, 502, 503, 503, 160, 160, + + 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, + 528, 529, 530, 531, 532, 533, 534, 535, + + 536, 537, 538, 539, 540, 541, 542, 543, + 544, 545, 546, 547, 548, 549, 550, 551, + 492, 492, 552, 553, 554, 160, 555, 556, + 493, 493, 557, 557, 558, 42, 559, 42, + + 42, 42, 560, 561, 562, 160, 563, 564, + 565, 565, 565, 565, 566, 42, 42, 42, + 492, 492, 567, 166, 160, 160, 568, 569, + 493, 493, 570, 570, 160, 42, 42, 42, + + 492, 492, 571, 169, 572, 182, 573, 574, + 493, 493, 575, 575, 576, 42, 42, 42, + 160, 160, 577, 578, 579, 160, 580, 581, + 582, 582, 583, 583, 584, 42, 42, 160, + + 585, 585, 585, 585, 585, 585, 585, 586, + 585, 585, 585, 587, 588, 589, 590, 591, + 592, 593, 592, 592, 594, 595, 14, 14, + 596, 597, 598, 599, 596, 600, 598, 599, + + 14, 14, 14, 14, 601, 601, 601, 602, + 603, 604, 605, 606, 607, 608, 609, 610, + 13, 13, 13, 13, 13, 611, 611, 611, + 14, 596, 600, 14, 612, 612, 14, 43, + + 43, 14, 14, 14, 613, 16, 17, 614, + 615, 615, 432, 432, 432, 432, 616, 616, + 616, 616, 185, 617, 618, 619, 620, 616, + 620, 620, 620, 620, 619, 620, 620, 621, + + 622, 623, 623, 623, 160, 160, 160, 160, + 160, 160, 624, 624, 624, 624, 624, 624, + 625, 626, 160, 160, 627, 628, 629, 630, + 631, 632, 633, 633, 36, 16, 17, 50, + + 625, 60, 55, 56, 627, 628, 629, 630, + 631, 632, 633, 633, 36, 16, 17, 160, + 484, 484, 484, 484, 484, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 12, 12, 12, 12, 12, 12, 12, 48, + 12, 12, 12, 634, 635, 429, 429, 429, + 636, 636, 637, 637, 637, 637, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 139, 139, 144, 144, 139, 139, 139, 139, + 144, 144, 144, 139, 139, 273, 273, 273, + + 273, 139, 195, 195, 638, 639, 639, 159, + 640, 159, 639, 641, 299, 299, 299, 299, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 49, 49, 175, 642, 49, 49, 49, 175, + 49, 642, 50, 175, 175, 175, 50, 50, + 175, 175, 175, 50, 49, 175, 643, 49, + 49, 175, 175, 175, 175, 175, 49, 49, + + 49, 49, 49, 49, 175, 49, 644, 49, + 175, 49, 645, 646, 175, 175, 647, 50, + 175, 175, 648, 175, 50, 90, 90, 90, + 90, 131, 649, 239, 103, 626, 650, 650, + + 185, 185, 185, 185, 185, 650, 626, 626, + 626, 626, 651, 185, 418, 301, 652, 160, + 160, 160, 160, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, + + 653, 653, 653, 653, 653, 653, 653, 653, + 653, 653, 653, 653, 653, 653, 653, 653, + 654, 654, 654, 654, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, + + 655, 655, 655, 99, 109, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 36, 36, 36, 36, 36, 49, 49, 49, + 49, 49, 36, 36, 49, 49, 49, 49, + + 36, 49, 49, 36, 49, 49, 36, 49, + 49, 49, 49, 49, 49, 49, 36, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 36, 36, + 49, 49, 36, 49, 36, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + + 36, 36, 36, 36, 36, 36, 36, 36, + 656, 656, 656, 657, 657, 657, 36, 36, + 36, 36, 18, 54, 36, 658, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 659, 660, 36, 36, + + 36, 36, 36, 661, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 659, 660, 659, 660, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + + 36, 36, 36, 36, 659, 660, 659, 660, + 659, 660, 659, 660, 36, 36, 659, 660, + 659, 660, 659, 660, 659, 660, 659, 660, + 659, 660, 659, 660, 659, 660, 659, 660, + + 659, 660, 659, 660, 659, 660, 659, 660, + 659, 660, 659, 660, 36, 36, 36, 659, + 660, 659, 660, 36, 36, 36, 36, 36, + 662, 36, 36, 36, 36, 36, 36, 36, + + 36, 36, 659, 660, 36, 36, 663, 36, + 664, 665, 36, 665, 36, 36, 36, 36, + 659, 660, 659, 660, 659, 660, 659, 660, + 36, 36, 36, 36, 36, 36, 36, 36, + + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 659, 660, 659, 660, 666, 36, 36, + 659, 660, 36, 36, 36, 36, 659, 660, + 659, 660, 659, 660, 659, 660, 659, 660, + + 659, 660, 659, 660, 659, 660, 659, 660, + 659, 660, 659, 660, 659, 660, 36, 36, + 659, 660, 667, 667, 667, 185, 668, 668, + 185, 185, 669, 669, 669, 670, 670, 185, + + 49, 649, 49, 49, 49, 49, 49, 49, + 659, 660, 659, 660, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 36, 36, 49, 49, 49, 49, 49, 49, + 49, 16, 17, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 649, 185, 649, 649, 649, + + 649, 649, 649, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 381, 649, 649, + 649, 649, 649, 185, 185, 185, 185, 185, + + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 651, 651, 651, 651, + 651, 651, 651, 651, 651, 651, 651, 651, + + 651, 651, 651, 651, 651, 651, 651, 651, + 651, 651, 651, 651, 651, 651, 651, 239, + 239, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 671, 671, 671, 671, + + 671, 671, 301, 301, 301, 301, 301, 301, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 649, 649, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 672, 673, 674, 675, 676, 677, 678, 679, + 680, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 62, 62, 62, + + 62, 62, 62, 62, 62, 62, 62, 62, + 60, 55, 56, 627, 628, 629, 630, 631, + 632, 681, 681, 681, 681, 681, 681, 681, + 681, 681, 681, 681, 194, 194, 194, 194, + + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, + + 682, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 682, 682, 682, 682, + 683, 683, 683, 683, 683, 683, 683, 683, + 683, 683, 683, 683, 683, 683, 683, 683, + + 683, 683, 683, 683, 683, 683, 683, 683, + 683, 683, 684, 685, 685, 685, 685, 685, + 685, 685, 685, 685, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 685, 695, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 651, 651, + 651, 651, 651, 651, 651, 651, 651, 651, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 36, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 36, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 649, 649, 649, 649, 649, 649, 649, 649, + 185, 185, 185, 185, 185, 185, 185, 185, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 239, 239, 651, 651, + 418, 649, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 36, + 649, 649, 651, 651, 651, 651, 651, 651, + 651, 651, 651, 651, 651, 651, 418, 418, + + 651, 651, 651, 651, 651, 651, 651, 651, + 651, 651, 239, 239, 239, 239, 239, 239, + 239, 239, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 160, 160, 160, + + 239, 239, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 405, 418, 418, 418, + 418, 418, 301, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 49, 49, 49, 49, 160, 49, 49, + 49, 49, 160, 160, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 160, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 160, 49, 160, 49, + 49, 49, 49, 160, 160, 160, 49, 160, + 49, 49, 49, 696, 696, 696, 696, 160, + + 160, 49, 697, 697, 49, 49, 49, 49, + 698, 699, 698, 699, 698, 699, 698, 699, + 698, 699, 698, 699, 698, 699, 672, 673, + 674, 675, 676, 677, 678, 679, 680, 62, + + 672, 673, 674, 675, 676, 677, 678, 679, + 680, 62, 672, 673, 674, 675, 676, 677, + 678, 679, 680, 62, 49, 160, 160, 160, + 49, 49, 49, 49, 49, 49, 49, 49, + + 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, + 160, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 160, + + 700, 700, 700, 701, 702, 703, 704, 671, + 671, 671, 671, 160, 160, 160, 160, 160, + 185, 185, 185, 185, 185, 705, 706, 185, + 185, 185, 185, 185, 185, 705, 706, 185, + + 185, 185, 705, 706, 705, 706, 698, 699, + 698, 699, 698, 699, 160, 160, 160, 160, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + + 381, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, + 381, 381, 381, 381, 381, 381, 381, 381, + + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + + 185, 185, 185, 698, 699, 698, 699, 698, + 699, 698, 699, 698, 699, 707, 708, 709, + 710, 698, 699, 698, 699, 698, 699, 698, + 699, 185, 185, 185, 185, 185, 185, 185, + + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 711, 185, 185, 185, 185, 185, 185, 185, + + 705, 706, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 705, + 706, 705, 706, 185, 705, 706, 185, 185, + 698, 699, 698, 699, 185, 185, 185, 185, + + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 712, 185, 185, + 705, 706, 185, 185, 698, 699, 185, 185, + + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 705, 706, 705, 706, 185, + 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 185, 705, 706, 185, 185, + + 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, + 185, 705, 706, 185, 185, 705, 706, 705, + + 706, 705, 706, 705, 706, 185, 185, 185, + 185, 185, 185, 705, 706, 185, 185, 185, + 185, 705, 706, 705, 706, 705, 706, 705, + 706, 705, 706, 705, 706, 185, 185, 185, + + 185, 705, 706, 185, 185, 185, 705, 706, + 705, 706, 705, 706, 705, 706, 185, 705, + 706, 185, 185, 705, 706, 185, 185, 185, + 185, 185, 185, 705, 706, 705, 706, 705, + + 706, 705, 706, 705, 706, 705, 706, 185, + 185, 185, 185, 185, 185, 705, 706, 705, + 706, 705, 706, 705, 706, 705, 706, 185, + 185, 185, 185, 185, 185, 185, 713, 185, + + 185, 185, 185, 714, 715, 714, 185, 185, + 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 705, + 706, 705, 706, 185, 185, 185, 185, 185, + + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 418, 418, + 418, 418, 418, 418, 301, 301, 301, 301, + 301, 301, 301, 160, 160, 160, 160, 160, + + 301, 301, 301, 301, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 716, 716, 716, 716, 716, 716, 716, 716, + 716, 716, 716, 716, 716, 716, 716, 716, + 716, 716, 716, 716, 716, 716, 716, 716, + 716, 716, 716, 716, 716, 716, 716, 716, + + 716, 716, 716, 716, 716, 716, 716, 716, + 716, 716, 716, 716, 716, 716, 716, 160, + 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 717, + + 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 160, + + 113, 109, 718, 719, 720, 721, 722, 113, + 109, 113, 109, 113, 109, 160, 160, 160, + 160, 160, 160, 160, 723, 113, 109, 723, + 160, 160, 160, 160, 160, 160, 160, 160, + + 105, 106, 105, 106, 105, 106, 105, 106, + 105, 106, 105, 106, 105, 106, 105, 106, + 105, 106, 105, 106, 105, 106, 105, 106, + 105, 106, 105, 106, 105, 106, 105, 106, + + 105, 106, 105, 106, 103, 418, 418, 418, + 418, 418, 418, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 620, 620, 620, 620, 724, 620, 620, + + 725, 725, 725, 725, 725, 725, 725, 725, + 725, 725, 725, 725, 725, 725, 725, 725, + 725, 725, 725, 725, 725, 725, 725, 725, + 725, 725, 725, 725, 725, 725, 725, 725, + + 725, 725, 725, 725, 725, 725, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + + 323, 323, 323, 323, 323, 323, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 401, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 323, 323, 323, 323, 323, 323, 323, 160, + 323, 323, 323, 323, 323, 323, 323, 160, + 323, 323, 323, 323, 323, 323, 323, 160, + 323, 323, 323, 323, 323, 323, 323, 160, + + 726, 726, 727, 728, 727, 728, 726, 726, + 726, 727, 728, 726, 727, 728, 620, 620, + 620, 620, 620, 620, 620, 620, 619, 729, + 160, 160, 160, 160, 727, 728, 160, 160, + + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 160, 730, 730, 730, 730, 730, + + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 160, 160, 160, 160, + + 731, 732, 733, 734, 735, 736, 737, 738, + 16, 17, 16, 17, 16, 17, 16, 17, + 16, 17, 735, 735, 16, 17, 16, 17, + 16, 17, 16, 17, 739, 16, 17, 740, + + 735, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 741, 742, 140, 743, 744, 744, + 745, 746, 746, 746, 746, 746, 735, 735, + 747, 747, 747, 748, 749, 750, 730, 735, + + 160, 751, 737, 751, 737, 751, 737, 751, + 737, 751, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + + 737, 737, 737, 751, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + + 737, 737, 737, 751, 737, 751, 737, 751, + 737, 737, 737, 737, 737, 737, 751, 737, + 737, 737, 737, 737, 737, 752, 752, 160, + 160, 753, 753, 754, 754, 755, 755, 756, + + 757, 758, 759, 758, 759, 758, 759, 758, + 759, 758, 759, 759, 759, 759, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + + 759, 759, 759, 758, 759, 759, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + + 759, 759, 759, 758, 759, 758, 759, 758, + 759, 759, 759, 759, 759, 759, 758, 759, + 759, 759, 759, 759, 759, 758, 758, 759, + 759, 759, 759, 760, 761, 761, 761, 762, + + 160, 160, 160, 160, 160, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 160, 160, 160, + 160, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, + + 763, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 160, + 764, 764, 765, 765, 765, 765, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + 160, 160, 160, 160, 160, 160, 160, 160, + + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 769, 769, 160, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + + 764, 764, 764, 764, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 769, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 769, 769, 767, 764, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 770, 770, 770, 770, 770, 770, 770, + 770, 770, 770, 770, 770, 770, 770, 770, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 769, 769, 769, 769, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 160, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 769, + 769, 769, 769, 764, 764, 764, 764, 764, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 769, 769, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 769, + + 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, + + 737, 737, 737, 737, 737, 737, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 160, 160, 160, 160, + + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 773, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 766, 766, 766, + + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 766, 766, 766, 160, 160, 160, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + + 730, 730, 774, 774, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 774, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730, + + 730, 774, 730, 730, 730, 774, 730, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 776, + 776, 776, 776, 160, 160, 160, 160, 160, + + 777, 777, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 323, 323, 778, 323, 323, 323, 779, 323, + 323, 323, 323, 780, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, + + 323, 323, 323, 464, 464, 780, 780, 464, + 418, 418, 418, 418, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 781, 781, 304, 304, + 160, 160, 160, 160, 160, 160, 160, 160, + + 782, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 782, 783, 783, 783, + + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 782, 783, 783, 783, 783, 783, 783, 783, + + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 782, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 782, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 782, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + + 783, 783, 783, 783, 783, 783, 783, 783, + 782, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + + 783, 783, 783, 783, 782, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, + + 783, 783, 783, 783, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + + 785, 785, 785, 785, 785, 785, 785, 785, + 785, 785, 785, 785, 785, 785, 785, 785, + 785, 785, 785, 785, 785, 785, 785, 785, + 785, 785, 785, 785, 785, 785, 785, 785, + + 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 160, 160, + 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, + + 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 786, 786, 786, 786, 786, + + 786, 786, 786, 786, 786, 786, 786, 786, + 786, 786, 786, 160, 160, 160, 160, 160, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 160, 160, 160, 160, 160, 160, + + 787, 788, 789, 790, 791, 792, 792, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 793, 794, 795, 796, 797, + 160, 160, 160, 160, 160, 798, 799, 231, + + 231, 231, 231, 231, 231, 231, 231, 231, + 231, 633, 231, 231, 231, 231, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 205, + 231, 231, 231, 231, 231, 205, 231, 205, + + 231, 231, 205, 231, 231, 205, 231, 231, + 231, 231, 231, 231, 231, 231, 231, 231, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, + + 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 598, 740, + + 235, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 235, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 235, 235, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + + 243, 243, 243, 243, 243, 243, 243, 243, + 235, 235, 235, 235, 235, 235, 235, 235, + 800, 800, 800, 800, 800, 800, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, + + 800, 800, 800, 800, 800, 800, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 801, 239, 235, 235, + + 423, 423, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 423, + 802, 803, 803, 802, 802, 804, 804, 805, + 806, 807, 160, 160, 160, 160, 160, 160, + + 139, 139, 139, 139, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 734, 745, 745, 808, 808, 598, 740, 598, + 740, 598, 740, 598, 740, 598, 740, 598, + + 740, 598, 740, 598, 740, 750, 750, 809, + 810, 734, 734, 734, 734, 808, 808, 808, + 811, 734, 812, 160, 760, 813, 9, 9, + 745, 16, 17, 16, 17, 16, 17, 814, + + 734, 734, 815, 816, 817, 818, 819, 160, + 734, 12, 13, 734, 160, 160, 160, 160, + 243, 243, 243, 286, 243, 235, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 235, 235, 820, + + 160, 9, 734, 814, 12, 13, 734, 734, + 16, 17, 734, 815, 811, 816, 812, 821, + 822, 823, 824, 825, 826, 827, 828, 829, + 830, 831, 813, 760, 832, 819, 833, 9, + + 734, 834, 834, 834, 834, 834, 834, 834, + 834, 834, 834, 834, 834, 834, 834, 834, + 834, 834, 834, 834, 834, 834, 834, 834, + 834, 834, 834, 39, 734, 41, 835, 808, + + 835, 836, 836, 836, 836, 836, 836, 836, + 836, 836, 836, 836, 836, 836, 836, 836, + 836, 836, 836, 836, 836, 836, 836, 836, + 836, 836, 836, 39, 819, 41, 819, 698, + + 699, 733, 16, 17, 732, 760, 837, 758, + 758, 758, 758, 758, 758, 758, 758, 758, + 761, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 761, 761, + + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 160, + + 160, 160, 90, 90, 90, 90, 90, 90, + 160, 160, 90, 90, 90, 90, 90, 90, + 160, 160, 90, 90, 90, 90, 90, 90, + 160, 160, 90, 90, 90, 160, 160, 160, + + 48, 12, 819, 835, 735, 12, 12, 160, + 49, 36, 36, 36, 36, 49, 49, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 838, 838, 838, 839, 49, 840, 840, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 160, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + + 308, 308, 308, 308, 308, 308, 308, 160, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 160, 308, 308, 160, 308, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 160, 160, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 160, 160, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 160, 160, 160, 160, 160, + + 841, 842, 843, 160, 160, 160, 160, 844, + 844, 844, 844, 844, 844, 844, 844, 844, + 844, 844, 844, 844, 844, 844, 844, 844, + 844, 844, 844, 844, 844, 844, 844, 844, + + 844, 844, 844, 844, 844, 844, 844, 844, + 844, 844, 844, 844, 844, 844, 844, 844, + 844, 844, 844, 844, 160, 160, 160, 845, + 845, 845, 845, 845, 845, 845, 845, 845, + + 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, + + 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 846, 846, 846, + 846, 846, 846, 846, 846, 724, 724, 724, + 724, 418, 418, 418, 418, 418, 418, 418, + + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 724, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 160, + + 848, 848, 848, 848, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + + 847, 849, 847, 847, 847, 847, 847, 847, + 847, 847, 849, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 160, 841, + + 323, 323, 323, 323, 160, 160, 160, 160, + 323, 323, 323, 323, 323, 323, 323, 323, + 465, 850, 850, 850, 850, 850, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 852, 852, + 853, 853, 853, 853, 853, 853, 853, 853, + 853, 853, 853, 853, 853, 853, 853, 853, + 853, 853, 853, 853, 853, 853, 853, 853, + + 853, 853, 853, 853, 853, 853, 853, 853, + 853, 853, 853, 853, 853, 853, 854, 854, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 160, 160, + + 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 855, 855, 855, 855, 855, 855, 205, 205, + 855, 205, 855, 855, 855, 855, 855, 855, + 855, 855, 855, 855, 855, 855, 855, 855, + 855, 855, 855, 855, 855, 855, 855, 855, + + 855, 855, 855, 855, 855, 855, 855, 855, + 855, 855, 855, 855, 855, 855, 855, 855, + 855, 855, 855, 855, 855, 855, 205, 855, + 855, 205, 205, 205, 855, 205, 205, 855, + + 856, 856, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 857, 857, + 857, 857, 205, 205, 205, 205, 205, 858, + + 859, 780, 780, 780, 205, 780, 780, 205, + 205, 205, 205, 205, 780, 152, 780, 153, + 859, 859, 859, 859, 205, 859, 859, 859, + 205, 859, 859, 859, 859, 859, 859, 859, + + 859, 859, 859, 859, 859, 859, 859, 859, + 859, 859, 859, 859, 859, 859, 859, 859, + 859, 859, 859, 859, 205, 205, 205, 205, + 153, 641, 152, 205, 205, 205, 205, 779, + + 860, 861, 862, 863, 864, 864, 864, 864, + 205, 205, 205, 205, 205, 205, 205, 205, + 865, 865, 865, 865, 865, 865, 865, 865, + 866, 205, 205, 205, 205, 205, 205, 205, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 322, 322, 322, 322, 322, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 481, 481, 481, 481, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 160, + 160, 160, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 869, 870, 871, + 871, 871, 868, 868, 868, 872, 869, 869, + 869, 869, 869, 873, 873, 873, 873, 873, + 873, 873, 873, 874, 874, 874, 874, 874, + 874, 874, 874, 868, 868, 875, 875, 875, + 875, 875, 874, 874, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 875, 875, 875, 875, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 153, 153, 153, 418, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 239, + 239, 239, 239, 239, 239, 239, 239, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 876, 876, 876, 876, 876, 876, 876, 876, + 876, 876, 876, 876, 876, 876, 876, 876, + 876, 876, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 160, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 877, 160, 877, 877, + 160, 160, 877, 160, 160, 877, 877, 160, + 160, 877, 877, 877, 877, 160, 877, 877, + 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 160, 878, 160, 878, 878, 878, + 878, 102, 878, 878, 160, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + + 878, 878, 878, 878, 877, 877, 160, 877, + 877, 877, 877, 160, 160, 877, 877, 877, + 877, 877, 877, 877, 877, 160, 877, 877, + 877, 877, 877, 877, 877, 160, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 877, 877, 160, 877, 877, 877, 877, 160, + 877, 877, 877, 877, 877, 160, 877, 160, + 160, 160, 877, 877, 877, 877, 877, 877, + 877, 160, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + + 878, 878, 878, 878, 878, 878, 878, 878, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 103, 103, 160, 160, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 879, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 879, 878, 878, 878, 878, + 878, 878, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 879, 878, 878, 878, 878, + + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 879, 878, 878, + 878, 878, 878, 878, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 879, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 879, + 878, 878, 878, 878, 878, 878, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 879, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 879, 878, 878, 878, 878, 878, 878, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 879, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 879, 878, 878, 878, 878, + 878, 878, 880, 723, 160, 160, 881, 882, + 883, 884, 885, 886, 887, 888, 889, 890, + 881, 882, 883, 884, 885, 886, 887, 888, + 889, 890, 881, 882, 883, 884, 885, 886, + 887, 888, 889, 890, 881, 882, 883, 884, + 885, 886, 887, 888, 889, 890, 881, 882, + 883, 884, 885, 886, 887, 888, 889, 890, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 891, 891, + + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 892, 892, + 892, 892, 892, 892, 892, 892, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 873, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 873, 873, 873, 873, 873, 873, 873, 873, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 891, 891, }; #define GET_PROP_INDEX(ucs4) \ @@ -3420,907 +3420,906 @@ static const unsigned short uc_property_trie[] = { (uc_property_trie[uc_property_trie[ucs2>>5] + (ucs2 & 0x1f)]) static const Properties uc_properties[] = { - { 10, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 }, - { 10, 15, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3 }, - { 10, 30, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1 }, - { 10, 31, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3 }, - { 10, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3 }, - { 10, 29, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 }, - { 10, 19, 7, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 }, - { 10, 19, 8, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0 }, - { 7, 28, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, - { 26, 5, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, - { 26, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, - { 26, 11, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 28, 8, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 9, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10 }, - { 22, 0, 10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 0, 0, 0, -1, -1, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -232, -232, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 85, 85, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -121, 0, 0, -121, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -300, -300, -268, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 195, 195, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 210, 0, 0, 210, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 206, 0, 0, 206, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 205, 0, 0, 205, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 79, 0, 0, 79, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 202, 0, 0, 202, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 203, 0, 0, 203, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 207, 0, 0, 207, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 97, 97, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 211, 0, 0, 211, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 209, 0, 0, 209, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 163, 163, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 213, 0, 0, 213, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 214, 0, 0, 214, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 218, 0, 0, 218, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 217, 0, 0, 217, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 219, 0, 0, 219, 0, 3, 5 }, - { 19, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 56, 56, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, -1, 0, 1, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -79, -79, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 96, 96, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -97, 0, 0, -97, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -56, 0, 0, -56, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10795, 0, 0, 10795, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -163, 0, 0, -163, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10792, 0, 0, 10792, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -195, 0, 0, -195, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 69, 0, 0, 69, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 71, 0, 0, 71, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -210, -210, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -206, -206, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -205, -205, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -202, -202, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -203, -203, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -207, -207, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -209, -209, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -211, -211, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10743, 10743, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -213, -213, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -214, -214, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10727, 10727, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -218, -218, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -69, -69, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -217, -217, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -71, -71, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -219, -219, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, - { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, - { 18, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 18, 16, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 29, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 18, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 29, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 1, 19, 17, 230, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 232, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 220, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 216, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 202, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 240, 0, -1, 1, 0, 0, 0, 0, 0, 0, 84, 84, 116, 4, 1, 0 }, - { 1, 19, 17, 230, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 220, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 3, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 230, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 220, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 232, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 220, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 230, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 3, 17, 233, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 3, 17, 234, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 3, 17, 233, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 3, 17, 234, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 3, 17, 233, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 230, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 14, 11, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 38, 0, 0, 38, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 37, 0, 0, 37, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 64, 0, 0, 64, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 63, 0, 0, 63, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 88, 88, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -38, -38, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -37, -37, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 92, 92, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -31, -31, 1, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -64, -64, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -63, -63, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -62, -62, -30, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -57, -57, -25, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -47, -47, -15, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -54, -54, -22, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -86, -86, -54, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, -48, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, -96, -96, -64, 0, 3, 4 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4 }, - { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 3, 19, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 15, 0, 0, 15, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -15, -15, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5 }, - { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 52, 49, 0, 0, 3, 4 }, - { 26, 7, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 9 }, - { 21, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 14, 11, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 1, 19, 17, 220, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 230, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 222, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 228, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 10, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 11, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 12, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 13, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 14, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 15, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 16, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 17, 0, -1, 1, 0, 0,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- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 99, 99, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 102, 102, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 105, 105, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 108, 108, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 111, 111, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, -59, -59, -58, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8, 0, 0, -8, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 114, 114, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 117, 117, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 121, 121, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 125, 125, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 74, 74, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 100, 100, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 112, 112, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 126, 126, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 163, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 166, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 169, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 172, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 175, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 178, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 181, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 184, 8, 0, 0, 3, 4 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 163, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 166, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 169, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 172, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 175, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 178, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 181, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 184, 0, -8, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 187, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 190, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 193, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 196, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 199, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 202, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 205, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 208, 8, 0, 0, 3, 4 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 187, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 190, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 193, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 196, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 199, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 202, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 205, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 208, 0, -8, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 211, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 214, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 217, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 220, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 223, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 226, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 229, 8, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 232, 8, 0, 0, 3, 4 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 211, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 214, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 217, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 220, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 223, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 226, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 229, 0, -8, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 232, 0, -8, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 247, 244, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 235, 9, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 253, 250, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 129, 129, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 284, 280, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -74, 0, 0, -74, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 235, 0, -9, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -7205, -7205, -7173, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 259, 256, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 238, 9, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 265, 262, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 132, 132, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 292, 288, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -86, 0, 0, -86, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 238, 0, -9, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 135, 135, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 139, 139, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 142, 142, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -100, 0, 0, -100, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 146, 146, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 150, 150, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 153, 153, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 156, 156, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -112, 0, 0, -112, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 271, 268, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 241, 9, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 277, 274, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 160, 160, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 300, 296, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -128, 0, 0, -128, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -126, 0, 0, -126, 0, 3, 5 }, - { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 241, 0, -9, 0, 3, 5 }, - { 7, 15, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, - { 7, 3, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0,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 28, 8, 4, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 3, 19, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 1, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 220, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 1, 19, 17, 1, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 30, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 30, 8, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7517, 0, 0, -7517, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8383, 0, 0, -8383, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8262, 0, 0, -8262, 0, 3, 5 }, - { 30, 11, 4, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 28, 0, 0, 28, 0, 3, 5 }, - { 30, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 }, - { 30, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -28, -28, 0, 0, 3, 4 }, - { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 16, 0, 0, 16, 0, 3, 5 }, - { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -16, -16, 0, 0, 3, 4 }, - { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2016, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1824, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2104, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2108, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2106, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -138, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0,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- { 23, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, - { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 10 }, - { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, - { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, - { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 10 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1824, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2016, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2104, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2106, 0, 0, 0, 0, 0, 0, 0 }, - { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2108, 0, 0, 0, 0, 0, 0, 0 }, - { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10743, 0, 0, -10743, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -3814, 0, 0, -3814, 0, 3, 5 }, - { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10727, 0, 0, -10727, 0, 3, 5 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10795, -10795, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10792, -10792, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, - { 6, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -7264, -7264, 0, 0, 3, 4 }, - { 26, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, - { 24, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, - { 25, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, - { 21, 15, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 30, 12, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 7, 12, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, - { 26, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 1, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, - { 26, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 30, 12, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 18, 4, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 19, 12, 0, 0, 0, -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, 12, 9, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 18, 15, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 24, 21, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 31, 27, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 39, 35, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 46, 43, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 58, 55, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 64, 61, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 70, 67, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 76, 73, 0, 0, 3, 4 }, - { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 82, 79, 0, 0, 3, 4 }, - { 19, 11, 1, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, - { 1, 19, 17, 26, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, - { 14, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 28, 9, 13, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 7, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 }, - { 26, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 26, 5, 10, 0, 0, -1, 8, 0, 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 0, -16, 0, 0, 0, 0, 0, 0, 10 }, + { 6, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 3, 0, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 121, 121, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -232, -232, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 85, 85, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -121, 0, 0, -121, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -300, -300, -268, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 195, 195, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 210, 0, 0, 210, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 206, 0, 0, 206, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 205, 0, 0, 205, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 79, 0, 0, 79, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 202, 0, 0, 202, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 203, 0, 0, 203, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 207, 0, 0, 207, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 97, 97, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 211, 0, 0, 211, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 209, 0, 0, 209, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 163, 163, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 213, 0, 0, 213, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 214, 0, 0, 214, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 218, 0, 0, 218, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 217, 0, 0, 217, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 219, 0, 0, 219, 0, 3, 5 }, + { 19, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 56, 56, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, -1, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -79, -79, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 96, 96, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -97, 0, 0, -97, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -56, 0, 0, -56, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10795, 0, 0, 10795, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -163, 0, 0, -163, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 10792, 0, 0, 10792, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -195, 0, 0, -195, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 69, 0, 0, 69, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 71, 0, 0, 71, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -210, -210, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -206, -206, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -205, -205, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -202, -202, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -203, -203, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -207, -207, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -209, -209, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -211, -211, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10743, 10743, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -213, -213, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -214, -214, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 10727, 10727, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -218, -218, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -69, -69, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -217, -217, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -71, -71, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -219, -219, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 18, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 18, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 18, 16, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 29, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 18, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 29, 11, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 19, 17, 230, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 232, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 220, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 216, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 202, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 240, 0, -1, 1, 0, 0, 0, 0, 0, 0, 84, 84, 116, 4, 1, 0 }, + { 1, 19, 17, 230, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 220, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 3, 17, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 230, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 220, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 232, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 220, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 230, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 3, 17, 233, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 3, 17, 234, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 3, 17, 233, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 3, 17, 234, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 3, 17, 233, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 230, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 14, 11, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 130, 130, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 38, 0, 0, 38, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 37, 0, 0, 37, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 64, 0, 0, 64, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 63, 0, 0, 63, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 88, 88, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -38, -38, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -37, -37, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 92, 92, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -31, -31, 1, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -64, -64, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -63, -63, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -62, -62, -30, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -57, -57, -25, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -47, -47, -15, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -54, -54, -22, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -86, -86, -54, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, -48, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, -60, 0, 0, -60, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, -96, -96, -64, 0, 3, 4 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, -130, 0, 0, -130, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 80, 0, 0, 80, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -80, -80, 0, 0, 3, 4 }, + { 30, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, 19, 17, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 15, 0, 0, 15, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -15, -15, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5 }, + { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 26, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 52, 49, 0, 0, 3, 4 }, + { 26, 7, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 9 }, + { 21, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 14, 11, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 19, 17, 220, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 230, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 222, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 228, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 10, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 11, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 1, 19, 17, 12, 0, -1, 1, 0, 0,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 26, 15, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 30, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 18, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 18, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 3814, 3814, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 99, 99, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 102, 102, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 105, 105, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 108, 108, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 111, 111, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, -59, -59, -58, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8, 0, 0, -8, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 114, 114, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 117, 117, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 121, 121, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 125, 125, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 74, 74, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 100, 100, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 112, 112, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 126, 126, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 163, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 166, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 169, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 172, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 175, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 178, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 181, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 184, 8, 0, 0, 3, 4 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 163, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 166, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 169, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 172, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 175, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 178, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 181, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 184, 0, -8, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 187, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 190, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 193, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 196, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 199, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 202, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 205, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 208, 8, 0, 0, 3, 4 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 187, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 190, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 193, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 196, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 199, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 202, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 205, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 208, 0, -8, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 211, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 214, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 217, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 220, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 223, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 226, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 229, 8, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 232, 8, 0, 0, 3, 4 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 211, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 214, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 217, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 220, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 223, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 226, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 229, 0, -8, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 232, 0, -8, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 247, 244, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 235, 9, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 253, 250, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 129, 129, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 284, 280, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -74, 0, 0, -74, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 235, 0, -9, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -7205, -7205, -7173, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 259, 256, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 238, 9, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 265, 262, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 132, 132, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 292, 288, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -86, 0, 0, -86, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 238, 0, -9, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 135, 135, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 139, 139, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 142, 142, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -100, 0, 0, -100, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 146, 146, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 150, 150, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 153, 153, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 156, 156, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -112, 0, 0, -112, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 271, 268, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 241, 9, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 277, 274, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 160, 160, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 300, 296, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -128, 0, 0, -128, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -126, 0, 0, -126, 0, 3, 5 }, + { 17, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 241, 0, -9, 0, 3, 5 }, + { 7, 15, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, + { 7, 3, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, + { 11, 18, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 }, + { 11, 19, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 11, 19, 18, 0, 3, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 }, + { 11, 19, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 }, + { 11, 19, 1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 }, + { 21, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 21, 3, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 21, 17, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 21, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, + { 25, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 4, 10 }, + { 22, 0, 10, 0, 0, -1, 1, 0, 0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 0, 28, 0, 3, 5 }, + { 30, 11, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 15, 11, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5 }, + { 30, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -28, -28, 0, 0, 3, 4 }, + { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 16, 0, 0, 16, 0, 3, 5 }, + { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -16, -16, 0, 0, 3, 4 }, + { 5, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2016, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1824, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2104, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 2108, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 1, 0, 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+ { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, + { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, + { 22, 0, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, + { 23, 1, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0 }, + { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 10 }, + { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, + { 22, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, + { 23, 1, 10, 0, 0, -1, 6, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 10 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -1824, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2016, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2104, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2106, 0, 0, 0, 0, 0, 0, 0 }, + { 27, 11, 10, 0, 0, -1, 6, 0, 0, 0, 0, -2108, 0, 0, 0, 0, 0, 0, 0 }, + { 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10743, 0, 0, -10743, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -3814, 0, 0, -3814, 0, 3, 5 }, + { 15, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, -10727, 0, 0, -10727, 0, 3, 5 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10795, -10795, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, -10792, -10792, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 }, + { 6, 11, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 16, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, -7264, -7264, 0, 0, 3, 4 }, + { 26, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, + { 25, 2, 10, 0, 0, -1, 8, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, + { 21, 15, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 30, 12, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 7, 12, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, + { 26, 1, 10, 0, 0, -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, 0, 0, 0, 8, 3, 6 }, + { 19, 22, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 3, 6 }, + { 12, 27, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 13, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 19, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 12, 9, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 18, 15, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 24, 21, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 31, 27, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 39, 35, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 46, 43, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 58, 55, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 64, 61, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 70, 67, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 76, 73, 0, 0, 3, 4 }, + { 16, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 82, 79, 0, 0, 3, 4 }, + { 19, 11, 1, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 }, + { 1, 19, 17, 26, 0, -1, 1, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 7, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 4, 10, 2, 0, 0, 9, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7 }, + { 14, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 19, 12, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 }, + { 13, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; -static inline const Properties *qGetProp(ushort ucs2) -{ - int index = GET_PROP_INDEX_UCS2(ucs2); - return uc_properties + index; +static inline const Properties *qGetProp(ushort ucs2) { + int index = GET_PROP_INDEX_UCS2(ucs2); + return uc_properties + index; } #define MAX_BUFF_SIZE (long)1024*1024 @@ -4358,7 +4357,7 @@ static size_t tMaxElements = 0; #define PPS_NUMBER_INVALID 0xffffffffUL /* Macros */ - /* Get macros */ +/* Get macros */ #define ucGetByte(i,a) ((unsigned char)(a[i])) #define usGetWord(i,a) ((unsigned short)\ ((unsigned int)(a[(i)+1])<<8|\ @@ -4375,497 +4374,423 @@ static size_t tMaxElements = 0; (unsigned long)(a[(i)+1])<<16|\ (unsigned long)(a[i])<<24) -void* xmalloc(size_t tSize) -{ - void *pvTmp; +void* xmalloc(size_t tSize) { + void *pvTmp; - if (tSize == 0) - { - tSize = 1; - } - pvTmp = malloc(tSize); - if (pvTmp == NULL) - { - return NULL; - } - return pvTmp; + if(tSize == 0) { + tSize = 1; + } + pvTmp = malloc(tSize); + if(pvTmp == NULL) { + return NULL; + } + return pvTmp; } /* end of xmalloc */ -void* xcalloc(size_t tNmemb, size_t tSize) -{ - void *pvTmp; +void* xcalloc(size_t tNmemb, size_t tSize) { + void *pvTmp; - if (tNmemb == 0 || tSize == 0) - { - tNmemb = 1; - tSize = 1; - } - pvTmp = calloc(tNmemb, tSize); - if (pvTmp == NULL) - { - return NULL; - } - return pvTmp; + if(tNmemb == 0 || tSize == 0) { + tNmemb = 1; + tSize = 1; + } + pvTmp = calloc(tNmemb, tSize); + if(pvTmp == NULL) { + return NULL; + } + return pvTmp; } /* end of xcalloc */ -void* xrealloc(void *pvArg, size_t tSize) -{ - void *pvTmp; +void* xrealloc(void *pvArg, size_t tSize) { + void *pvTmp; - pvTmp = realloc(pvArg, tSize); - return pvTmp; + pvTmp = realloc(pvArg, tSize); + return pvTmp; } /* end of xrealloc */ -void* xfree(void *pvArg) -{ - if (pvArg != NULL) - { - free(pvArg); - } - return NULL; +void* xfree(void *pvArg) { + if(pvArg != NULL) { + free(pvArg); + } + return NULL; } /* end of xfree */ -bool bReadBytes(unsigned char *aucBytes, size_t tMemb, long lOffset, FILE *pFile) -{ +bool bReadBytes(unsigned char *aucBytes, size_t tMemb, long lOffset, FILE *pFile) { // printf("[%s]-[%d] wana read [%d] offset[%d]\n",__FUNCTION__,__LINE__,tMemb, lOffset); - if (fseek(pFile, lOffset, SEEK_SET) != 0) - { - return false; - } - if (fread(aucBytes, sizeof(unsigned char), tMemb, pFile) != tMemb) - { - return false; - } - return true; + if(fseek(pFile, lOffset, SEEK_SET) != 0) { + return false; + } + if(fread(aucBytes, sizeof(unsigned char), tMemb, pFile) != tMemb) { + return false; + } + return true; } /* end of bReadBytes */ #define SIZE_RATIO (BIG_BLOCK_SIZE/SMALL_BLOCK_SIZE) -ULONG ulDepotOffset(ULONG ulIndex, size_t tBlockSize) -{ - ULONG ulTmp; - size_t tTmp; +ULONG ulDepotOffset(ULONG ulIndex, size_t tBlockSize) { + ULONG ulTmp; + size_t tTmp; - switch (tBlockSize) { - case BIG_BLOCK_SIZE: - return (ulIndex + 1) * BIG_BLOCK_SIZE; - case SMALL_BLOCK_SIZE: - tTmp = (size_t)(ulIndex / SIZE_RATIO); - ulTmp = ulIndex % SIZE_RATIO; - if (aulSmallBlockList == NULL || - tTmp >= tSmallBlockListLen) - { - return 0; - } - return ((aulSmallBlockList[tTmp] + 1) * SIZE_RATIO + - ulTmp) * SMALL_BLOCK_SIZE; - default: - return 0; - } + switch(tBlockSize) { + case BIG_BLOCK_SIZE: + return (ulIndex + 1) * BIG_BLOCK_SIZE; + case SMALL_BLOCK_SIZE: + tTmp = (size_t)(ulIndex / SIZE_RATIO); + ulTmp = ulIndex % SIZE_RATIO; + if(aulSmallBlockList == NULL || + tTmp >= tSmallBlockListLen) { + return 0; + } + return ((aulSmallBlockList[tTmp] + 1) * SIZE_RATIO + + ulTmp) * SMALL_BLOCK_SIZE; + default: + return 0; + } } /* end of ulDepotOffset */ bool bReadBuffer(FILE *pFile, ULONG ulStartBlock, - const ULONG *aulBlockDepot, size_t tBlockDepotLen, size_t tBlockSize, - UCHAR *aucBuffer, ULONG ulOffset, size_t tToRead) -{ - ULONG ulBegin, ulIndex; - size_t tLen; + const ULONG *aulBlockDepot, size_t tBlockDepotLen, size_t tBlockSize, + UCHAR *aucBuffer, ULONG ulOffset, size_t tToRead) { + ULONG ulBegin, ulIndex; + size_t tLen; - for (ulIndex = ulStartBlock; - ulIndex != END_OF_CHAIN && tToRead != 0; - ulIndex = aulBlockDepot[ulIndex]) - { - if (ulIndex >= (ULONG)tBlockDepotLen) - { - if (tBlockSize >= BIG_BLOCK_SIZE) - { - qWarning() << "The Big Block Depot is damaged"; - } else { - qWarning() << "The Small Block Depot is damaged"; - } - } - if (ulOffset >= (ULONG)tBlockSize) - { - ulOffset -= tBlockSize; - continue; - } - ulBegin = ulDepotOffset(ulIndex, tBlockSize) + ulOffset; - tLen = min(tBlockSize - (size_t)ulOffset, tToRead); - ulOffset = 0; - if (!bReadBytes(aucBuffer, tLen, ulBegin, pFile)) - { - return false; - } - aucBuffer += tLen; - tToRead -= tLen; - } - return (tToRead == 0); + for(ulIndex = ulStartBlock; + ulIndex != END_OF_CHAIN && tToRead != 0; + ulIndex = aulBlockDepot[ulIndex]) { + if(ulIndex >= (ULONG)tBlockDepotLen) { + if(tBlockSize >= BIG_BLOCK_SIZE) { + qWarning() << "The Big Block Depot is damaged"; + } else { + qWarning() << "The Small Block Depot is damaged"; + } + } + if(ulOffset >= (ULONG)tBlockSize) { + ulOffset -= tBlockSize; + continue; + } + ulBegin = ulDepotOffset(ulIndex, tBlockSize) + ulOffset; + tLen = min(tBlockSize - (size_t)ulOffset, tToRead); + ulOffset = 0; + if(!bReadBytes(aucBuffer, tLen, ulBegin, pFile)) { + return false; + } + aucBuffer += tLen; + tToRead -= tLen; + } + return (tToRead == 0); } /* end of bReadBuffer */ -static ULONG ulReadLong(FILE *pFile, ULONG ulOffset) -{ - UCHAR aucBytes[4]; +static ULONG ulReadLong(FILE *pFile, ULONG ulOffset) { + UCHAR aucBytes[4]; - if (!bReadBytes(aucBytes, 4, ulOffset, pFile)) - { - return -1; - } - return ulGetLong(0, aucBytes); + if(!bReadBytes(aucBytes, 4, ulOffset, pFile)) { + return -1; + } + return ulGetLong(0, aucBytes); } /* end of ulReadLong */ static size_t tReadBlockIndices(FILE *pFile, ULONG *aulBlockDepot, - size_t tMaxRec, ULONG ulOffset) -{ - size_t tDone; - int iIndex; - UCHAR aucBytes[BIG_BLOCK_SIZE]; + size_t tMaxRec, ULONG ulOffset) { + size_t tDone; + int iIndex; + UCHAR aucBytes[BIG_BLOCK_SIZE]; - /* Read a big block with BBD or SBD indices */ - if (!bReadBytes(aucBytes, BIG_BLOCK_SIZE, ulOffset, pFile)) - { - return 0; - } - /* Split the big block into indices, an index is four bytes */ - tDone = min(tMaxRec, (size_t)BIG_BLOCK_SIZE / 4); - for (iIndex = 0; iIndex < (int)tDone; iIndex++) - { - aulBlockDepot[iIndex] = ulGetLong(4 * iIndex, aucBytes); - } - return tDone; + /* Read a big block with BBD or SBD indices */ + if(!bReadBytes(aucBytes, BIG_BLOCK_SIZE, ulOffset, pFile)) { + return 0; + } + /* Split the big block into indices, an index is four bytes */ + tDone = min(tMaxRec, (size_t)BIG_BLOCK_SIZE / 4); + for(iIndex = 0; iIndex < (int)tDone; iIndex++) { + aulBlockDepot[iIndex] = ulGetLong(4 * iIndex, aucBytes); + } + return tDone; } /* end of tReadBlockIndices */ static bool bGetSBD(FILE *pFile, const ULONG *aulDepot, size_t tDepotLen, - ULONG *aulSBD, size_t tSBDLen) -{ - ULONG ulBegin; - size_t tToGo, tDone; - int iIndex; + ULONG *aulSBD, size_t tSBDLen) { + ULONG ulBegin; + size_t tToGo, tDone; + int iIndex; - tToGo = tSBDLen; - for (iIndex = 0; iIndex < (int)tDepotLen && tToGo != 0; iIndex++) - { - ulBegin = (aulDepot[iIndex] + 1) * BIG_BLOCK_SIZE; - tDone = tReadBlockIndices(pFile, aulSBD, tToGo, ulBegin); - if (tDone == 0) { - return false; - } - aulSBD += tDone; - tToGo -= tDone; - } - return tToGo == 0; + tToGo = tSBDLen; + for(iIndex = 0; iIndex < (int)tDepotLen && tToGo != 0; iIndex++) { + ulBegin = (aulDepot[iIndex] + 1) * BIG_BLOCK_SIZE; + tDone = tReadBlockIndices(pFile, aulSBD, tToGo, ulBegin); + if(tDone == 0) { + return false; + } + aulSBD += tDone; + tToGo -= tDone; + } + return tToGo == 0; } /* end of bGetSBD */ -static void vName2String(char *szName, const UCHAR *aucBytes, size_t tNameSize) -{ - char *pcChar; - size_t tIndex; +static void vName2String(char *szName, const UCHAR *aucBytes, size_t tNameSize) { + char *pcChar; + size_t tIndex; - if (tNameSize < 2) - { - szName[0] = '\0'; - return; - } - for (tIndex = 0, pcChar = szName; tIndex < 2 * tNameSize; tIndex += 2, pcChar++) - { - *pcChar = (char)aucBytes[tIndex]; - } - szName[tNameSize - 1] = '\0'; + if(tNameSize < 2) { + szName[0] = '\0'; + return; + } + for(tIndex = 0, pcChar = szName; tIndex < 2 * tNameSize; tIndex += 2, pcChar++) { + *pcChar = (char)aucBytes[tIndex]; + } + szName[tNameSize - 1] = '\0'; } /* end of vName2String */ -void vAdd2PropModList(const UCHAR *aucPropMod) -{ - size_t tSize, tLen; +void vAdd2PropModList(const UCHAR *aucPropMod) { + size_t tSize, tLen; - if (tNextFree >= tMaxElements) - { - tMaxElements += ELEMENTS_TO_ADD; - tSize = tMaxElements * sizeof(UCHAR **); - ppAnchor = (UCHAR**)xrealloc(ppAnchor, tSize); - } + if(tNextFree >= tMaxElements) { + tMaxElements += ELEMENTS_TO_ADD; + tSize = tMaxElements * sizeof(UCHAR **); + ppAnchor = (UCHAR**)xrealloc(ppAnchor, tSize); + } - tLen = 2 + (size_t)usGetWord(0, aucPropMod); - ppAnchor[tNextFree] = (UCHAR*)xmalloc(tLen); - memcpy(ppAnchor[tNextFree], aucPropMod, tLen); - tNextFree++; + tLen = 2 + (size_t)usGetWord(0, aucPropMod); + ppAnchor[tNextFree] = (UCHAR*)xmalloc(tLen); + memcpy(ppAnchor[tNextFree], aucPropMod, tLen); + tNextFree++; } /* end of vAdd2PropModList */ static void vComputePPSlevels(ppsEntryType *atPPSlist, ppsEntryType *pNode, - int iLevel, int iRecursionLevel) -{ - if (iRecursionLevel > 25) - { - /* This removes the possibility of an infinite recursion */ - return; - } - if (pNode->iLevel <= iLevel) - { - /* Avoid entering a loop */ - return; - } + int iLevel, int iRecursionLevel) { + if(iRecursionLevel > 25) { + /* This removes the possibility of an infinite recursion */ + return; + } + if(pNode->iLevel <= iLevel) { + /* Avoid entering a loop */ + return; + } - pNode->iLevel = iLevel; + pNode->iLevel = iLevel; - if (pNode->ulDir != PPS_NUMBER_INVALID) - { - vComputePPSlevels(atPPSlist, - &atPPSlist[pNode->ulDir], - iLevel + 1, - iRecursionLevel + 1); - } - if (pNode->ulNext != PPS_NUMBER_INVALID) - { - vComputePPSlevels(atPPSlist, - &atPPSlist[pNode->ulNext], - iLevel, - iRecursionLevel + 1); - } - if (pNode->ulPrevious != PPS_NUMBER_INVALID) - { - vComputePPSlevels(atPPSlist, - &atPPSlist[pNode->ulPrevious], - iLevel, - iRecursionLevel + 1); - } + if(pNode->ulDir != PPS_NUMBER_INVALID) { + vComputePPSlevels(atPPSlist, + &atPPSlist[pNode->ulDir], + iLevel + 1, + iRecursionLevel + 1); + } + if(pNode->ulNext != PPS_NUMBER_INVALID) { + vComputePPSlevels(atPPSlist, + &atPPSlist[pNode->ulNext], + iLevel, + iRecursionLevel + 1); + } + if(pNode->ulPrevious != PPS_NUMBER_INVALID) { + vComputePPSlevels(atPPSlist, + &atPPSlist[pNode->ulPrevious], + iLevel, + iRecursionLevel + 1); + } } /* end of vComputePPSlevels */ bool KBinaryParser::bGetPPS(FILE *pFile, - const ULONG *aulRootList, size_t tRootListLen, ppsInfoType *pPPS) -{ - ppsEntryType *atPPSlist; - ULONG ulBegin, ulOffset, ulTmp; - size_t tNbrOfPPS, tNameSize; - int iIndex, iStartBlock, iRootIndex; - bool bTypeFind = false; - UCHAR aucBytes[PROPERTY_SET_STORAGE_SIZE]; + const ULONG *aulRootList, size_t tRootListLen, ppsInfoType *pPPS) { + ppsEntryType *atPPSlist; + ULONG ulBegin, ulOffset, ulTmp; + size_t tNbrOfPPS, tNameSize; + int iIndex, iStartBlock, iRootIndex; + bool bTypeFind = false; + UCHAR aucBytes[PROPERTY_SET_STORAGE_SIZE]; - (void)memset(pPPS, 0, sizeof(*pPPS)); + (void)memset(pPPS, 0, sizeof(*pPPS)); - /* Read and store all the Property Set Storage entries */ + /* Read and store all the Property Set Storage entries */ - tNbrOfPPS = tRootListLen * BIG_BLOCK_SIZE / PROPERTY_SET_STORAGE_SIZE; - atPPSlist = (ppsEntryType*)xcalloc(tNbrOfPPS, sizeof(ppsEntryType)); - iRootIndex = 0; + tNbrOfPPS = tRootListLen * BIG_BLOCK_SIZE / PROPERTY_SET_STORAGE_SIZE; + atPPSlist = (ppsEntryType*)xcalloc(tNbrOfPPS, sizeof(ppsEntryType)); + iRootIndex = 0; - for (iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) - { - ulTmp = (ULONG)iIndex * PROPERTY_SET_STORAGE_SIZE; - iStartBlock = (int)(ulTmp / BIG_BLOCK_SIZE); - ulOffset = ulTmp % BIG_BLOCK_SIZE; - ulBegin = (aulRootList[iStartBlock] + 1) * BIG_BLOCK_SIZE + - ulOffset; - if (!bReadBytes(aucBytes, PROPERTY_SET_STORAGE_SIZE, - ulBegin, pFile)) - { - atPPSlist = (ppsEntryType*)xfree(atPPSlist); - return false; - } - tNameSize = (size_t)usGetWord(0x40, aucBytes); - tNameSize = (tNameSize + 1) / 2; - vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize); - atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes); - if (atPPSlist[iIndex].ucType == 5) - { - iRootIndex = iIndex; - } + for(iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) { + ulTmp = (ULONG)iIndex * PROPERTY_SET_STORAGE_SIZE; + iStartBlock = (int)(ulTmp / BIG_BLOCK_SIZE); + ulOffset = ulTmp % BIG_BLOCK_SIZE; + ulBegin = (aulRootList[iStartBlock] + 1) * BIG_BLOCK_SIZE + + ulOffset; + if(!bReadBytes(aucBytes, PROPERTY_SET_STORAGE_SIZE, + ulBegin, pFile)) { + atPPSlist = (ppsEntryType*)xfree(atPPSlist); + return false; + } + tNameSize = (size_t)usGetWord(0x40, aucBytes); + tNameSize = (tNameSize + 1) / 2; + vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize); + atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes); + if(atPPSlist[iIndex].ucType == 5) { + iRootIndex = iIndex; + } - ULONG ulprev = ulGetLong(0x44, aucBytes); - ULONG ulnxt = ulGetLong(0x48, aucBytes); - ULONG uldir = ulGetLong(0x4c, aucBytes); - ULONG ulsb = ulGetLong(0x74, aucBytes); // 116 - ULONG ulsize = ulGetLong(0x78, aucBytes); // 120 - atPPSlist[iIndex].ulPrevious = ulprev; - atPPSlist[iIndex].ulNext = ulnxt; - atPPSlist[iIndex].ulDir = uldir; - atPPSlist[iIndex].ulSB = ulsb; - atPPSlist[iIndex].ulSize = ulsize; - atPPSlist[iIndex].iLevel = INT_MAX; - if ((atPPSlist[iIndex].ulPrevious >= (ULONG)tNbrOfPPS && - atPPSlist[iIndex].ulPrevious != PPS_NUMBER_INVALID) || - (atPPSlist[iIndex].ulNext >= (ULONG)tNbrOfPPS && - atPPSlist[iIndex].ulNext != PPS_NUMBER_INVALID) || - (atPPSlist[iIndex].ulDir >= (ULONG)tNbrOfPPS && - atPPSlist[iIndex].ulDir != PPS_NUMBER_INVALID)) - { - atPPSlist = (ppsEntryType*)xfree(atPPSlist); - return false; - } - } + ULONG ulprev = ulGetLong(0x44, aucBytes); + ULONG ulnxt = ulGetLong(0x48, aucBytes); + ULONG uldir = ulGetLong(0x4c, aucBytes); + ULONG ulsb = ulGetLong(0x74, aucBytes); // 116 + ULONG ulsize = ulGetLong(0x78, aucBytes); // 120 + atPPSlist[iIndex].ulPrevious = ulprev; + atPPSlist[iIndex].ulNext = ulnxt; + atPPSlist[iIndex].ulDir = uldir; + atPPSlist[iIndex].ulSB = ulsb; + atPPSlist[iIndex].ulSize = ulsize; + atPPSlist[iIndex].iLevel = INT_MAX; + if((atPPSlist[iIndex].ulPrevious >= (ULONG)tNbrOfPPS && + atPPSlist[iIndex].ulPrevious != PPS_NUMBER_INVALID) || + (atPPSlist[iIndex].ulNext >= (ULONG)tNbrOfPPS && + atPPSlist[iIndex].ulNext != PPS_NUMBER_INVALID) || + (atPPSlist[iIndex].ulDir >= (ULONG)tNbrOfPPS && + atPPSlist[iIndex].ulDir != PPS_NUMBER_INVALID)) { + atPPSlist = (ppsEntryType*)xfree(atPPSlist); + return false; + } + } - /* Add level information to each entry */ - vComputePPSlevels(atPPSlist, &atPPSlist[iRootIndex], 0, 0); + /* Add level information to each entry */ + vComputePPSlevels(atPPSlist, &atPPSlist[iRootIndex], 0, 0); - for (iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) - { - if (atPPSlist[iIndex].szName[0] == '\0' || - atPPSlist[iIndex].ulSize == 0) - { - /* This entry can be ignored */ - continue; - } - /*if (m_strFileName.endsWith(".wps") && pPPS->tWordDocument.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "Root Entry")) - { - pPPS->tWordDocument.ulSB = 0;//atPPSlist[iIndex].ulSB; - pPPS->tWordDocument.ulSize = atPPSlist[iIndex].ulSize; - pPPS->type = Word; - bTypeFind = true; - } - else */if ( pPPS->tWordDocument.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "WordDocument")) - { - pPPS->tWordDocument.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tWordDocument.ulSize = atPPSlist[iIndex].ulSize; - pPPS->type = Word; - bTypeFind = true; - } - else if (pPPS->tData.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "Data")) - { - pPPS->tData.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tData.ulSize = atPPSlist[iIndex].ulSize; - } - else if (pPPS->t0Table.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "0Table")) - { - pPPS->t0Table.ulSB = atPPSlist[iIndex].ulSB; - pPPS->t0Table.ulSize = atPPSlist[iIndex].ulSize; - } - else if (pPPS->t1Table.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "1Table")) - { - pPPS->t1Table.ulSB = atPPSlist[iIndex].ulSB; - pPPS->t1Table.ulSize = atPPSlist[iIndex].ulSize; - } - else if (pPPS->tSummaryInfo.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, - "\005SummaryInformation")) - { - pPPS->tSummaryInfo.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tSummaryInfo.ulSize = atPPSlist[iIndex].ulSize; - } - else if (pPPS->tDocSummaryInfo.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, - "\005DocumentSummaryInformation")) - { - pPPS->tDocSummaryInfo.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tDocSummaryInfo.ulSize = atPPSlist[iIndex].ulSize; - } - else if (pPPS->tWorkBook.ulSize == 0 && - (STREQ(atPPSlist[iIndex].szName, "Book") || STREQ(atPPSlist[iIndex].szName, "Workbook"))) - { - pPPS->tWorkBook.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tWorkBook.ulSize = atPPSlist[iIndex].ulSize; - pPPS->type = Excel; - bTypeFind = true; - } - else if (pPPS->tPPTDocument.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "PowerPoint Document")) - { - pPPS->tPPTDocument.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tPPTDocument.ulSize = atPPSlist[iIndex].ulSize; - pPPS->type = Ppt; - bTypeFind = true; - } - else if (pPPS->tCurrentUser.ulSize == 0 && - STREQ(atPPSlist[iIndex].szName, "Current User")) - { - pPPS->tCurrentUser.ulSB = atPPSlist[iIndex].ulSB; - pPPS->tCurrentUser.ulSize = atPPSlist[iIndex].ulSize; - } - } + for(iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) { + if(atPPSlist[iIndex].szName[0] == '\0' || + atPPSlist[iIndex].ulSize == 0) { + /* This entry can be ignored */ + continue; + } + /*if (m_strFileName.endsWith(".wps") && pPPS->tWordDocument.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "Root Entry")) + { + pPPS->tWordDocument.ulSB = 0;//atPPSlist[iIndex].ulSB; + pPPS->tWordDocument.ulSize = atPPSlist[iIndex].ulSize; + pPPS->type = Word; + bTypeFind = true; + } + else */if(pPPS->tWordDocument.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "WordDocument")) { + pPPS->tWordDocument.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tWordDocument.ulSize = atPPSlist[iIndex].ulSize; + pPPS->type = Word; + bTypeFind = true; + } else if(pPPS->tData.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "Data")) { + pPPS->tData.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tData.ulSize = atPPSlist[iIndex].ulSize; + } else if(pPPS->t0Table.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "0Table")) { + pPPS->t0Table.ulSB = atPPSlist[iIndex].ulSB; + pPPS->t0Table.ulSize = atPPSlist[iIndex].ulSize; + } else if(pPPS->t1Table.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "1Table")) { + pPPS->t1Table.ulSB = atPPSlist[iIndex].ulSB; + pPPS->t1Table.ulSize = atPPSlist[iIndex].ulSize; + } else if(pPPS->tSummaryInfo.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, + "\005SummaryInformation")) { + pPPS->tSummaryInfo.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tSummaryInfo.ulSize = atPPSlist[iIndex].ulSize; + } else if(pPPS->tDocSummaryInfo.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, + "\005DocumentSummaryInformation")) { + pPPS->tDocSummaryInfo.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tDocSummaryInfo.ulSize = atPPSlist[iIndex].ulSize; + } else if(pPPS->tWorkBook.ulSize == 0 && + (STREQ(atPPSlist[iIndex].szName, "Book") || STREQ(atPPSlist[iIndex].szName, "Workbook"))) { + pPPS->tWorkBook.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tWorkBook.ulSize = atPPSlist[iIndex].ulSize; + pPPS->type = Excel; + bTypeFind = true; + } else if(pPPS->tPPTDocument.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "PowerPoint Document")) { + pPPS->tPPTDocument.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tPPTDocument.ulSize = atPPSlist[iIndex].ulSize; + pPPS->type = Ppt; + bTypeFind = true; + } else if(pPPS->tCurrentUser.ulSize == 0 && + STREQ(atPPSlist[iIndex].szName, "Current User")) { + pPPS->tCurrentUser.ulSB = atPPSlist[iIndex].ulSB; + pPPS->tCurrentUser.ulSize = atPPSlist[iIndex].ulSize; + } + } - /* Free the space for the Property Set Storage entries */ - atPPSlist = (ppsEntryType*)xfree(atPPSlist); + /* Free the space for the Property Set Storage entries */ + atPPSlist = (ppsEntryType*)xfree(atPPSlist); - return bTypeFind; + return bTypeFind; }/* end of bGetPPS */ -int KBinaryParser::readData(rdPara &readParam, uchar *aucBuffer, ulong ulOffset, size_t tToRead) -{ - /* Read the headerblock */ - if (!bReadBuffer(readParam.pFile, readParam.ulStBlk, - readParam.ulBBd, readParam.tBBdLen, readParam.usBlkSize, - aucBuffer, ulOffset, tToRead)) - return -1; - return 0; +int KBinaryParser::readData(rdPara &readParam, uchar *aucBuffer, ulong ulOffset, size_t tToRead) { + /* Read the headerblock */ + if(!bReadBuffer(readParam.pFile, readParam.ulStBlk, + readParam.ulBBd, readParam.tBBdLen, readParam.usBlkSize, + aucBuffer, ulOffset, tToRead)) + return -1; + return 0; } -bool bCreateSmallBlockList(ULONG ulStartblock, const ULONG *aulBBD, size_t tBBDLen) -{ - ULONG ulTmp; - size_t tSize; - int iIndex; +bool bCreateSmallBlockList(ULONG ulStartblock, const ULONG *aulBBD, size_t tBBDLen) { + ULONG ulTmp; + size_t tSize; + int iIndex; - /* Find the length of the small block list */ - for (tSmallBlockListLen = 0, ulTmp = ulStartblock; - tSmallBlockListLen < tBBDLen && ulTmp != END_OF_CHAIN; - tSmallBlockListLen++, ulTmp = aulBBD[ulTmp]) - { - if (ulTmp >= (ULONG)tBBDLen) - { - } - } + /* Find the length of the small block list */ + for(tSmallBlockListLen = 0, ulTmp = ulStartblock; + tSmallBlockListLen < tBBDLen && ulTmp != END_OF_CHAIN; + tSmallBlockListLen++, ulTmp = aulBBD[ulTmp]) { + if(ulTmp >= (ULONG)tBBDLen) { + } + } - if (tSmallBlockListLen == 0) - { - /* There is no small block list */ - aulSmallBlockList = NULL; - return true; - } + if(tSmallBlockListLen == 0) { + /* There is no small block list */ + aulSmallBlockList = NULL; + return true; + } - /* Create the small block list */ - tSize = tSmallBlockListLen * sizeof(ULONG); - aulSmallBlockList = (ULONG*)xmalloc(tSize); - for (iIndex = 0, ulTmp = ulStartblock; - iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; - iIndex++, ulTmp = aulBBD[ulTmp]) - { - if (ulTmp >= (ULONG)tBBDLen) - { - return false; - } - aulSmallBlockList[iIndex] = ulTmp; - } - return true; + /* Create the small block list */ + tSize = tSmallBlockListLen * sizeof(ULONG); + aulSmallBlockList = (ULONG*)xmalloc(tSize); + for(iIndex = 0, ulTmp = ulStartblock; + iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; + iIndex++, ulTmp = aulBBD[ulTmp]) { + if(ulTmp >= (ULONG)tBBDLen) { + return false; + } + aulSmallBlockList[iIndex] = ulTmp; + } + return true; } /* end of bCreateSmallBlockList */ -static void vGetBbdList(FILE *pFile, int iNbr, ULONG *aulBbdList, ULONG ulOffset) -{ - int iIndex; +static void vGetBbdList(FILE *pFile, int iNbr, ULONG *aulBbdList, ULONG ulOffset) { + int iIndex; - for (iIndex = 0; iIndex < iNbr; iIndex++) - { - aulBbdList[iIndex] = ulReadLong(pFile, ulOffset + 4 * (ULONG)iIndex); - } + for(iIndex = 0; iIndex < iNbr; iIndex++) { + aulBbdList[iIndex] = ulReadLong(pFile, ulOffset + 4 * (ULONG)iIndex); + } } /* end of vGetBbdList */ static bool bGetBBD(FILE *pFile, const ULONG *aulDepot, size_t tDepotLen, - ULONG *aulBBD, size_t tBBDLen) -{ - ULONG ulBegin; - size_t tToGo, tDone; - int iIndex; + ULONG *aulBBD, size_t tBBDLen) { + ULONG ulBegin; + size_t tToGo, tDone; + int iIndex; - tToGo = tBBDLen; - for (iIndex = 0; iIndex < (int)tDepotLen && tToGo != 0; iIndex++) - { - ulBegin = (aulDepot[iIndex] + 1) * BIG_BLOCK_SIZE; - tDone = tReadBlockIndices(pFile, aulBBD, tToGo, ulBegin); - if (tDone == 0) - { - return false; - } - aulBBD += tDone; - tToGo -= tDone; - } - return tToGo == 0; + tToGo = tBBDLen; + for(iIndex = 0; iIndex < (int)tDepotLen && tToGo != 0; iIndex++) { + ulBegin = (aulDepot[iIndex] + 1) * BIG_BLOCK_SIZE; + tDone = tReadBlockIndices(pFile, aulBBD, tToGo, ulBegin); + if(tDone == 0) { + return false; + } + aulBBD += tDone; + tToGo -= tDone; + } + return tToGo == 0; } /* end of bGetBBD */ #define REHASH(a) \ @@ -4873,218 +4798,195 @@ static bool bGetBBD(FILE *pFile, const ULONG *aulDepot, size_t tDepotLen, hashHaystack -= (a) << sl_minus_1; \ hashHaystack <<= 1 -static inline uint foldCase(const ushort *ch, const ushort *start) -{ - uint c = *ch; - if (QChar(c).isLowSurrogate() && ch > start && QChar(*(ch - 1)).isHighSurrogate()) - c = QChar::surrogateToUcs4(*(ch - 1), c); - return *ch + qGetProp(c)->caseFoldDiff; +static inline uint foldCase(const ushort *ch, const ushort *start) { + uint c = *ch; + if(QChar(c).isLowSurrogate() && ch > start && QChar(*(ch - 1)).isHighSurrogate()) + c = QChar::surrogateToUcs4(*(ch - 1), c); + return *ch + qGetProp(c)->caseFoldDiff; } -static inline uint foldCase(uint ch, uint &last) -{ - uint c = ch; - if (QChar(c).isLowSurrogate() && QChar(last).isHighSurrogate()) - c = QChar::surrogateToUcs4(last, c); - last = ch; - return ch + qGetProp(c)->caseFoldDiff; +static inline uint foldCase(uint ch, uint &last) { + uint c = ch; + if(QChar(c).isLowSurrogate() && QChar(last).isHighSurrogate()) + c = QChar::surrogateToUcs4(last, c); + last = ch; + return ch + qGetProp(c)->caseFoldDiff; } -static inline ushort foldCase(ushort ch) -{ - return ch + qGetProp(ch)->caseFoldDiff; +static inline ushort foldCase(ushort ch) { + return ch + qGetProp(ch)->caseFoldDiff; } -static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be) -{ - if (a == b) - return (ae - be); - if (a == 0) - return 1; - if (b == 0) - return -1; +static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be) { + if(a == b) + return (ae - be); + if(a == 0) + return 1; + if(b == 0) + return -1; - const ushort *e = ae; - if (be - b < ae - a) - e = a + (be - b); + const ushort *e = ae; + if(be - b < ae - a) + e = a + (be - b); - uint alast = 0; - uint blast = 0; - while (a < e) { - qDebug() << hex << alast << blast; - qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast); - qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast); - int diff = foldCase(*a, alast) - foldCase(*b, blast); - if ((diff)) - return diff; - ++a; - ++b; - } - if (a == ae) { - if (b == be) - return 0; - return -1; - } - return 1; + uint alast = 0; + uint blast = 0; + while(a < e) { + qDebug() << hex << alast << blast; + qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase(*a, alast); + qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase(*b, blast); + int diff = foldCase(*a, alast) - foldCase(*b, blast); + if((diff)) + return diff; + ++a; + ++b; + } + if(a == ae) { + if(b == be) + return 0; + return -1; + } + return 1; } -static int ucstrnicmp(const ushort *a, const ushort *b, int l) -{ - return ucstricmp(a, a + l, b, b + l); +static int ucstrnicmp(const ushort *a, const ushort *b, int l) { + return ucstricmp(a, a + l, b, b + l); } -static int ucstrncmp(const QChar *a, const QChar *b, int l) -{ - while (l-- && *a == *b) - a++,b++; - if (l==-1) - return 0; - return a->unicode() - b->unicode(); +static int ucstrncmp(const QChar *a, const QChar *b, int l) { + while(l-- && *a == *b) + a++, b++; + if(l == -1) + return 0; + return a->unicode() - b->unicode(); } -inline uint _Ucs2ToUcs4( ushort lead, ushort trail) -{ - unsigned int ucs4 = (trail - 0xDC00); //low 10 bit - ucs4 |= ((lead - 0xD800)) << 10; //high 10 bit - return ucs4 + 0x10000; +inline uint _Ucs2ToUcs4(ushort lead, ushort trail) { + unsigned int ucs4 = (trail - 0xDC00); //low 10 bit + ucs4 |= ((lead - 0xD800)) << 10; //high 10 bit + return ucs4 + 0x10000; } bool KBinaryParser::read8DocText(FILE *pFile, const ppsInfoType *pPPS, - const ULONG *aulBBD, size_t tBBDLen, - const ULONG *aulSBD, size_t tSBDLen, - const UCHAR *aucHeader,QString &content) -{ - const ULONG *aulBlockDepot; - ULONG ulTextOffset, ulBeginTextInfo; - ULONG ulTotLength, ulLen; - long lIndex, lPieces, lOff; - size_t tTextInfoLen, tBlockDepotLen, tBlockSize; - int iType, iLen; - bool bUsesUnicode; - USHORT usPropMod; + const ULONG *aulBBD, size_t tBBDLen, + const ULONG *aulSBD, size_t tSBDLen, + const UCHAR *aucHeader, QString &content) { + const ULONG *aulBlockDepot; + ULONG ulTextOffset, ulBeginTextInfo; + ULONG ulTotLength, ulLen; + long lIndex, lPieces, lOff; + size_t tTextInfoLen, tBlockDepotLen, tBlockSize; + int iType, iLen; + bool bUsesUnicode; + USHORT usPropMod; - ulBeginTextInfo = ulGetLong(0x1a2, aucHeader); /* fcClx */ - tTextInfoLen = (size_t)ulGetLong(0x1a6, aucHeader); /* lcbClx */ + ulBeginTextInfo = ulGetLong(0x1a2, aucHeader); /* fcClx */ + tTextInfoLen = (size_t)ulGetLong(0x1a6, aucHeader); /* lcbClx */ - if (pPPS->tTable.ulSize == 0) - return false; + if(pPPS->tTable.ulSize == 0) + return false; - if (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) - { - /* Use the Small Block Depot */ - aulBlockDepot = aulSBD; - tBlockDepotLen = tSBDLen; - tBlockSize = SMALL_BLOCK_SIZE; - } - else - { - /* Use the Big Block Depot */ - aulBlockDepot = aulBBD; - tBlockDepotLen = tBBDLen; - tBlockSize = BIG_BLOCK_SIZE; - } + if(pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { + /* Use the Small Block Depot */ + aulBlockDepot = aulSBD; + tBlockDepotLen = tSBDLen; + tBlockSize = SMALL_BLOCK_SIZE; + } else { + /* Use the Big Block Depot */ + aulBlockDepot = aulBBD; + tBlockDepotLen = tBBDLen; + tBlockSize = BIG_BLOCK_SIZE; + } - UCHAR aucBuffer[tTextInfoLen]; - if (!bReadBuffer(pFile, pPPS->tTable.ulSB, - aulBlockDepot, tBlockDepotLen, tBlockSize, - aucBuffer, ulBeginTextInfo, tTextInfoLen)) - return false; + UCHAR aucBuffer[tTextInfoLen]; + if(!bReadBuffer(pFile, pPPS->tTable.ulSB, + aulBlockDepot, tBlockDepotLen, tBlockSize, + aucBuffer, ulBeginTextInfo, tTextInfoLen)) + return false; - lOff = 0; - while (lOff < (long)tTextInfoLen) - { - iType = (int)ucGetByte(lOff, aucBuffer); - lOff++; - if (iType == 0) - { - lOff++; - continue; - } - if (iType == 1) - { - iLen = (int)usGetWord(lOff, aucBuffer); - vAdd2PropModList(aucBuffer + lOff); - lOff += (long)iLen + 2; - continue; - } + lOff = 0; + while(lOff < (long)tTextInfoLen) { + iType = (int)ucGetByte(lOff, aucBuffer); + lOff++; + if(iType == 0) { + lOff++; + continue; + } + if(iType == 1) { + iLen = (int)usGetWord(lOff, aucBuffer); + vAdd2PropModList(aucBuffer + lOff); + lOff += (long)iLen + 2; + continue; + } - if (iType != 2) - return false; + if(iType != 2) + return false; - /* Type 2 */ - ulLen = ulGetLong(lOff, aucBuffer); - if (ulLen < 4) - return false; + /* Type 2 */ + ulLen = ulGetLong(lOff, aucBuffer); + if(ulLen < 4) + return false; - lOff += 4; - lPieces = (long)((ulLen - 4) / 12); - for (lIndex = 0; lIndex < lPieces; lIndex++) - { - ulTextOffset = ulGetLong(lOff + (lPieces + 1) * 4 + lIndex * 8 + 2, aucBuffer); - usPropMod = usGetWord(lOff + (lPieces + 1) * 4 + lIndex * 8 + 6, aucBuffer); - ulTotLength = ulGetLong(lOff + (lIndex + 1) * 4, aucBuffer) - ulGetLong(lOff + lIndex * 4, aucBuffer); - if ((ulTextOffset & BIT(30)) == 0) - { - bUsesUnicode = true; - ulTotLength *= 2; - } - else - { - bUsesUnicode = false; - ulTextOffset &= ~BIT(30); - ulTextOffset /= 2; - } + lOff += 4; + lPieces = (long)((ulLen - 4) / 12); + for(lIndex = 0; lIndex < lPieces; lIndex++) { + ulTextOffset = ulGetLong(lOff + (lPieces + 1) * 4 + lIndex * 8 + 2, aucBuffer); + usPropMod = usGetWord(lOff + (lPieces + 1) * 4 + lIndex * 8 + 6, aucBuffer); + ulTotLength = ulGetLong(lOff + (lIndex + 1) * 4, aucBuffer) - ulGetLong(lOff + lIndex * 4, aucBuffer); + if((ulTextOffset & BIT(30)) == 0) { + bUsesUnicode = true; + ulTotLength *= 2; + } else { + bUsesUnicode = false; + ulTextOffset &= ~BIT(30); + ulTextOffset /= 2; + } - ulong uOff = 0; - UCHAR* ptaucBytes; - ULONG ulFileOffset = (pPPS->tWordDocument.ulSB + 1) * BIG_BLOCK_SIZE + ulTextOffset; - if (pPPS->tWordDocument.ulSize < MIN_SIZE_FOR_BBD_USE) - ulFileOffset = ulDepotOffset(pPPS->tWordDocument.ulSB, SMALL_BLOCK_SIZE) + ulTextOffset; - while (uOff < ulTotLength) - { - ULONG iAllocSize = MAX_BUFF_SIZE; - if ((ulTotLength - uOff) < MAX_BUFF_SIZE) - iAllocSize = ulTotLength - uOff; + ulong uOff = 0; + UCHAR* ptaucBytes; + ULONG ulFileOffset = (pPPS->tWordDocument.ulSB + 1) * BIG_BLOCK_SIZE + ulTextOffset; + if(pPPS->tWordDocument.ulSize < MIN_SIZE_FOR_BBD_USE) + ulFileOffset = ulDepotOffset(pPPS->tWordDocument.ulSB, SMALL_BLOCK_SIZE) + ulTextOffset; + while(uOff < ulTotLength) { + ULONG iAllocSize = MAX_BUFF_SIZE; + if((ulTotLength - uOff) < MAX_BUFF_SIZE) + iAllocSize = ulTotLength - uOff; - ptaucBytes = (UCHAR*)xmalloc(iAllocSize); - if (!ptaucBytes) - return false; - if (!bReadBytes(ptaucBytes, iAllocSize, ulFileOffset, pFile)) + ptaucBytes = (UCHAR*)xmalloc(iAllocSize); + if(!ptaucBytes) + return false; + if(!bReadBytes(ptaucBytes, iAllocSize, ulFileOffset, pFile)) return -1; ulFileOffset += iAllocSize; uOff += iAllocSize; - if (bUsesUnicode) - { + if(bUsesUnicode) { ushort* usAucData = (ushort*)ptaucBytes; - content.append(QString::fromUtf16(usAucData).replace("\r","")); + content.append(QString::fromUtf16(usAucData).replace("\r", "")); usAucData = (ushort*)xfree((void*)usAucData); ptaucBytes = NULL; if(content.length() >= 682666) //20480000/3 break; - } - else - { + } else { //need more format document ptaucBytes = (UCHAR*)xfree((void*)ptaucBytes); - qWarning()<<"Parser error:"<= usPartLen) - { + UCHAR* chData = (UCHAR*)xmalloc(ustotalLen); + if(ulNextOff < usPartLen && (ulNextOff + ustotalLen) >= usPartLen) { ushort usIdf = usPartLen - ulNextOff; uchar chTemp[MAX_BUFF_SIZE]; - memset(chTemp, 0 ,MAX_BUFF_SIZE); - if (readData(rdParam, chTemp, ulOff + ulNextOff, usIdf + 5) != 0) + memset(chTemp, 0, MAX_BUFF_SIZE); + if(readData(rdParam, chTemp, ulOff + ulNextOff, usIdf + 5) != 0) break; bool bTemp = false; @@ -5126,19 +5026,17 @@ int KBinaryParser:: readSSTRecord(readDataParam &rdParam, ppsInfoType PPS_info, bool bAnotherCompare = (usOthTxtLen == 0 || (usCharByteLen - usIdf) == 0) || usCharByteLen < usIdf; ulong ulNoUse = 0; bool bUniFlg = false; - if (!bAnotherCompare) - { + if(!bAnotherCompare) { uchar chFlag; memcpy(&chFlag, chTemp + usIdf + 4, 1); - if (chFlag == 0x00 || chFlag == 0x01 || chFlag == 0x05 || chFlag == 0x09 || chFlag == 0x08 || chFlag == 0x04 || chFlag == 0x0c) - { + if(chFlag == 0x00 || chFlag == 0x01 || chFlag == 0x05 || chFlag == 0x09 || chFlag == 0x08 || chFlag == 0x04 || chFlag == 0x0c) { bTemp = true; ulOff ++; ulong ulNextTep = 0; excelRecord eRTmp; - if (read8BiffRecord(chFlag, ulOff, ulNextTep, rdParam, eRTmp) != 0) + if(read8BiffRecord(chFlag, ulOff, ulNextTep, rdParam, eRTmp) != 0) break; ulOff += ulNextTep; bUniFlg = eRTmp.bUni; @@ -5149,33 +5047,27 @@ int KBinaryParser:: readSSTRecord(readDataParam &rdParam, ppsInfoType PPS_info, ulNextOff = 0; ustotalLen = usOthTxtLen + ulNoUse; - if (usOthTxtLen > 0) - { - memset(chTemp, 0 ,MAX_BUFF_SIZE); - if (readData(rdParam, chTemp, ulOff, usOthTxtLen) != 0) + if(usOthTxtLen > 0) { + memset(chTemp, 0, MAX_BUFF_SIZE); + if(readData(rdParam, chTemp, ulOff, usOthTxtLen) != 0) return -1; - memcpy(chData + usIdf , chTemp , usOthTxtLen); + memcpy(chData + usIdf, chTemp, usOthTxtLen); } - if (bTemp) + if(bTemp) usPartLen --; - } - else - { - if (readData(rdParam, chData, ulOff + ulNextOff, ustotalLen) != 0) + } else { + if(readData(rdParam, chData, ulOff + ulNextOff, ustotalLen) != 0) break; } - if (eRrd.bUni) - { - qDebug()<= 682666) //20480000/3 @@ -5185,45 +5077,40 @@ int KBinaryParser:: readSSTRecord(readDataParam &rdParam, ppsInfoType PPS_info, ulCount += 1; } - if (ulCount >= ulSize) + if(ulCount >= ulSize) return -1; } -int KBinaryParser::read8BiffRecord(uchar ucFlag, ulong ulOff, ulong &ulNext, readDataParam &rdParam, excelRecord &eR) -{ +int KBinaryParser::read8BiffRecord(uchar ucFlag, ulong ulOff, ulong &ulNext, readDataParam &rdParam, excelRecord &eR) { bool butf8 = true; - if (ucFlag & 0x08) - { + if(ucFlag & 0x08) { uchar chiRich[2]; - if (readData(rdParam, chiRich, ulOff + ulNext, 2) != 0) + if(readData(rdParam, chiRich, ulOff + ulNext, 2) != 0) return -1; eR.usRichLen = usGetWord(0x00, chiRich); ulNext += 2; } - if(ucFlag & 0x04) - { + if(ucFlag & 0x04) { uchar chExt[4]; - if (readData(rdParam, chExt, ulOff + ulNext, 4) != 0) + if(readData(rdParam, chExt, ulOff + ulNext, 4) != 0) return -1; eR.ulWLen = ulGetLong(0x00, chExt); ulNext += 4; } - if ((ucFlag & 0x01)) - { + if((ucFlag & 0x01)) { butf8 = false; } eR.bUni = butf8; return 0; } -ULONG KBinaryParser::readPPtRecord(FILE* pFile, ppsInfoType* PPS_info, ULONG* aulBBD, size_t tBBDLen, ULONG ulPos,QString &content) -{ +ULONG KBinaryParser::readPPtRecord(FILE* pFile, ppsInfoType* PPS_info, ULONG* aulBBD, size_t tBBDLen, ULONG ulPos, QString &content) { UCHAR aucHeader[PPT_RECORD_HEADER]; ULONG ulOff = ulPos; /* Read the headerblock */ - if (!bReadBuffer(pFile, PPS_info->tPPTDocument.ulSB, - aulBBD, tBBDLen, BIG_BLOCK_SIZE, - aucHeader, ulOff, PPT_RECORD_HEADER)) + if(!bReadBuffer(pFile, PPS_info->tPPTDocument.ulSB, + aulBBD, tBBDLen, BIG_BLOCK_SIZE, + aucHeader, ulOff, PPT_RECORD_HEADER)) return -1; ulOff += PPT_RECORD_HEADER; @@ -5231,26 +5118,21 @@ ULONG KBinaryParser::readPPtRecord(FILE* pFile, ppsInfoType* PPS_info, ULONG* au USHORT usType = usGetWord(0x02, aucHeader); ULONG ulLen = ulGetLong(0x04, aucHeader); USHORT usVer = usVersion & 0xF; - if (usVer == 0xF) - { - while (ulOff < ulLen) - { - ulOff = readPPtRecord(pFile, PPS_info, aulBBD, tBBDLen, ulOff,content); + if(usVer == 0xF) { + while(ulOff < ulLen) { + ulOff = readPPtRecord(pFile, PPS_info, aulBBD, tBBDLen, ulOff, content); } - } - else - { - if (usType == PPT_TEXTBYTEATOM || usType == PPT_TEXTCHARATOM) - { + } else { + if(usType == PPT_TEXTBYTEATOM || usType == PPT_TEXTCHARATOM) { long llen = (long)ulLen; UCHAR* chData = (UCHAR*)xmalloc(llen); - if (!bReadBuffer(pFile, PPS_info->tPPTDocument.ulSB, - aulBBD, tBBDLen, BIG_BLOCK_SIZE, - chData, ulOff, llen)) + if(!bReadBuffer(pFile, PPS_info->tPPTDocument.ulSB, + aulBBD, tBBDLen, BIG_BLOCK_SIZE, + chData, ulOff, llen)) return -1; ushort* usData = (ushort*)chData; - content.append(QString::fromUtf16(usData).replace("\r","")); + content.append(QString::fromUtf16(usData).replace("\r", "")); usData = (ushort*)xfree((void*)usData); chData = NULL; @@ -5262,236 +5144,214 @@ ULONG KBinaryParser::readPPtRecord(FILE* pFile, ppsInfoType* PPS_info, ULONG* au return ulOff; } -int KBinaryParser::InitDocOle(FILE* pFile,long lFilesize,QString &content) -{ - ppsInfoType PPS_info; - ULONG *aulBBD, *aulSBD; - ULONG *aulRootList, *aulBbdList, *aulSbdList; - ULONG ulBdbListStart, ulAdditionalBBDlist; - ULONG ulRootStartblock, ulSbdStartblock, ulSBLstartblock; - ULONG ulStart, ulTmp; - long lMaxBlock; - size_t tBBDLen, tSBDLen, tNumBbdBlocks, tRootListLen; - int iIndex, iToGo; - bool bSuccess; - USHORT usIdent, usDocStatus; +int KBinaryParser::InitDocOle(FILE* pFile, long lFilesize, QString &content) { + ppsInfoType PPS_info; + ULONG *aulBBD, *aulSBD; + ULONG *aulRootList, *aulBbdList, *aulSbdList; + ULONG ulBdbListStart, ulAdditionalBBDlist; + ULONG ulRootStartblock, ulSbdStartblock, ulSBLstartblock; + ULONG ulStart, ulTmp; + long lMaxBlock; + size_t tBBDLen, tSBDLen, tNumBbdBlocks, tRootListLen; + int iIndex, iToGo; + bool bSuccess; + USHORT usIdent, usDocStatus; - lMaxBlock = lFilesize / BIG_BLOCK_SIZE - 2; - if (lMaxBlock < 1) - return -1; + lMaxBlock = lFilesize / BIG_BLOCK_SIZE - 2; + if(lMaxBlock < 1) + return -1; - tBBDLen = (size_t)(lMaxBlock + 1); - tNumBbdBlocks = (size_t)ulReadLong(pFile, 0x2c); - ulRootStartblock = ulReadLong(pFile, 0x30); - ulSbdStartblock = ulReadLong(pFile, 0x3c); - ulAdditionalBBDlist = ulReadLong(pFile, 0x44); - ulSBLstartblock = ulReadLong(pFile, - (ulRootStartblock + 1) * BIG_BLOCK_SIZE + 0x74); - tSBDLen = (size_t)(ulReadLong(pFile, - (ulRootStartblock + 1) * BIG_BLOCK_SIZE + 0x78) / - SMALL_BLOCK_SIZE); + tBBDLen = (size_t)(lMaxBlock + 1); + tNumBbdBlocks = (size_t)ulReadLong(pFile, 0x2c); + ulRootStartblock = ulReadLong(pFile, 0x30); + ulSbdStartblock = ulReadLong(pFile, 0x3c); + ulAdditionalBBDlist = ulReadLong(pFile, 0x44); + ulSBLstartblock = ulReadLong(pFile, + (ulRootStartblock + 1) * BIG_BLOCK_SIZE + 0x74); + tSBDLen = (size_t)(ulReadLong(pFile, + (ulRootStartblock + 1) * BIG_BLOCK_SIZE + 0x78) / + SMALL_BLOCK_SIZE); - /* All to be xcalloc-ed pointers to NULL */ - aulRootList = NULL; - aulSbdList = NULL; - aulBbdList = NULL; - aulSBD = NULL; - aulBBD = NULL; + /* All to be xcalloc-ed pointers to NULL */ + aulRootList = NULL; + aulSbdList = NULL; + aulBbdList = NULL; + aulSBD = NULL; + aulBBD = NULL; - aulBbdList = (ULONG*)xcalloc(tNumBbdBlocks, sizeof(ULONG)); - aulBBD = (ULONG*)xcalloc(tBBDLen, sizeof(ULONG)); - iToGo = (int)tNumBbdBlocks; - vGetBbdList(pFile, min(iToGo, 109), aulBbdList, 0x4c); - ulStart = 109; - iToGo -= 109; - while (ulAdditionalBBDlist != END_OF_CHAIN && iToGo > 0) - { - ulBdbListStart = (ulAdditionalBBDlist + 1) * BIG_BLOCK_SIZE; - vGetBbdList(pFile, min(iToGo, 127), - aulBbdList + ulStart, ulBdbListStart); - ulAdditionalBBDlist = ulReadLong(pFile, - ulBdbListStart + 4 * 127); - ulStart += 127; - iToGo -= 127; - } + aulBbdList = (ULONG*)xcalloc(tNumBbdBlocks, sizeof(ULONG)); + aulBBD = (ULONG*)xcalloc(tBBDLen, sizeof(ULONG)); + iToGo = (int)tNumBbdBlocks; + vGetBbdList(pFile, min(iToGo, 109), aulBbdList, 0x4c); + ulStart = 109; + iToGo -= 109; + while(ulAdditionalBBDlist != END_OF_CHAIN && iToGo > 0) { + ulBdbListStart = (ulAdditionalBBDlist + 1) * BIG_BLOCK_SIZE; + vGetBbdList(pFile, min(iToGo, 127), + aulBbdList + ulStart, ulBdbListStart); + ulAdditionalBBDlist = ulReadLong(pFile, + ulBdbListStart + 4 * 127); + ulStart += 127; + iToGo -= 127; + } - if (!bGetBBD(pFile, aulBbdList, tNumBbdBlocks, aulBBD, tBBDLen)) - return -1; + if(!bGetBBD(pFile, aulBbdList, tNumBbdBlocks, aulBBD, tBBDLen)) + return -1; - aulBbdList = (ULONG*)xfree(aulBbdList); - /* Small Block Depot */ - aulSbdList = (unsigned long*)xcalloc(tBBDLen, sizeof(ULONG)); - aulSBD = (unsigned long*)xcalloc(tSBDLen, sizeof(ULONG)); + aulBbdList = (ULONG*)xfree(aulBbdList); + /* Small Block Depot */ + aulSbdList = (unsigned long*)xcalloc(tBBDLen, sizeof(ULONG)); + aulSBD = (unsigned long*)xcalloc(tSBDLen, sizeof(ULONG)); - for (iIndex = 0, ulTmp = ulSbdStartblock; - iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; - iIndex++, ulTmp = aulBBD[ulTmp]) - { - if (ulTmp >= (ULONG)tBBDLen) - qWarning("The Big Block Depot is damaged"); + for(iIndex = 0, ulTmp = ulSbdStartblock; + iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; + iIndex++, ulTmp = aulBBD[ulTmp]) { + if(ulTmp >= (ULONG)tBBDLen) + qWarning("The Big Block Depot is damaged"); - aulSbdList[iIndex] = ulTmp; - } + aulSbdList[iIndex] = ulTmp; + } - if (!bGetSBD(pFile, aulSbdList, tBBDLen, aulSBD, tSBDLen)) - return -1; + if(!bGetSBD(pFile, aulSbdList, tBBDLen, aulSBD, tSBDLen)) + return -1; - aulSbdList = (ULONG*)xfree(aulSbdList); - /* Root list */ - for (tRootListLen = 0, ulTmp = ulRootStartblock; - tRootListLen < tBBDLen && ulTmp != END_OF_CHAIN; - tRootListLen++, ulTmp = aulBBD[ulTmp]) - { - if (ulTmp >= (ULONG)tBBDLen) - return -1; + aulSbdList = (ULONG*)xfree(aulSbdList); + /* Root list */ + for(tRootListLen = 0, ulTmp = ulRootStartblock; + tRootListLen < tBBDLen && ulTmp != END_OF_CHAIN; + tRootListLen++, ulTmp = aulBBD[ulTmp]) { + if(ulTmp >= (ULONG)tBBDLen) + return -1; - } - if (tRootListLen == 0) - return -1; + } + if(tRootListLen == 0) + return -1; - aulRootList = (ULONG*)xcalloc(tRootListLen, sizeof(ULONG)); - for (iIndex = 0, ulTmp = ulRootStartblock; - iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; - iIndex++, ulTmp = aulBBD[ulTmp]) - { - if (ulTmp >= (ULONG)tBBDLen) - return -1; + aulRootList = (ULONG*)xcalloc(tRootListLen, sizeof(ULONG)); + for(iIndex = 0, ulTmp = ulRootStartblock; + iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; + iIndex++, ulTmp = aulBBD[ulTmp]) { + if(ulTmp >= (ULONG)tBBDLen) + return -1; - aulRootList[iIndex] = ulTmp; - } - bSuccess = bGetPPS(pFile, aulRootList, tRootListLen, &PPS_info); - aulRootList = (ULONG*)xfree(aulRootList); - if (!bSuccess) - return -1; + aulRootList[iIndex] = ulTmp; + } + bSuccess = bGetPPS(pFile, aulRootList, tRootListLen, &PPS_info); + aulRootList = (ULONG*)xfree(aulRootList); + if(!bSuccess) + return -1; - rdPara readParam; - readParam.pFile = pFile; - readParam.tBBdLen = tBBDLen; - readParam.ulBBd = aulBBD; - readParam.usBlkSize = BIG_BLOCK_SIZE; - if (PPS_info.type == Word) - { - readParam.ulStBlk = PPS_info.tWordDocument.ulSB; - UCHAR aucHeader[HEADER_SIZE]; - /* Small block list */ - if (!bCreateSmallBlockList(ulSBLstartblock, aulBBD, tBBDLen)) - return -1; + rdPara readParam; + readParam.pFile = pFile; + readParam.tBBdLen = tBBDLen; + readParam.ulBBd = aulBBD; + readParam.usBlkSize = BIG_BLOCK_SIZE; + if(PPS_info.type == Word) { + readParam.ulStBlk = PPS_info.tWordDocument.ulSB; + UCHAR aucHeader[HEADER_SIZE]; + /* Small block list */ + if(!bCreateSmallBlockList(ulSBLstartblock, aulBBD, tBBDLen)) + return -1; - if (PPS_info.tWordDocument.ulSize < MIN_SIZE_FOR_BBD_USE) - { - readParam.ulBBd = aulSBD; - readParam.tBBdLen = tSBDLen; - readParam.usBlkSize = SMALL_BLOCK_SIZE; - } + if(PPS_info.tWordDocument.ulSize < MIN_SIZE_FOR_BBD_USE) { + readParam.ulBBd = aulSBD; + readParam.tBBdLen = tSBDLen; + readParam.usBlkSize = SMALL_BLOCK_SIZE; + } - if (readData(readParam, aucHeader, 0, HEADER_SIZE) != 0) - return -1; + if(readData(readParam, aucHeader, 0, HEADER_SIZE) != 0) + return -1; - usIdent = usGetWord(0x00, aucHeader); + usIdent = usGetWord(0x00, aucHeader); - if (usIdent != 0x8098 && /* Word 7 for oriental languages */ - usIdent != 0x8099 && /* Word 7 for oriental languages */ - usIdent != 0xa5dc && /* Word 6 & 7 */ - usIdent != 0xa5ec && /* Word 7 & 97 & 98 */ - usIdent != 0xa697 && /* Word 7 for oriental languages */ - usIdent != 0xa699) /* Word 7 for oriental languages */ - return -1; + if(usIdent != 0x8098 && /* Word 7 for oriental languages */ + usIdent != 0x8099 && /* Word 7 for oriental languages */ + usIdent != 0xa5dc && /* Word 6 & 7 */ + usIdent != 0xa5ec && /* Word 7 & 97 & 98 */ + usIdent != 0xa697 && /* Word 7 for oriental languages */ + usIdent != 0xa699) /* Word 7 for oriental languages */ + return -1; - /* Get the status flags from the header */ - usDocStatus = usGetWord(0x0a, aucHeader); - if (usDocStatus & BIT(9)) - PPS_info.tTable = PPS_info.t1Table; - else - PPS_info.tTable = PPS_info.t0Table; + /* Get the status flags from the header */ + usDocStatus = usGetWord(0x0a, aucHeader); + if(usDocStatus & BIT(9)) + PPS_info.tTable = PPS_info.t1Table; + else + PPS_info.tTable = PPS_info.t0Table; - read8DocText(pFile, - &PPS_info, - aulBBD, tBBDLen, aulSBD, tSBDLen, - aucHeader,content); - } - else if (PPS_info.type == Excel) - { + read8DocText(pFile, + &PPS_info, + aulBBD, tBBDLen, aulSBD, tSBDLen, + aucHeader, content); + } else if(PPS_info.type == Excel) { readParam.ulStBlk = PPS_info.tWorkBook.ulSB; UCHAR aucHeader[4]; ulong ulOff = 0; - if (readData(readParam, aucHeader, 0, 8) != 0) + if(readData(readParam, aucHeader, 0, 8) != 0) return -1; ulOff += 4; USHORT usType = usGetWord(0x00, aucHeader); - while (ulOff < PPS_info.tWorkBook.ulSize) - { + while(ulOff < PPS_info.tWorkBook.ulSize) { USHORT usLen = usGetWord(0x02, aucHeader); ulOff += usLen; - if (readData(readParam, aucHeader, ulOff, 4) != 0) + if(readData(readParam, aucHeader, ulOff, 4) != 0) break; ulOff += 4; usType = usGetWord(0x00, aucHeader); ushort usPartLen = usGetWord(0x02, aucHeader); - if (usType == 0x00FC) - { - if (readSSTRecord(readParam, PPS_info, ulOff, usPartLen,content) != 0) + if(usType == 0x00FC) { + if(readSSTRecord(readParam, PPS_info, ulOff, usPartLen, content) != 0) break; } } - } - else if (PPS_info.type == Ppt) - { + } else if(PPS_info.type == Ppt) { ULONG ulOff = 0; - while (ulOff < PPS_info.tPPTDocument.ulSize) - { - ulOff = readPPtRecord(pFile, &PPS_info, aulBBD, tBBDLen, ulOff,content); + while(ulOff < PPS_info.tPPTDocument.ulSize) { + ulOff = readPPtRecord(pFile, &PPS_info, aulBBD, tBBDLen, ulOff, content); } + } else { + qWarning() << "Unsupport doc type:" << m_strFileName; } - else - { - qWarning()<<"Unsupport doc type:"<::const_iterator i; QLocale ql; - if(ql.language()==QLocale::Chinese){ - for(i=m_chine_searchList.constBegin();i!=m_chine_searchList.constEnd();++i){ - regmatch=*i; - key=i.key(); - for(int t=0; t #include #include -class SettingsMatch : public QObject -{ +class SettingsMatch : public QObject { Q_OBJECT public: explicit SettingsMatch(QObject *parent = nullptr); @@ -42,8 +41,8 @@ private: QStringList matching(); private: - QMap m_chine_searchList; - QMap m_English_searchList; + QMap m_chine_searchList; + QMap m_English_searchList; QStringList m_chine_searchResult; QStringList m_English_searchResult; QString m_sourceText; diff --git a/src/content-widget.cpp b/src/content-widget.cpp index 34d3821..81d4657 100644 --- a/src/content-widget.cpp +++ b/src/content-widget.cpp @@ -24,26 +24,24 @@ #include #include "config-file.h" -ContentWidget::ContentWidget(QWidget * parent):QStackedWidget(parent) -{ +ContentWidget::ContentWidget(QWidget * parent): QStackedWidget(parent) { initUI(); initListView(); //快速入口应用列表 // m_quicklyOpenList<<"/usr/share/applications/peony.desktop"<<"/usr/share/applications/ukui-control-center.desktop"<<"/usr/share/applications/ksc-defender.desktop"; m_quicklyOpenList << "/usr/share/applications/ksc-defender.desktop" - << "/usr/share/applications/ukui-notebook.desktop" - << "/usr/share/applications/eom.desktop" - << "/usr/share/applications/pluma.desktop" - << "/usr/share/applications/claws-mail.desktop" ; + << "/usr/share/applications/ukui-notebook.desktop" + << "/usr/share/applications/eom.desktop" + << "/usr/share/applications/pluma.desktop" + << "/usr/share/applications/claws-mail.desktop" ; } -ContentWidget::~ContentWidget() -{ - if (m_homePage) { +ContentWidget::~ContentWidget() { + if(m_homePage) { delete m_homePage; m_homePage = nullptr; } - if (m_resultPage) { + if(m_resultPage) { delete m_resultPage; m_resultPage = nullptr; } @@ -56,7 +54,7 @@ void ContentWidget::initUI() { m_homePage = new QWidget(this); m_homePageLyt = new QVBoxLayout(m_homePage); m_homePageLyt->setSpacing(0); - m_homePageLyt->setContentsMargins(0,0,0,0); + m_homePageLyt->setContentsMargins(0, 0, 0, 0); m_homePage->setLayout(m_homePageLyt); m_resultPage = new QWidget(this); @@ -103,8 +101,7 @@ void ContentWidget::initUI() { /** * @brief ContentWidget::initListView 初始化所有搜索结果列表 */ -void ContentWidget::initListView() -{ +void ContentWidget::initListView() { m_fileListView = new SearchListView(m_resultList, QStringList(), SearchItem::SearchType::Files); m_dirListView = new SearchListView(m_resultList, QStringList(), SearchItem::SearchType::Dirs); m_contentListView = new SearchListView(m_resultList, QStringList(), SearchItem::SearchType::Contents); @@ -232,8 +229,7 @@ void ContentWidget::initListView() /** * @brief ContentWidget::hideListView 隐藏所有列表 */ -void ContentWidget::hideListView() -{ +void ContentWidget::hideListView() { m_bestTitleLabel->hide(); m_bestListView->hide(); m_appTitleLabel->hide(); @@ -262,16 +258,16 @@ void ContentWidget::hideListView() void ContentWidget::setupConnect(SearchListView * listview) { connect(this, &ContentWidget::currentItemChanged, listview, [ = ]() { - if (! listview->is_current_list) { + if(! listview->is_current_list) { listview->blockSignals(true); listview->clearSelection(); listview->blockSignals(false); } }); - connect(listview,&SearchListView::currentSelectPos,[=](QPoint pos){ - m_resultListArea->ensureVisible(pos.x(),pos.y()); + connect(listview, &SearchListView::currentSelectPos, [ = ](QPoint pos) { + m_resultListArea->ensureVisible(pos.x(), pos.y()); }); - connect(listview,&SearchListView::mousePressed,this,&ContentWidget::mousePressed); + connect(listview, &SearchListView::mousePressed, this, &ContentWidget::mousePressed); connect(listview, &SearchListView::currentRowChanged, this, &ContentWidget::onListViewRowChanged); connect(listview, &SearchListView::onRowDoubleClicked, this, &ContentWidget::onListViewRowDoubleClicked); } @@ -279,57 +275,55 @@ void ContentWidget::setupConnect(SearchListView * listview) { /** * @brief ContentWidget::resetHeight 重新计算列表高度 */ -void ContentWidget::resetListHeight() -{ +void ContentWidget::resetListHeight() { int height = 0; - if (! m_bestListView->isHidden) { + if(! m_bestListView->isHidden) { height += m_bestTitleLabel->height(); height += m_bestListView->height(); } - if (! m_appListView->isHidden) { + if(! m_appListView->isHidden) { height += m_appTitleLabel->height(); height += m_appListView->height(); - if (m_appShowMoreLabel->isVisible()) { + if(m_appShowMoreLabel->isVisible()) { height += m_appShowMoreLabel->height(); } } - if (! m_settingListView->isHidden) { + if(! m_settingListView->isHidden) { height += m_settingTitleLabel->height(); height += m_settingListView->height(); - if (m_settingShowMoreLabel->isVisible()) { + if(m_settingShowMoreLabel->isVisible()) { height += m_settingShowMoreLabel->height(); } } - if (! m_fileListView->isHidden) { + if(! m_fileListView->isHidden) { height += m_fileTitleLabel->height(); height += m_fileListView->height(); - if (m_fileShowMoreLabel->isVisible()) { + if(m_fileShowMoreLabel->isVisible()) { height += m_fileShowMoreLabel->height(); } } - if (! m_dirListView->isHidden) { + if(! m_dirListView->isHidden) { height += m_dirTitleLabel->height(); height += m_dirListView->height(); - if (m_dirShowMoreLabel->isVisible()) { + if(m_dirShowMoreLabel->isVisible()) { height += m_dirShowMoreLabel->height(); } } - if (! m_contentListView->isHidden) { + if(! m_contentListView->isHidden) { height += m_contentTitleLabel->height(); height += m_contentListView->height(); - if (m_contentShowMoreLabel->isVisible()) { + if(m_contentShowMoreLabel->isVisible()) { height += m_contentShowMoreLabel->height(); } } - if (! m_webListView->isHidden) { + if(! m_webListView->isHidden) { height += m_webTitleLabel->height(); height += m_webListView->height(); } m_resultList->setFixedHeight(height); } -void ContentWidget::appendBestItem(const int &type, const QString &path) -{ +void ContentWidget::appendBestItem(const int &type, const QString &path) { m_bestList.append(QPair(type, path)); m_bestListView->appendBestItem(QPair(type, path)); appendSearchItem(SearchItem::SearchType::Best, path); @@ -351,27 +345,27 @@ void ContentWidget::initHomePage() { lists.append(recentlyList); lists.append(commonlyList); - for (int i = 0; i < lists.count(); i++) { - if (lists.at(i).isEmpty()) + for(int i = 0; i < lists.count(); i++) { + if(lists.at(i).isEmpty()) continue; QWidget * listWidget = new QWidget(m_homePage); QVBoxLayout * itemWidgetLyt = new QVBoxLayout(listWidget); QLabel * titleLabel = new QLabel(listWidget); QWidget * itemWidget = new QWidget(listWidget); - if (i == 1) { - if (lists.at(i).length() <= 2) itemWidget->setFixedHeight(48); + if(i == 1) { + if(lists.at(i).length() <= 2) itemWidget->setFixedHeight(48); else itemWidget->setFixedHeight(104); titleLabel->setText(tr("Recently Opened")); QGridLayout * layout = new QGridLayout(itemWidget); layout->setSpacing(8); layout->setContentsMargins(0, 0, 0, 0); itemWidget->setLayout(layout); - for (int j = 0; j < lists.at(i).count(); j++) { + for(int j = 0; j < lists.at(i).count(); j++) { HomePageItem * item = new HomePageItem(itemWidget, i, lists.at(i).at(j)); item->setFixedSize(300, 48); layout->addWidget(item, j / 2, j % 2); } - if (lists.at(i).length() == 1) { + if(lists.at(i).length() == 1) { QWidget * emptyItem = new QWidget(itemWidget); emptyItem->setFixedSize(300, 48); //占位用widget,只有一项时在右方补全 layout->addWidget(emptyItem, 1, 2); @@ -383,8 +377,8 @@ void ContentWidget::initHomePage() { layout->setContentsMargins(0, 0, 0, 0); itemWidget->setLayout(layout); int shownItem = lists.at(i).length(); - Q_FOREACH(QString path, lists.at(i)){ - if (i == 0 && QString::compare(FileUtils::getAppName(path),"Unknown App") == 0) { + Q_FOREACH(QString path, lists.at(i)) { + if(i == 0 && QString::compare(FileUtils::getAppName(path), "Unknown App") == 0) { shownItem --; continue; } @@ -392,12 +386,12 @@ void ContentWidget::initHomePage() { item->setFixedSize(116, 116); layout->addWidget(item); } - for (int j = 0; j < 5 - shownItem; j++) { + for(int j = 0; j < 5 - shownItem; j++) { QWidget * emptyItem = new QWidget(itemWidget); emptyItem->setFixedSize(116, 116); //占位用widget,少于5项会补全后方占位 layout->addWidget(emptyItem); } - if (i == 0 && shownItem) titleLabel->setText(tr("Open Quickly")); + if(i == 0 && shownItem) titleLabel->setText(tr("Open Quickly")); else titleLabel->setText(tr("Commonly Used")); } itemWidgetLyt->setSpacing(6); @@ -428,51 +422,50 @@ int ContentWidget::currentPage() { /** * @brief ContentWidget::resetSearchList 在构建新的搜索结果列表前,先重置所有控件 */ -void ContentWidget::resetSearchList() -{ +void ContentWidget::resetSearchList() { // this->hideListView(); - if (m_fileListView) { + if(m_fileListView) { m_fileListView->hide(); m_fileTitleLabel->hide(); m_fileShowMoreLabel->hide(); m_fileListView->isHidden = true; m_fileListView->clear(); } - if (m_dirListView) { + if(m_dirListView) { m_dirListView->hide(); m_dirTitleLabel->hide(); m_dirShowMoreLabel->hide(); m_dirListView->isHidden = true; m_dirListView->clear(); } - if (m_contentListView) { + if(m_contentListView) { m_contentListView->hide(); m_contentTitleLabel->hide(); m_contentShowMoreLabel->hide(); m_contentListView->isHidden = true; m_contentListView->clear(); } - if (m_appListView) { + if(m_appListView) { m_appListView->hide(); m_appTitleLabel->hide(); m_appShowMoreLabel->hide(); m_appListView->isHidden = true; m_appListView->clear(); } - if (m_settingListView) { + if(m_settingListView) { m_settingListView->hide(); m_settingTitleLabel->hide(); m_settingShowMoreLabel->hide(); m_settingListView->isHidden = true; m_settingListView->clear(); } - if (m_bestListView) { + if(m_bestListView) { m_bestListView->hide(); m_bestTitleLabel->hide(); m_bestListView->isHidden = true; m_bestListView->clear(); } - if (m_webListView) { + if(m_webListView) { m_webListView->clear(); m_webListView->appendItem(m_keyword); m_webTitleLabel->show(); @@ -492,21 +485,21 @@ void ContentWidget::resetSearchList() m_contentShowMoreLabel->resetLabel(); m_bestList.clear(); - if (! m_appList.isEmpty()) + if(! m_appList.isEmpty()) m_appList.clear(); - if (! m_settingList.isEmpty()) + if(! m_settingList.isEmpty()) m_settingList.clear(); - if (! m_dirList.isEmpty()) + if(! m_dirList.isEmpty()) m_dirList.clear(); - if (! m_fileList.isEmpty()) + if(! m_fileList.isEmpty()) m_fileList.clear(); - if (! m_contentList.isEmpty()) + if(! m_contentList.isEmpty()) m_contentList.clear(); - if (! m_appPathList.isEmpty()) + if(! m_appPathList.isEmpty()) m_appPathList.clear(); - if (! m_appIconList.isEmpty()) + if(! m_appIconList.isEmpty()) m_appIconList.clear(); - if (!m_appDescList.isEmpty()) + if(!m_appDescList.isEmpty()) m_appDescList.clear(); } @@ -514,17 +507,16 @@ void ContentWidget::resetSearchList() * @brief ContentWidget::setSettingList 插入设置项搜索结果列表 * @param settingList */ -void ContentWidget::setSettingList(const QStringList & settingList) -{ - if (settingList.isEmpty()) +void ContentWidget::setSettingList(const QStringList & settingList) { + if(settingList.isEmpty()) return; m_settingList = settingList; - qDebug()<<"Append a best item into list: "<appendBestItem(SearchItem::SearchType::Settings, settingList.at(0)); m_settingListView->show(); m_settingTitleLabel->show(); m_settingListView->isHidden = false; - if (m_settingList.length() <= 5) { + if(m_settingList.length() <= 5) { m_settingListView->setList(m_settingList); } else { m_settingShowMoreLabel->show(); @@ -538,16 +530,16 @@ void ContentWidget::setSettingList(const QStringList & settingList) * @param appList QVector */ void ContentWidget::setAppList(const QVector& appList) { - if (appList.at(0).isEmpty()) + if(appList.at(0).isEmpty()) return; m_appList = appList.at(0); m_appPathList = appList.at(1); m_appIconList = appList.at(2); m_appDescList = appList.at(3); m_appListView->setAppList(m_appPathList, m_appIconList); - qDebug()<<"Append a best item into list: "<(m_bestListView->model()); - if (appList.at(1).at(0).isEmpty() || appList.at(1).at(0) == "") { + if(appList.at(1).at(0).isEmpty() || appList.at(1).at(0) == "") { model->setBestAppIcon(appList.at(2).at(0), false); } else { model->setBestAppIcon(appList.at(2).at(0), true); @@ -556,7 +548,7 @@ void ContentWidget::setAppList(const QVector& appList) { m_appListView->show(); m_appTitleLabel->show(); m_appListView->isHidden = false; - if (m_appList.length() <= 5) { + if(m_appList.length() <= 5) { m_appListView->setList(m_appList); } else { m_appShowMoreLabel->show(); @@ -572,86 +564,86 @@ void ContentWidget::setAppList(const QVector& appList) { * @param contents 文件内容 */ void ContentWidget::appendSearchItem(const int& type, const QString& path, QStringList contents) { - switch (type) { - case SearchItem::SearchType::Best: { - if (m_bestListView->isHidden) { - m_bestListView->show(); - m_bestTitleLabel->show(); - m_bestListView->isHidden = false; - } - m_bestListView->appendItem(path); - if (m_detailView->isEmpty()) { - m_bestListView->setCurrentIndex(m_bestListView->model()->index(0, 0, QModelIndex())); - } - break; + switch(type) { + case SearchItem::SearchType::Best: { + if(m_bestListView->isHidden) { + m_bestListView->show(); + m_bestTitleLabel->show(); + m_bestListView->isHidden = false; } - case SearchItem::SearchType::Files: { - if (m_fileListView->isHidden) { - m_fileListView->show(); - m_fileTitleLabel->show(); - m_fileListView->isHidden = false; - this->appendBestItem(SearchItem::SearchType::Files, path); - } - if (m_fileListView->getLength() < 5) { //当已搜索结果列表少于5项,直接将搜索结果添加到列表中 - m_fileListView->appendItem(path); - } else if (m_fileListView->getLength() == 5) { //当已搜索结果等于5项,新增的被折叠,显示“展开”按钮 - m_fileShowMoreLabel->show(); - } else { //当搜索列表显示的大于5项,说明列表被展开,可以继续把新增项添加到列表中 - m_fileListView->appendItem(path); - } - m_fileList.append(path); - break;; + m_bestListView->appendItem(path); + if(m_detailView->isEmpty()) { + m_bestListView->setCurrentIndex(m_bestListView->model()->index(0, 0, QModelIndex())); } - case SearchItem::SearchType::Dirs: { - if (m_dirListView->isHidden) { - m_dirListView->show(); - m_dirTitleLabel->show(); - m_dirListView->isHidden = false; - this->appendBestItem(SearchItem::SearchType::Dirs, path); - } - if (m_dirListView->getLength() < 5) { - m_dirListView->appendItem(path); - } else if (m_dirListView->getLength() == 5) { - m_dirShowMoreLabel->show(); - } else { - m_dirListView->appendItem(path); - } - m_dirList.append(path); - break; + break; + } + case SearchItem::SearchType::Files: { + if(m_fileListView->isHidden) { + m_fileListView->show(); + m_fileTitleLabel->show(); + m_fileListView->isHidden = false; + this->appendBestItem(SearchItem::SearchType::Files, path); } - case SearchItem::SearchType::Contents: { - if (m_contentListView->isHidden) { - m_contentListView->show(); - m_contentTitleLabel->show(); - m_contentListView->isHidden = false; - for (int i = 0; i < contents.length(); i ++) { - m_bestContent.append(contents.at(i)); - if (i != contents.length() - 1) { - m_bestContent.append("\n"); - } - } - this->appendBestItem(SearchItem::SearchType::Contents, path); - } - if (m_contentListView->getLength() < 5) { - m_contentListView->appendItem(path); - } else if (m_contentListView->getLength() == 5) { - m_contentShowMoreLabel->show(); - } else { - m_contentListView->appendItem(path); - } - m_contentList.append(path); - QString temp; - for (int i = 0; i < contents.length(); i ++) { - temp.append(contents.at(i)); - if (i != contents.length() - 1) { - temp.append("\n"); + if(m_fileListView->getLength() < 5) { //当已搜索结果列表少于5项,直接将搜索结果添加到列表中 + m_fileListView->appendItem(path); + } else if(m_fileListView->getLength() == 5) { //当已搜索结果等于5项,新增的被折叠,显示“展开”按钮 + m_fileShowMoreLabel->show(); + } else { //当搜索列表显示的大于5项,说明列表被展开,可以继续把新增项添加到列表中 + m_fileListView->appendItem(path); + } + m_fileList.append(path); + break;; + } + case SearchItem::SearchType::Dirs: { + if(m_dirListView->isHidden) { + m_dirListView->show(); + m_dirTitleLabel->show(); + m_dirListView->isHidden = false; + this->appendBestItem(SearchItem::SearchType::Dirs, path); + } + if(m_dirListView->getLength() < 5) { + m_dirListView->appendItem(path); + } else if(m_dirListView->getLength() == 5) { + m_dirShowMoreLabel->show(); + } else { + m_dirListView->appendItem(path); + } + m_dirList.append(path); + break; + } + case SearchItem::SearchType::Contents: { + if(m_contentListView->isHidden) { + m_contentListView->show(); + m_contentTitleLabel->show(); + m_contentListView->isHidden = false; + for(int i = 0; i < contents.length(); i ++) { + m_bestContent.append(contents.at(i)); + if(i != contents.length() - 1) { + m_bestContent.append("\n"); } } - m_contentDetailList.append(temp); - break; + this->appendBestItem(SearchItem::SearchType::Contents, path); } - default: - break; + if(m_contentListView->getLength() < 5) { + m_contentListView->appendItem(path); + } else if(m_contentListView->getLength() == 5) { + m_contentShowMoreLabel->show(); + } else { + m_contentListView->appendItem(path); + } + m_contentList.append(path); + QString temp; + for(int i = 0; i < contents.length(); i ++) { + temp.append(contents.at(i)); + if(i != contents.length() - 1) { + temp.append("\n"); + } + } + m_contentDetailList.append(temp); + break; + } + default: + break; } this->resetListHeight(); return; @@ -663,23 +655,23 @@ void ContentWidget::appendSearchItem(const int& type, const QString& path, QStri * @return */ QString ContentWidget::getTitleName(const int& type) { - switch (type) { - case SearchItem::SearchType::Apps : - return tr("Apps"); - case SearchItem::SearchType::Settings : - return tr("Settings"); - case SearchItem::SearchType::Files : - return tr("Files"); - case SearchItem::SearchType::Dirs : - return tr("Dirs"); - case SearchItem::SearchType::Contents : - return tr("File Contents"); - case SearchItem::SearchType::Best : - return tr("Best Matches"); - case SearchItem::SearchType::Web : - return tr("Web Pages"); - default : - return tr("Unknown"); + switch(type) { + case SearchItem::SearchType::Apps : + return tr("Apps"); + case SearchItem::SearchType::Settings : + return tr("Settings"); + case SearchItem::SearchType::Files : + return tr("Files"); + case SearchItem::SearchType::Dirs : + return tr("Dirs"); + case SearchItem::SearchType::Contents : + return tr("File Contents"); + case SearchItem::SearchType::Best : + return tr("Best Matches"); + case SearchItem::SearchType::Web : + return tr("Web Pages"); + default : + return tr("Unknown"); } } @@ -688,11 +680,10 @@ QString ContentWidget::getTitleName(const int& type) { * @param layout 需要清空的布局 */ void ContentWidget::clearLayout(QLayout * layout) { - if (! layout) return; + if(! layout) return; QLayoutItem * child; - while ((child = layout->takeAt(0)) != 0) { - if(child->widget()) - { + while((child = layout->takeAt(0)) != 0) { + if(child->widget()) { child->widget()->setParent(NULL); //防止删除后窗口看上去没有消失 } delete child; @@ -705,12 +696,11 @@ void ContentWidget::clearLayout(QLayout * layout) { * @param type * @param path */ -void ContentWidget::onListViewRowChanged(SearchListView * listview, const int &type, const QString &path) -{ +void ContentWidget::onListViewRowChanged(SearchListView * listview, const int &type, const QString &path) { if(type == SearchItem::SearchType::Contents && !m_contentDetailList.isEmpty()) { m_detailView->isContent = true; m_detailView->setContent(m_contentDetailList.at(listview->currentIndex().row()), m_keyword); - } else if (type == SearchItem::SearchType::Best && !m_bestContent.isEmpty() && listview->currentIndex().row() == listview->getLength() - 1) { + } else if(type == SearchItem::SearchType::Best && !m_bestContent.isEmpty() && listview->currentIndex().row() == listview->getLength() - 1) { m_detailView->setContent(m_bestContent, m_keyword); m_detailView->isContent = true; m_detailView->setupWidget(SearchItem::SearchType::Contents, path); @@ -721,14 +711,14 @@ void ContentWidget::onListViewRowChanged(SearchListView * listview, const int &t } else { m_detailView->isContent = false; } - if (type == SearchItem::SearchType::Web) { + if(type == SearchItem::SearchType::Web) { m_detailView->setWebWidget(this->m_keyword); - } else if (type == SearchItem::SearchType::Apps) { + } else if(type == SearchItem::SearchType::Apps) { int index = listview->currentIndex().row(); m_detailView->setAppWidget(m_appList.at(index), m_appPathList.at(index), m_appIconList.at(index), m_appDescList.at(index)); - } else if (type == SearchItem::SearchType::Best) { - if (m_bestList.at(listview->currentIndex().row()).first == SearchItem::SearchType::Apps) { - m_detailView->setAppWidget(m_appList.at(0), m_appPathList.at(0), m_appIconList.at(0), m_appDescList.at(0)); + } else if(type == SearchItem::SearchType::Best) { + if(m_bestList.at(listview->currentIndex().row()).first == SearchItem::SearchType::Apps) { + m_detailView->setAppWidget(m_appList.at(0), m_appPathList.at(0), m_appIconList.at(0), m_appDescList.at(0)); } else { m_detailView->setupWidget(m_bestList.at(listview->currentIndex().row()).first, m_bestList.at(listview->currentIndex().row()).second); } @@ -745,20 +735,19 @@ void ContentWidget::onListViewRowChanged(SearchListView * listview, const int &t * @param type * @param path */ -void ContentWidget::onListViewRowDoubleClicked(SearchListView * listview, const int &type, const QString &path) -{ - qDebug()<<"A row has been double clicked.Type = "<currentIndex().row()).first == SearchItem::SearchType::Apps) { + if(m_appPathList.at(0) == "" || m_appPathList.at(0).isEmpty()) { m_detailView->doubleClickAction(SearchListView::ResType::App, m_appList.at(0)); } else { m_detailView->doubleClickAction(SearchListView::ResType::App, m_appPathList.at(0)); } - } else if (type == SearchItem::SearchType::Apps) { + } else if(type == SearchItem::SearchType::Apps) { int index = listview->currentIndex().row(); - if (m_appPathList.at(index) == "" || m_appPathList.at(index).isEmpty()){ + if(m_appPathList.at(index) == "" || m_appPathList.at(index).isEmpty()) { m_detailView->doubleClickAction(SearchListView::ResType::App, m_appList.at(index)); } else { m_detailView->doubleClickAction(SearchListView::ResType::App, m_appPathList.at(index)); @@ -782,8 +771,7 @@ void ContentWidget::setContentList(const QStringList& list) { * @brief ContentWidget::setKeyword 设置关键字 * @param keyword */ -void ContentWidget::setKeyword(QString keyword) -{ +void ContentWidget::setKeyword(QString keyword) { m_keyword = keyword; m_fileListView->setKeyword(keyword); m_dirListView->setKeyword(keyword); @@ -798,15 +786,13 @@ void ContentWidget::setKeyword(QString keyword) * @brief ContentWidget::setQuicklyOpenList 设置快速打开列表 * @param list */ -void ContentWidget::setQuicklyOpenList(const QStringList & list) -{ +void ContentWidget::setQuicklyOpenList(const QStringList & list) { m_quicklyOpenList = list; } /** * @brief ContentWidget::closeWebView 在主界面失焦消失的时候调用,(若webview未关闭)关闭网页搜索界面 */ -void ContentWidget::closeWebView() -{ +void ContentWidget::closeWebView() { m_detailView->closeWebWidget(); } diff --git a/src/content-widget.h b/src/content-widget.h index 9c7a528..816fa31 100644 --- a/src/content-widget.h +++ b/src/content-widget.h @@ -30,8 +30,7 @@ #include "show-more-label.h" #include "title-label.h" -class ContentWidget : public QStackedWidget -{ +class ContentWidget : public QStackedWidget { Q_OBJECT public: ContentWidget(QWidget *); diff --git a/src/control/config-file.cpp b/src/control/config-file.cpp index a171ebc..337e4d8 100644 --- a/src/control/config-file.cpp +++ b/src/control/config-file.cpp @@ -19,18 +19,18 @@ */ #include "config-file.h" -bool ConfigFile::writeCommonly(QString message){ - QSettings *m_qSettings=new QSettings(HOMEPAGE_SETTINGS,QSettings::IniFormat); - QStringList messagelist=message.split("/"); - QString appname=messagelist.last(); +bool ConfigFile::writeCommonly(QString message) { + QSettings *m_qSettings = new QSettings(HOMEPAGE_SETTINGS, QSettings::IniFormat); + QStringList messagelist = message.split("/"); + QString appname = messagelist.last(); if(!appname.contains("desktop")) return false; m_qSettings->beginGroup("Commonly"); - QStringList quickly=m_qSettings->allKeys(); - if(quickly.contains(message.mid(1, message.length()-1))){ - m_qSettings->setValue(message,m_qSettings->value(message).toInt()+1); - }else{ - m_qSettings->setValue(message,1); + QStringList quickly = m_qSettings->allKeys(); + if(quickly.contains(message.mid(1, message.length() - 1))) { + m_qSettings->setValue(message, m_qSettings->value(message).toInt() + 1); + } else { + m_qSettings->setValue(message, 1); } m_qSettings->endGroup(); if(m_qSettings) @@ -38,26 +38,26 @@ bool ConfigFile::writeCommonly(QString message){ return true; } -QStringList ConfigFile::readCommonly(){ - QSettings *m_qSettings=new QSettings(HOMEPAGE_SETTINGS,QSettings::IniFormat); +QStringList ConfigFile::readCommonly() { + QSettings *m_qSettings = new QSettings(HOMEPAGE_SETTINGS, QSettings::IniFormat); QStringList returnlist; - QMap quicklycount; + QMap quicklycount; m_qSettings->beginGroup("Commonly"); - QStringList Commonly=m_qSettings->allKeys(); - for(int i=0;ivalue(Commonly.at(i)).toInt()); + QStringList Commonly = m_qSettings->allKeys(); + for(int i = 0; i < Commonly.size(); i++) { + quicklycount.insert(Commonly.at(i), m_qSettings->value(Commonly.at(i)).toInt()); } m_qSettings->endGroup(); - QMap::iterator iter =quicklycount.begin(); + QMap::iterator iter = quicklycount.begin(); QVector> vec; - while(iter !=quicklycount.end()) { + while(iter != quicklycount.end()) { vec.push_back(qMakePair(iter.key(), iter.value())); iter++; } qSort(vec.begin(), vec.end(), [](const QPair &l, const QPair &r) { return (l.second > r.second); }); - for(int j=0;jbeginGroup("Recently"); - QStringList recently=m_qSettings->value("Recently").toStringList(); + QStringList recently = m_qSettings->value("Recently").toStringList(); m_qSettings->endGroup(); - if(recently.contains(message)){ + if(recently.contains(message)) { recently.removeOne(message); } - recently.insert(0,message); + recently.insert(0, message); m_qSettings->beginGroup("Recently"); - if (m_qSettings->value("Recently").toStringList().length() >= 20) { - m_qSettings->setValue("Recently",QStringList(recently.mid(0, 20))); + if(m_qSettings->value("Recently").toStringList().length() >= 20) { + m_qSettings->setValue("Recently", QStringList(recently.mid(0, 20))); } else { - m_qSettings->setValue("Recently",recently); + m_qSettings->setValue("Recently", recently); } m_qSettings->endGroup(); if(m_qSettings) @@ -88,34 +88,34 @@ bool ConfigFile::writeRecently(QString message){ return true; } -QStringList ConfigFile::readRecently(){ - QSettings *m_qSettings=new QSettings(HOMEPAGE_SETTINGS,QSettings::IniFormat); +QStringList ConfigFile::readRecently() { + QSettings *m_qSettings = new QSettings(HOMEPAGE_SETTINGS, QSettings::IniFormat); m_qSettings->beginGroup("Recently"); - QStringList recently=m_qSettings->value("Recently").toStringList(); + QStringList recently = m_qSettings->value("Recently").toStringList(); m_qSettings->endGroup(); if(m_qSettings) delete m_qSettings; return recently.mid(0, 4); } -bool ConfigFile::writeConfig(QString message){ +bool ConfigFile::writeConfig(QString message) { bool isWriteCommonlyDone = writeCommonly(message); bool isWriteRecentlyDone = writeRecently(message); return (isWriteCommonlyDone || isWriteRecentlyDone); } -QMap ConfigFile::readConfig(){ - QMap returnresult; - returnresult.insert("Commonly",readCommonly()); - returnresult.insert("Recently",readRecently()); +QMap ConfigFile::readConfig() { + QMap returnresult; + returnresult.insert("Commonly", readCommonly()); + returnresult.insert("Recently", readRecently()); return returnresult; } -void ConfigFile::receiveMessage(QString message){ +void ConfigFile::receiveMessage(QString message) { QFile file(HOMEPAGE_SETTINGS); - if(!file.exists()){ - file.open( QIODevice::ReadWrite | QIODevice::Text ); + if(!file.exists()) { + file.open(QIODevice::ReadWrite | QIODevice::Text); file.close(); } readConfig();//页面调用 diff --git a/src/control/config-file.h b/src/control/config-file.h index 929c336..1048fce 100644 --- a/src/control/config-file.h +++ b/src/control/config-file.h @@ -26,18 +26,17 @@ #include #include #define HOMEPAGE_SETTINGS QDir::homePath()+"/.config/org.ukui/ukui-search/ukui-search-homepage.conf" -class ConfigFile : public QObject -{ +class ConfigFile : public QObject { Q_OBJECT public: static bool writeConfig(QString message); - static QMap readConfig(); + static QMap readConfig(); static void receiveMessage(QString message); private: - static bool writeCommonly(QString message); - static QStringList readCommonly(); - static bool writeRecently(QString message); - static QStringList readRecently(); + static bool writeCommonly(QString message); + static QStringList readCommonly(); + static bool writeRecently(QString message); + static QStringList readRecently(); }; diff --git a/src/control/folder-list-item.cpp b/src/control/folder-list-item.cpp index 4706083..b834d8d 100644 --- a/src/control/folder-list-item.cpp +++ b/src/control/folder-list-item.cpp @@ -22,14 +22,12 @@ #include #include -FolderListItem::FolderListItem(QWidget *parent, const QString &path) : QWidget(parent) -{ +FolderListItem::FolderListItem(QWidget *parent, const QString &path) : QWidget(parent) { m_path = path; initUi(); } -FolderListItem::~FolderListItem() -{ +FolderListItem::~FolderListItem() { } @@ -39,7 +37,7 @@ FolderListItem::~FolderListItem() void FolderListItem::initUi() { m_layout = new QVBoxLayout(this); m_layout->setSpacing(0); - m_layout->setContentsMargins(0,0,0,0); + m_layout->setContentsMargins(0, 0, 0, 0); m_widget = new QWidget(this); m_widget->setObjectName("mWidget"); this->setFixedHeight(32); @@ -77,7 +75,7 @@ QString FolderListItem::getPath() { * @brief FolderListItem::enterEvent 鼠标移入事件 * @param event */ -void FolderListItem::enterEvent(QEvent *event){ +void FolderListItem::enterEvent(QEvent *event) { m_delLabel->show(); m_widget->setStyleSheet("QWidget#mWidget{background: rgba(0,0,0,0.1);}"); QWidget::enterEvent(event); @@ -87,7 +85,7 @@ void FolderListItem::enterEvent(QEvent *event){ * @brief FolderListItem::leaveEvent 鼠标移出事件 * @param event */ -void FolderListItem::leaveEvent(QEvent *event){ +void FolderListItem::leaveEvent(QEvent *event) { m_delLabel->hide(); m_widget->setStyleSheet("QWidget#mWidget{background: transparent;}"); QWidget::leaveEvent(event); @@ -100,9 +98,9 @@ void FolderListItem::leaveEvent(QEvent *event){ * @param event * @return */ -bool FolderListItem::eventFilter(QObject *watched, QEvent *event){ - if (watched == m_delLabel) { - if (event->type() == QEvent::MouseButtonPress) { +bool FolderListItem::eventFilter(QObject *watched, QEvent *event) { + if(watched == m_delLabel) { + if(event->type() == QEvent::MouseButtonPress) { // qDebug()<<"pressed!"; Q_EMIT this->onDelBtnClicked(m_path); } diff --git a/src/control/folder-list-item.h b/src/control/folder-list-item.h index 18180f8..4757bc8 100644 --- a/src/control/folder-list-item.h +++ b/src/control/folder-list-item.h @@ -26,8 +26,7 @@ #include #include -class FolderListItem : public QWidget -{ +class FolderListItem : public QWidget { Q_OBJECT public: explicit FolderListItem(QWidget *parent = nullptr, const QString &path = 0); diff --git a/src/control/highlight-item-delegate.cpp b/src/control/highlight-item-delegate.cpp index 334a8bc..473fe7e 100644 --- a/src/control/highlight-item-delegate.cpp +++ b/src/control/highlight-item-delegate.cpp @@ -27,8 +27,7 @@ #include #include "global-settings.h" -HighlightItemDelegate::HighlightItemDelegate(QObject *parent) : QStyledItemDelegate (parent) -{ +HighlightItemDelegate::HighlightItemDelegate(QObject *parent) : QStyledItemDelegate(parent) { } /** @@ -37,22 +36,21 @@ HighlightItemDelegate::HighlightItemDelegate(QObject *parent) : QStyledItemDeleg * \param option * \param index */ -void HighlightItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const -{ +void HighlightItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const { QStyleOptionViewItemV4 optionV4 = option; initStyleOption(&optionV4, index); - QStyle *style = optionV4.widget? optionV4.widget->style() : QApplication::style(); + QStyle *style = optionV4.widget ? optionV4.widget->style() : QApplication::style(); optionV4.text = QString(); style->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); //绘制非文本区域内容 - if (index.model()->data(index,Qt::DisplayRole).toString().isEmpty()) return; + if(index.model()->data(index, Qt::DisplayRole).toString().isEmpty()) return; QTextDocument doc; doc.setHtml(getHtmlText(painter, option, index)); //提取富文本 QAbstractTextDocumentLayout::PaintContext ctx; - if (optionV4.state & QStyle::State_Selected) + if(optionV4.state & QStyle::State_Selected) ctx.palette.setColor(QPalette::Text, optionV4.palette.color(QPalette::Active, QPalette::HighlightedText)); QRect textRect = style->subElementRect(QStyle::SE_ItemViewItemText, &optionV4); @@ -80,32 +78,31 @@ void HighlightItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem * @param index * @return */ -QString HighlightItemDelegate::getHtmlText(QPainter *painter, const QStyleOptionViewItem &itemOption, const QModelIndex &index) const -{ +QString HighlightItemDelegate::getHtmlText(QPainter *painter, const QStyleOptionViewItem &itemOption, const QModelIndex &index) const { int indexFindLeft = 0; - QString indexString = index.model()->data(index,Qt::DisplayRole).toString(); + QString indexString = index.model()->data(index, Qt::DisplayRole).toString(); QFont ft(painter->font().family(), GlobalSettings::getInstance()->getValue(FONT_SIZE_KEY).toInt()); QFontMetrics fm(ft); QString indexColString = fm.elidedText(indexString, Qt::ElideRight, itemOption.rect.width() + 10); //当字体超过Item的长度时显示为省略号 // QFontMetrics m_QFontMetrics = painter->fontMetrics(); // QString indexColString = m_QFontMetrics.elidedText(indexString, Qt::ElideRight, itemOption.rect.width() + 10); //当字体超过Item的长度时显示为省略号 QString htmlString; - if ((indexColString.toUpper()).contains((m_regFindKeyWords.toUpper()))) { + if((indexColString.toUpper()).contains((m_regFindKeyWords.toUpper()))) { indexFindLeft = indexColString.toUpper().indexOf(m_regFindKeyWords.toUpper()); //得到查找字体在当前整个Item字体中的位置 // paintKeywordHighlight(painter, itemOption, indexColString, indexFindLeft, m_regFindKeyWords.length()); htmlString = escapeHtml(indexColString.left(indexFindLeft)) + "" + escapeHtml(indexColString.mid(indexFindLeft, m_regFindKeyWords.length())) + "" + escapeHtml(indexColString.right(indexColString.length() - indexFindLeft - m_regFindKeyWords.length())); } else { bool boldOpenned = false; - for (int i = 0; i < indexColString.length(); i++) { - if ((m_regFindKeyWords.toUpper()).contains(QString(indexColString.at(i)).toUpper())) { + for(int i = 0; i < indexColString.length(); i++) { + if((m_regFindKeyWords.toUpper()).contains(QString(indexColString.at(i)).toUpper())) { // paintKeywordHighlight(painter, itemOption, indexColString, i, 1); - if (! boldOpenned) { + if(! boldOpenned) { boldOpenned = true; htmlString.append(QString("")); } htmlString.append(escapeHtml(QString(indexColString.at(i)))); } else { - if (boldOpenned) { + if(boldOpenned) { boldOpenned = false; htmlString.append(QString("")); } @@ -123,8 +120,7 @@ QString HighlightItemDelegate::getHtmlText(QPainter *painter, const QStyleOption * @param str * @return */ -QString HighlightItemDelegate::escapeHtml(const QString & str) const -{ +QString HighlightItemDelegate::escapeHtml(const QString & str) const { QString temp = str; temp.replace("<", "<"); temp.replace(">", ">"); @@ -139,8 +135,7 @@ QString HighlightItemDelegate::escapeHtml(const QString & str) const * @param indexFindLeft 关键字位置 * @param keywordLength 关键字长度 */ -void HighlightItemDelegate::paintKeywordHighlight(QPainter *painter, const QStyleOptionViewItem &itemOption, const QString &indexColString, const int &indexFindLeft, const int &keywordLength) const -{ +void HighlightItemDelegate::paintKeywordHighlight(QPainter *painter, const QStyleOptionViewItem &itemOption, const QString &indexColString, const int &indexFindLeft, const int &keywordLength) const { QPen pen(Qt::black); painter->setPen(pen); QFont font = QApplication::font(itemOption.widget); @@ -157,15 +152,14 @@ void HighlightItemDelegate::paintKeywordHighlight(QPainter *painter, const QStyl QStyle * m_QStyle = m_QWidget ? m_QWidget->style() : QApplication::style(); //得到当前的style QRect m_QRect = itemOption.rect;//得到Item的自己的Rect QPalette::ColorRole textDisplayRole = QPalette::NoRole; //设置text的role - if (itemOption.state & QStyle::State_Selected) - { + if(itemOption.state & QStyle::State_Selected) { textDisplayRole = QPalette::HighlightedText; //当选中字体的时候字体显示高亮 } else { textDisplayRole = QPalette::Text; } int findKeyWordWidth = m_leftFontMetrics.width(m_regFindKeyWords); //得到查找字体的像素宽度 - int preFindKeyWordWidth = m_leftFontMetrics.width(indexColString.mid(0,indexFindLeft)); //得到查找字体前面的字体的像素宽度 + int preFindKeyWordWidth = m_leftFontMetrics.width(indexColString.mid(0, indexFindLeft)); //得到查找字体前面的字体的像素宽度 m_QRect = m_QRect.adjusted(preFindKeyWordWidth + 3, 0, findKeyWordWidth, 0); //高亮字段 @@ -177,8 +171,7 @@ void HighlightItemDelegate::paintKeywordHighlight(QPainter *painter, const QStyl * \brief treewidget_styledItemDelegate::search_keyword 赋值关键字 * \param regFindKeyWords */ -void HighlightItemDelegate::setSearchKeyword(const QString ®FindKeyWords) -{ +void HighlightItemDelegate::setSearchKeyword(const QString ®FindKeyWords) { m_regFindKeyWords.clear(); m_regFindKeyWords = regFindKeyWords; } diff --git a/src/control/highlight-item-delegate.h b/src/control/highlight-item-delegate.h index 947dd97..8465884 100644 --- a/src/control/highlight-item-delegate.h +++ b/src/control/highlight-item-delegate.h @@ -23,15 +23,14 @@ #include -class HighlightItemDelegate : public QStyledItemDelegate -{ +class HighlightItemDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit HighlightItemDelegate(QObject *parent = nullptr); void setSearchKeyword(const QString &); private: QString m_regFindKeyWords = 0; - void paint(QPainter *,const QStyleOptionViewItem &, const QModelIndex &) const override; + void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; QString getHtmlText(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const; QString escapeHtml(const QString&) const; void paintKeywordHighlight(QPainter *, const QStyleOptionViewItem &, const QString &, const int &, const int &) const; diff --git a/src/control/home-page-item.cpp b/src/control/home-page-item.cpp index d98bbc2..8dd5440 100644 --- a/src/control/home-page-item.cpp +++ b/src/control/home-page-item.cpp @@ -28,14 +28,13 @@ #include #include -HomePageItem::HomePageItem(QWidget *parent, const int& type, const QString& path) : QWidget(parent) -{ +HomePageItem::HomePageItem(QWidget *parent, const int& type, const QString& path) : QWidget(parent) { setupUi(type, path); m_transparency = 0.06; connect(qApp, &QApplication::paletteChanged, this, [ = ]() { - if (m_namelabel) { + if(m_namelabel) { QString name = this->toolTip(); - if (m_type == ItemType::Recent) { + if(m_type == ItemType::Recent) { m_namelabel->setText(m_namelabel->fontMetrics().elidedText(name, Qt::ElideRight, 250)); } else { m_namelabel->setText(m_namelabel->fontMetrics().elidedText(name, Qt::ElideRight, 108)); @@ -44,8 +43,7 @@ HomePageItem::HomePageItem(QWidget *parent, const int& type, const QString& path }); } -HomePageItem::~HomePageItem() -{ +HomePageItem::~HomePageItem() { } /** @@ -62,42 +60,42 @@ void HomePageItem::setupUi(const int& type, const QString& path) { m_widget->installEventFilter(this); m_iconlabel = new QLabel(m_widget); m_namelabel = new QLabel(m_widget); - if (type == ItemType::Recent) { + if(type == ItemType::Recent) { m_widget->setFixedSize(300, 48); QIcon icon; - switch (SearchListView::getResType(path)) { //可能出现文件应用等,需要根据路径判断类型 - case SearchListView::ResType::App : { - icon = FileUtils::getAppIcon(path); - m_namelabel->setText(FileUtils::getAppName(path)); - QFontMetrics fontMetrics = m_namelabel->fontMetrics(); - QString name = FileUtils::getAppName(path); - m_namelabel->setText(fontMetrics.elidedText(name, Qt::ElideRight, 250)); - this->setToolTip(name); - break; - } - case SearchListView::ResType::Best : - case SearchListView::ResType::Content: - case SearchListView::ResType::Dir : - case SearchListView::ResType::File : { - icon = FileUtils::getFileIcon(QString("file://%1").arg(path)); + switch(SearchListView::getResType(path)) { //可能出现文件应用等,需要根据路径判断类型 + case SearchListView::ResType::App : { + icon = FileUtils::getAppIcon(path); + m_namelabel->setText(FileUtils::getAppName(path)); + QFontMetrics fontMetrics = m_namelabel->fontMetrics(); + QString name = FileUtils::getAppName(path); + m_namelabel->setText(fontMetrics.elidedText(name, Qt::ElideRight, 250)); + this->setToolTip(name); + break; + } + case SearchListView::ResType::Best : + case SearchListView::ResType::Content: + case SearchListView::ResType::Dir : + case SearchListView::ResType::File : { + icon = FileUtils::getFileIcon(QString("file://%1").arg(path)); // m_namelabel->setText(FileUtils::getFileName(path)); - QFontMetrics fontMetrics = m_namelabel->fontMetrics(); - QString name = FileUtils::getFileName(path); - m_namelabel->setText(fontMetrics.elidedText(name, Qt::ElideRight, 250)); - this->setToolTip(name); - break; - } - case SearchListView::ResType::Setting : { - icon = FileUtils::getSettingIcon(path, true); + QFontMetrics fontMetrics = m_namelabel->fontMetrics(); + QString name = FileUtils::getFileName(path); + m_namelabel->setText(fontMetrics.elidedText(name, Qt::ElideRight, 250)); + this->setToolTip(name); + break; + } + case SearchListView::ResType::Setting : { + icon = FileUtils::getSettingIcon(path, true); // m_namelabel->setText(FileUtils::getSettingName(path)); - QFontMetrics fontMetrics = m_namelabel->fontMetrics(); - QString name = FileUtils::getSettingName(path); - m_namelabel->setText(fontMetrics.elidedText(name, Qt::ElideRight, 250)); - this->setToolTip(name); - break; - } - default : - break; + QFontMetrics fontMetrics = m_namelabel->fontMetrics(); + QString name = FileUtils::getSettingName(path); + m_namelabel->setText(fontMetrics.elidedText(name, Qt::ElideRight, 250)); + this->setToolTip(name); + break; + } + default : + break; } m_iconlabel->setPixmap(icon.pixmap(icon.actualSize(QSize(24, 24)))); m_hlayout = new QHBoxLayout(m_widget); @@ -107,12 +105,12 @@ void HomePageItem::setupUi(const int& type, const QString& path) { m_hlayout->addWidget(m_namelabel); m_hlayout->addStretch(); return; - } else if (type == ItemType::Quick) { - QIcon icon = FileUtils::getAppIcon(path); - m_iconlabel->setPixmap(icon.pixmap(icon.actualSize(QSize(48, 48)))); - QString name = FileUtils::getAppName(path); - m_namelabel->setText(m_namelabel->fontMetrics().elidedText(name, Qt::ElideRight, 108)); - this->setToolTip(name); + } else if(type == ItemType::Quick) { + QIcon icon = FileUtils::getAppIcon(path); + m_iconlabel->setPixmap(icon.pixmap(icon.actualSize(QSize(48, 48)))); + QString name = FileUtils::getAppName(path); + m_namelabel->setText(m_namelabel->fontMetrics().elidedText(name, Qt::ElideRight, 108)); + this->setToolTip(name); } else { QIcon icon = FileUtils::getAppIcon(path); m_iconlabel->setPixmap(icon.pixmap(icon.actualSize(QSize(48, 48)))); @@ -124,56 +122,55 @@ void HomePageItem::setupUi(const int& type, const QString& path) { } m_widget->setFixedSize(116, 116); m_vlayout = new QVBoxLayout(m_widget); - m_vlayout->setContentsMargins(0,16,0,12); + m_vlayout->setContentsMargins(0, 16, 0, 12); m_iconlabel->setAlignment(Qt::AlignCenter); m_namelabel->setAlignment(Qt::AlignCenter); m_vlayout->addWidget(m_iconlabel); m_vlayout->addWidget(m_namelabel); } -void HomePageItem::onItemClicked() -{ - switch (SearchListView::getResType(m_path)) { - case SearchListView::ResType::App: { - GDesktopAppInfo * desktopAppInfo = g_desktop_app_info_new_from_filename(m_path.toLocal8Bit().data()); - g_app_info_launch(G_APP_INFO(desktopAppInfo),nullptr, nullptr, nullptr); - g_object_unref(desktopAppInfo); - break; - } - case SearchListView::ResType::Best: - case SearchListView::ResType::Content: - case SearchListView::ResType::Dir: - case SearchListView::ResType::File: { - QDesktopServices::openUrl(QUrl::fromLocalFile(m_path)); - break; - } - case SearchListView::ResType::Setting: { - //打开控制面板对应页面 - QProcess process; - process.startDetached(QString("ukui-control-center --%1").arg(m_path.left(m_path.indexOf("/")).toLower())); - break; - } - default: - break; +void HomePageItem::onItemClicked() { + switch(SearchListView::getResType(m_path)) { + case SearchListView::ResType::App: { + GDesktopAppInfo * desktopAppInfo = g_desktop_app_info_new_from_filename(m_path.toLocal8Bit().data()); + g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr); + g_object_unref(desktopAppInfo); + break; + } + case SearchListView::ResType::Best: + case SearchListView::ResType::Content: + case SearchListView::ResType::Dir: + case SearchListView::ResType::File: { + QDesktopServices::openUrl(QUrl::fromLocalFile(m_path)); + break; + } + case SearchListView::ResType::Setting: { + //打开控制面板对应页面 + QProcess process; + process.startDetached(QString("ukui-control-center --%1").arg(m_path.left(m_path.indexOf("/")).toLower())); + break; + } + default: + break; } } -bool HomePageItem::eventFilter(QObject *watched, QEvent *event){ - if (watched == m_widget){ - if (event->type() == QEvent::MouseButtonPress) { +bool HomePageItem::eventFilter(QObject *watched, QEvent *event) { + if(watched == m_widget) { + if(event->type() == QEvent::MouseButtonPress) { m_transparency = 0.06; this->update(); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { this->onItemClicked(); m_transparency = 0.06; this->update(); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_transparency = 0.15; this->update(); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_transparency = 0.06; this->update(); return true; diff --git a/src/control/home-page-item.h b/src/control/home-page-item.h index 58acdac..40a9b63 100644 --- a/src/control/home-page-item.h +++ b/src/control/home-page-item.h @@ -28,8 +28,7 @@ #include "file-utils.h" #include "search-list-view.h" -class HomePageItem : public QWidget -{ +class HomePageItem : public QWidget { Q_OBJECT public: explicit HomePageItem(QWidget *, const int&, const QString&); diff --git a/src/control/option-view.cpp b/src/control/option-view.cpp index d29b855..c793a8b 100644 --- a/src/control/option-view.cpp +++ b/src/control/option-view.cpp @@ -22,38 +22,36 @@ #include #include -OptionView::OptionView(QWidget *parent) : QWidget(parent) -{ +OptionView::OptionView(QWidget *parent) : QWidget(parent) { m_mainLyt = new QVBoxLayout(this); this->setLayout(m_mainLyt); - m_mainLyt->setContentsMargins(0,8,0,0); + m_mainLyt->setContentsMargins(0, 8, 0, 0); m_mainLyt->setSpacing(8); initUI(); } -OptionView::~OptionView() -{ - if (m_openLabel) { +OptionView::~OptionView() { + if(m_openLabel) { delete m_openLabel; m_openLabel = NULL; } - if (m_shortcutLabel) { + if(m_shortcutLabel) { delete m_shortcutLabel; m_shortcutLabel = NULL; } - if (m_panelLabel) { + if(m_panelLabel) { delete m_panelLabel; m_panelLabel = NULL; } - if (m_openPathLabel) { + if(m_openPathLabel) { delete m_openPathLabel; m_openPathLabel = NULL; } - if (m_copyPathLabel) { + if(m_copyPathLabel) { delete m_copyPathLabel; m_copyPathLabel = NULL; } - if (m_installLabel) { + if(m_installLabel) { delete m_installLabel; m_installLabel = NULL; } @@ -66,33 +64,32 @@ OptionView::~OptionView() */ void OptionView::setupOptions(const int& type, bool is_appInstalled) { this->hideOptions(); - switch (type) { - case SearchListView::ResType::App : { - setupAppOptions(is_appInstalled); - break; - } - case SearchListView::ResType::Content: - case SearchListView::ResType::Best: - case SearchListView::ResType::File : { - setupFileOptions(); - break; - } - case SearchListView::ResType::Setting : { - setupSettingOptions(); - break; - } - case SearchListView::ResType::Dir : { - setupDirOptions(); - break; - } - default: - break; + switch(type) { + case SearchListView::ResType::App : { + setupAppOptions(is_appInstalled); + break; + } + case SearchListView::ResType::Content: + case SearchListView::ResType::Best: + case SearchListView::ResType::File : { + setupFileOptions(); + break; + } + case SearchListView::ResType::Setting : { + setupSettingOptions(); + break; + } + case SearchListView::ResType::Dir : { + setupDirOptions(); + break; + } + default: + break; } } -void OptionView::initUI() -{ +void OptionView::initUI() { m_optionFrame = new QFrame(this); m_optionLyt = new QVBoxLayout(m_optionFrame); m_optionLyt->setContentsMargins(8, 0, 0, 0); @@ -150,38 +147,37 @@ void OptionView::initUI() * @param opt 选项类型 */ void OptionView::setupOptionLabel(const int& opt) { - switch (opt) { - case Options::Open: { - m_openLabel->show(); - break; - } - case Options::Shortcut: { - m_shortcutLabel->show(); - break; - } - case Options::Panel: { - m_panelLabel->show(); - break; - } - case Options::OpenPath: { - m_openPathLabel->show(); - break; - } - case Options::CopyPath: { - m_copyPathLabel->show(); - break; - } - case Options::Install: { - m_installLabel->show(); - break; - } - default: - break; + switch(opt) { + case Options::Open: { + m_openLabel->show(); + break; + } + case Options::Shortcut: { + m_shortcutLabel->show(); + break; + } + case Options::Panel: { + m_panelLabel->show(); + break; + } + case Options::OpenPath: { + m_openPathLabel->show(); + break; + } + case Options::CopyPath: { + m_copyPathLabel->show(); + break; + } + case Options::Install: { + m_installLabel->show(); + break; + } + default: + break; } } -void OptionView::hideOptions() -{ +void OptionView::hideOptions() { m_openLabel->hide(); m_shortcutLabel->hide(); m_panelLabel->hide(); @@ -195,7 +191,7 @@ void OptionView::hideOptions() * @param is_installed 应用是否已安装 */ void OptionView::setupAppOptions(bool is_installed) { - if (is_installed) { + if(is_installed) { setupOptionLabel(Options::Open); setupOptionLabel(Options::Shortcut); setupOptionLabel(Options::Panel); @@ -235,94 +231,94 @@ void OptionView::setupSettingOptions() { * @param event * @return */ -bool OptionView::eventFilter(QObject *watched, QEvent *event){ - if (m_openLabel && watched == m_openLabel){ - if (event->type() == QEvent::MouseButtonPress) { +bool OptionView::eventFilter(QObject *watched, QEvent *event) { + if(m_openLabel && watched == m_openLabel) { + if(event->type() == QEvent::MouseButtonPress) { m_openLabel->setStyleSheet("QLabel{font-size: 14px; color: #296CD9;}"); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { m_openLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); Q_EMIT this->onOptionClicked(Options::Open); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_openLabel->setStyleSheet("QLabel{font-size: 14px; color: #40A9FB;}"); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_openLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); return true; } - } else if (m_shortcutLabel && watched == m_shortcutLabel) { - if (event->type() == QEvent::MouseButtonPress) { + } else if(m_shortcutLabel && watched == m_shortcutLabel) { + if(event->type() == QEvent::MouseButtonPress) { m_shortcutLabel->setStyleSheet("QLabel{font-size: 14px; color: #296CD9;}"); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { m_shortcutLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); Q_EMIT this->onOptionClicked(Options::Shortcut); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_shortcutLabel->setStyleSheet("QLabel{font-size: 14px; color: #40A9FB;}"); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_shortcutLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); return true; } - } else if (m_panelLabel && watched == m_panelLabel) { - if (event->type() == QEvent::MouseButtonPress) { + } else if(m_panelLabel && watched == m_panelLabel) { + if(event->type() == QEvent::MouseButtonPress) { m_panelLabel->setStyleSheet("QLabel{font-size: 14px; color: #296CD9;}"); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { m_panelLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); Q_EMIT this->onOptionClicked(Options::Panel); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_panelLabel->setStyleSheet("QLabel{font-size: 14px; color: #40A9FB;}"); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_panelLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); return true; } - } else if (m_openPathLabel && watched == m_openPathLabel) { - if (event->type() == QEvent::MouseButtonPress) { + } else if(m_openPathLabel && watched == m_openPathLabel) { + if(event->type() == QEvent::MouseButtonPress) { m_openPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #296CD9;}"); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { m_openPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); Q_EMIT this->onOptionClicked(Options::OpenPath); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_openPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #40A9FB;}"); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_openPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); return true; } - } else if (m_copyPathLabel && watched == m_copyPathLabel) { - if (event->type() == QEvent::MouseButtonPress) { + } else if(m_copyPathLabel && watched == m_copyPathLabel) { + if(event->type() == QEvent::MouseButtonPress) { m_copyPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #296CD9;}"); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { m_copyPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); Q_EMIT this->onOptionClicked(Options::CopyPath); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_copyPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #40A9FB;}"); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_copyPathLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); return true; } - } else if (m_installLabel && watched == m_installLabel) { - if (event->type() == QEvent::MouseButtonPress) { + } else if(m_installLabel && watched == m_installLabel) { + if(event->type() == QEvent::MouseButtonPress) { m_installLabel->setStyleSheet("QLabel{font-size: 14px; color: #296CD9;}"); return true; - } else if (event->type() == QEvent::MouseButtonRelease) { + } else if(event->type() == QEvent::MouseButtonRelease) { m_installLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); Q_EMIT this->onOptionClicked(Options::Install); return true; - } else if (event->type() == QEvent::Enter) { + } else if(event->type() == QEvent::Enter) { m_installLabel->setStyleSheet("QLabel{font-size: 14px; color: #40A9FB;}"); return true; - } else if (event->type() == QEvent::Leave) { + } else if(event->type() == QEvent::Leave) { m_installLabel->setStyleSheet("QLabel{font-size: 14px; color: #3790FA}"); return true; } diff --git a/src/control/option-view.h b/src/control/option-view.h index 03bc57a..eadee8d 100644 --- a/src/control/option-view.h +++ b/src/control/option-view.h @@ -28,8 +28,7 @@ #include #include "search-list-view.h" -class OptionView : public QWidget -{ +class OptionView : public QWidget { Q_OBJECT public: explicit OptionView(QWidget *); diff --git a/src/control/search-detail-view.cpp b/src/control/search-detail-view.cpp index 11d4a13..8b840e3 100644 --- a/src/control/search-detail-view.cpp +++ b/src/control/search-detail-view.cpp @@ -37,14 +37,12 @@ //#include #include "config-file.h" -SearchDetailView::SearchDetailView(QWidget *parent) : QWidget(parent) -{ +SearchDetailView::SearchDetailView(QWidget *parent) : QWidget(parent) { initUI(); } -SearchDetailView::~SearchDetailView() -{ - if (m_layout) { +SearchDetailView::~SearchDetailView() { + if(m_layout) { delete m_layout; m_layout = NULL; } @@ -101,8 +99,7 @@ void SearchDetailView::setContent(const QString& text, const QString& keyword) { * @brief SearchDetailView::isEmpty 返回当前详情页是否为空 * @return */ -bool SearchDetailView::isEmpty() -{ +bool SearchDetailView::isEmpty() { return m_isEmpty; } @@ -110,8 +107,7 @@ bool SearchDetailView::isEmpty() * @brief SearchDetailView::getType 返回当前详情页显示的类型 * @return */ -int SearchDetailView::getType() -{ +int SearchDetailView::getType() { return m_type; } @@ -119,8 +115,7 @@ int SearchDetailView::getType() * @brief SearchDetailView::setWebWidget 显示为网页 * @param keyword 关键词 */ -void SearchDetailView::setWebWidget(const QString& keyword) -{ +void SearchDetailView::setWebWidget(const QString& keyword) { clearLayout(); m_isEmpty = false; m_reload = false; @@ -171,10 +166,10 @@ void SearchDetailView::setWebWidget(const QString& keyword) m_currentKeyword = keyword;//目前网页搜索的关键词,记录此词来判断网页是否需要刷新 QString address; QString engine = GlobalSettings::getInstance()->getValue(WEB_ENGINE).toString(); - if (!engine.isEmpty()) { - if (engine == "360") { + if(!engine.isEmpty()) { + if(engine == "360") { address = "https://so.com/s?q=" + keyword; //360 - } else if (engine == "sougou") { + } else if(engine == "sougou") { address = "https://www.sogou.com/web?query=" + keyword; //搜狗 } else { address = "http://baidu.com/s?word=" + keyword; //百度 @@ -191,8 +186,7 @@ void SearchDetailView::setWebWidget(const QString& keyword) // m_webView->show(); } -void SearchDetailView::setAppWidget(const QString &appname, const QString &path, const QString &iconpath, const QString &description) -{ +void SearchDetailView::setAppWidget(const QString &appname, const QString &path, const QString &iconpath, const QString &description) { m_type = SearchListView::ResType::App; m_path = path; m_name = appname.contains("/") ? appname.left(appname.indexOf("/")) : appname; @@ -206,18 +200,18 @@ void SearchDetailView::setAppWidget(const QString &appname, const QString &path, m_hLine->show(); QIcon icon; - if (path.isEmpty() || path == "") { + if(path.isEmpty() || path == "") { icon = QIcon(iconpath); m_optionView->setupOptions(m_type, false); //未安装应用有一个label显示软件描述 - if (description != "" && !description.isEmpty()) { + if(description != "" && !description.isEmpty()) { m_detailFrame->show(); m_contentLabel->show(); m_contentLabel->setText(QString(tr("Introduction: %1")).arg(description)); } } else { m_optionView->setupOptions(m_type, true); - if (QIcon::fromTheme(iconpath).isNull()) { + if(QIcon::fromTheme(iconpath).isNull()) { icon = QIcon(":/res/icons/desktop.png"); } else { icon = QIcon::fromTheme(iconpath); @@ -229,14 +223,13 @@ void SearchDetailView::setAppWidget(const QString &appname, const QString &path, QFontMetrics fontMetrics = m_nameLabel->fontMetrics(); QString showname = fontMetrics.elidedText(m_name, Qt::ElideRight, 274); //当字体长度超过215时显示为省略号 m_nameLabel->setText(showname); - if (QString::compare(showname, m_name)) { + if(QString::compare(showname, m_name)) { m_nameLabel->setToolTip(m_name); } m_typeLabel->setText(tr("Application")); } -void SearchDetailView::closeWebWidget() -{ +void SearchDetailView::closeWebWidget() { // if (m_webView) { // m_webView->close(); // m_webView = NULL; @@ -249,12 +242,11 @@ void SearchDetailView::closeWebWidget() * @param path * @return */ -bool SearchDetailView::doubleClickAction(const int &type, const QString &path) -{ - if (type == SearchListView::ResType::App && !path.contains(".desktop")) { - return installAppAction(path.mid(path.indexOf("/") + 1)); +bool SearchDetailView::doubleClickAction(const int &type, const QString &path) { + if(type == SearchListView::ResType::App && !path.contains(".desktop")) { + return installAppAction(path.mid(path.indexOf("/") + 1)); } else { - if (openAction(type, path)) { + if(openAction(type, path)) { writeConfigFile(path); return true; } @@ -265,15 +257,15 @@ bool SearchDetailView::doubleClickAction(const int &type, const QString &path) QString SearchDetailView::getHtmlText(const QString & text, const QString & keyword) { QString htmlString; bool boldOpenned = false; - for (int i = 0; i < text.length(); i++) { - if ((keyword.toUpper()).contains(QString(text.at(i)).toUpper())) { - if (! boldOpenned) { + for(int i = 0; i < text.length(); i++) { + if((keyword.toUpper()).contains(QString(text.at(i)).toUpper())) { + if(! boldOpenned) { boldOpenned = true; htmlString.append(QString("")); } htmlString.append(escapeHtml(QString(text.at(i)))); } else { - if (boldOpenned) { + if(boldOpenned) { boldOpenned = false; htmlString.append(QString("")); } @@ -289,8 +281,7 @@ QString SearchDetailView::getHtmlText(const QString & text, const QString & keyw * @param str 需要转义的字段 * @return */ -QString SearchDetailView::escapeHtml(const QString & str) -{ +QString SearchDetailView::escapeHtml(const QString & str) { QString temp = str; temp.replace("<", "<"); temp.replace(">", ">"); @@ -315,9 +306,9 @@ void SearchDetailView::setupWidget(const int& type, const QString& path) { m_hLine->show(); //文件和文件夹有一个额外的详情区域 - if (type == SearchListView::ResType::Dir || type == SearchListView::ResType::File || type == SearchListView::ResType::Content) { + if(type == SearchListView::ResType::Dir || type == SearchListView::ResType::File || type == SearchListView::ResType::Content) { m_detailFrame->show(); - if (isContent) { //文件内容区域 + if(isContent) { //文件内容区域 m_contentLabel->show(); m_contentLabel->setText(QApplication::translate("", getHtmlText(m_contentText, m_keyword).toLocal8Bit(), nullptr)); } @@ -328,14 +319,14 @@ void SearchDetailView::setupWidget(const int& type, const QString& path) { // m_pathLabel_2->setText(path); QString showPath = path; QFontMetrics fontMetrics = m_pathLabel_2->fontMetrics(); - if (fontMetrics.width(path) > m_pathLabel_2->width() - 10) { + if(fontMetrics.width(path) > m_pathLabel_2->width() - 10) { //路径长度超过230,手动添加换行符以实现折叠 int lastIndex = 0; - for (int i = lastIndex; i < path.length(); i++) { - if (fontMetrics.width(path.mid(lastIndex, i - lastIndex)) == m_pathLabel_2->width() - 10) { + for(int i = lastIndex; i < path.length(); i++) { + if(fontMetrics.width(path.mid(lastIndex, i - lastIndex)) == m_pathLabel_2->width() - 10) { lastIndex = i; showPath.insert(i, '\n'); - } else if (fontMetrics.width(path.mid(lastIndex, i - lastIndex)) > m_pathLabel_2->width() - 10) { + } else if(fontMetrics.width(path.mid(lastIndex, i - lastIndex)) > m_pathLabel_2->width() - 10) { lastIndex = i; showPath.insert(i - 1, '\n'); } else { @@ -356,33 +347,33 @@ void SearchDetailView::setupWidget(const int& type, const QString& path) { m_optionView->show(); //根据不同类型的搜索结果切换加载图片和名称的方式 - switch (type) { - case SearchListView::ResType::Content: - case SearchListView::ResType::Dir : - case SearchListView::ResType::File : { - QIcon icon = FileUtils::getFileIcon(QString("file://%1").arg(path)); - m_iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize(96, 96)))); - QFontMetrics fontMetrics = m_nameLabel->fontMetrics(); - QString wholeName = FileUtils::getFileName(path); - QString name = fontMetrics.elidedText(wholeName, Qt::ElideRight, 274); - m_nameLabel->setText(name); - if (QString::compare(name, wholeName)) { - m_nameLabel->setToolTip(wholeName); - } - m_nameLabel->setTextFormat(Qt::PlainText); //显示纯文本 - m_typeLabel->setText(tr("Document")); - break; + switch(type) { + case SearchListView::ResType::Content: + case SearchListView::ResType::Dir : + case SearchListView::ResType::File : { + QIcon icon = FileUtils::getFileIcon(QString("file://%1").arg(path)); + m_iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize(96, 96)))); + QFontMetrics fontMetrics = m_nameLabel->fontMetrics(); + QString wholeName = FileUtils::getFileName(path); + QString name = fontMetrics.elidedText(wholeName, Qt::ElideRight, 274); + m_nameLabel->setText(name); + if(QString::compare(name, wholeName)) { + m_nameLabel->setToolTip(wholeName); } - case SearchListView::ResType::Setting : { - QIcon icon = FileUtils::getSettingIcon(path, true); - m_iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize(96, 96)))); - QString settingType = path.mid(path.indexOf("/") + 1, path.lastIndexOf("/") - path.indexOf("/") - 1); //配置项所属控制面板插件名 - m_nameLabel->setText(settingType); - m_typeLabel->setText(FileUtils::getSettingName(path)); - break; - } - default: - break; + m_nameLabel->setTextFormat(Qt::PlainText); //显示纯文本 + m_typeLabel->setText(tr("Document")); + break; + } + case SearchListView::ResType::Setting : { + QIcon icon = FileUtils::getSettingIcon(path, true); + m_iconLabel->setPixmap(icon.pixmap(icon.actualSize(QSize(96, 96)))); + QString settingType = path.mid(path.indexOf("/") + 1, path.lastIndexOf("/") - path.indexOf("/") - 1); //配置项所属控制面板插件名 + m_nameLabel->setText(settingType); + m_typeLabel->setText(FileUtils::getSettingName(path)); + break; + } + default: + break; } } @@ -391,34 +382,34 @@ void SearchDetailView::setupWidget(const int& type, const QString& path) { * @param type 选中的类型 */ void SearchDetailView::execActions(const int& type, const int& option, const QString& path) { - switch (option) { - case OptionView::Options::Open: { - if (openAction(type, path)) { - writeConfigFile(path); - } - break; + switch(option) { + case OptionView::Options::Open: { + if(openAction(type, path)) { + writeConfigFile(path); } - case OptionView::Options::Shortcut: { - addDesktopShortcut(path); - break; - } - case OptionView::Options::Panel: { - addPanelShortcut(path); - break; - } - case OptionView::Options::OpenPath: { - openPathAction(path); - break; - } - case OptionView::Options::CopyPath: { - copyPathAction(path); - break; - } - case OptionView::Options::Install: { - installAppAction(m_pkgname); //未安装应用点击此选项,不使用路径作为参数,而是使用软件名 - } - default: - break; + break; + } + case OptionView::Options::Shortcut: { + addDesktopShortcut(path); + break; + } + case OptionView::Options::Panel: { + addPanelShortcut(path); + break; + } + case OptionView::Options::OpenPath: { + openPathAction(path); + break; + } + case OptionView::Options::CopyPath: { + copyPathAction(path); + break; + } + case OptionView::Options::Install: { + installAppAction(m_pkgname); //未安装应用点击此选项,不使用路径作为参数,而是使用软件名 + } + default: + break; } } @@ -427,34 +418,34 @@ void SearchDetailView::execActions(const int& type, const int& option, const QSt * @return */ bool SearchDetailView::openAction(const int& type, const QString& path) { - switch (type) { - case SearchListView::ResType::App: { - GDesktopAppInfo * desktopAppInfo = g_desktop_app_info_new_from_filename(path.toLocal8Bit().data()); - bool res = static_cast(g_app_info_launch(G_APP_INFO(desktopAppInfo),nullptr, nullptr, nullptr)); - g_object_unref(desktopAppInfo); - return res; - break; - } - case SearchListView::ResType::Best: - case SearchListView::ResType::Content: - case SearchListView::ResType::Dir: - case SearchListView::ResType::File: { + switch(type) { + case SearchListView::ResType::App: { + GDesktopAppInfo * desktopAppInfo = g_desktop_app_info_new_from_filename(path.toLocal8Bit().data()); + bool res = static_cast(g_app_info_launch(G_APP_INFO(desktopAppInfo), nullptr, nullptr, nullptr)); + g_object_unref(desktopAppInfo); + return res; + break; + } + case SearchListView::ResType::Best: + case SearchListView::ResType::Content: + case SearchListView::ResType::Dir: + case SearchListView::ResType::File: { // QProcess process; // process.startDetached(QString("xdg-open %1").arg(path)); - return QDesktopServices::openUrl(QUrl::fromLocalFile(path)); - break; - } - case SearchListView::ResType::Setting: { - //打开控制面板对应页面 - QProcess process; - if (path.left(path.indexOf("/")).toLower() == "wallpaper") - return process.startDetached(QString("ukui-control-center --background")); - else return process.startDetached(QString("ukui-control-center --%1").arg(path.left(path.indexOf("/")).toLower())); - break; - } - default: - return false; - break; + return QDesktopServices::openUrl(QUrl::fromLocalFile(path)); + break; + } + case SearchListView::ResType::Setting: { + //打开控制面板对应页面 + QProcess process; + if(path.left(path.indexOf("/")).toLower() == "wallpaper") + return process.startDetached(QString("ukui-control-center --background")); + else return process.startDetached(QString("ukui-control-center --%1").arg(path.left(path.indexOf("/")).toLower())); + break; + } + default: + return false; + break; } } @@ -464,7 +455,7 @@ bool SearchDetailView::openAction(const int& type, const QString& path) { * @return */ bool SearchDetailView::writeConfigFile(const QString& path) { - if (ConfigFile::writeConfig(path)) { + if(ConfigFile::writeConfig(path)) { Q_EMIT this->configFileChanged(); return true; } @@ -474,8 +465,7 @@ bool SearchDetailView::writeConfigFile(const QString& path) { /** * @brief SearchDetailView::initUI 初始化ui */ -void SearchDetailView::initUI() -{ +void SearchDetailView::initUI() { m_layout = new QVBoxLayout(this); this->setLayout(m_layout); m_layout->setContentsMargins(16, 60, 16, 24); @@ -527,7 +517,7 @@ void SearchDetailView::initUI() //文件和文件夹有一个额外的详情区域 m_detailFrame = new QFrame(this); m_detailLyt = new QVBoxLayout(m_detailFrame); - m_detailLyt->setContentsMargins(0,0,0,0); + m_detailLyt->setContentsMargins(0, 0, 0, 0); //文件内容区域 m_contentLabel = new QLabel(m_detailFrame); @@ -585,10 +575,9 @@ bool SearchDetailView::addDesktopShortcut(const QString& path) { QFileInfo fileInfo(path); QString desktopfn = fileInfo.fileName(); QFile file(path); - QString newName = QString(dirpath+"/"+desktopfn); - bool ret = file.copy(QString(dirpath+"/"+desktopfn)); - if(ret) - { + QString newName = QString(dirpath + "/" + desktopfn); + bool ret = file.copy(QString(dirpath + "/" + desktopfn)); + if(ret) { QProcess process; process.startDetached(QString("chmod a+x %1").arg(newName)); return true; @@ -605,14 +594,14 @@ bool SearchDetailView::addPanelShortcut(const QString& path) { "/", "com.ukui.panel.desktop", QDBusConnection::sessionBus()); - if (iface.isValid()) { - QDBusReply isExist = iface.call("CheckIfExist",path); - if (isExist) { - qDebug()<<"qDebug: Add shortcut to panel failed, because it is already existed!"; + if(iface.isValid()) { + QDBusReply isExist = iface.call("CheckIfExist", path); + if(isExist) { + qDebug() << "qDebug: Add shortcut to panel failed, because it is already existed!"; return false; } - QDBusReply ret = iface.call("AddToTaskbar",path); - qDebug()<<"qDebug: Add shortcut to panel successed!"; + QDBusReply ret = iface.call("AddToTaskbar", path); + qDebug() << "qDebug: Add shortcut to panel successed!"; return true; } return false; @@ -641,21 +630,20 @@ bool SearchDetailView::copyPathAction(const QString& path) { * @param name * @return */ -bool SearchDetailView::installAppAction(const QString & name) -{ - QDBusInterface * interface = new QDBusInterface( "com.kylin.softwarecenter", - "/com/kylin/softwarecenter", - "com.kylin.utiliface", - QDBusConnection::sessionBus() ); +bool SearchDetailView::installAppAction(const QString & name) { + QDBusInterface * interface = new QDBusInterface("com.kylin.softwarecenter", + "/com/kylin/softwarecenter", + "com.kylin.utiliface", + QDBusConnection::sessionBus()); - if (interface->isValid()) { + if(interface->isValid()) { //软件商店已打开,直接跳转 - interface->call("show_search_result",name); + interface->call("show_search_result", name); bool reply = QDBusReply(interface->call(QString("show_search_result"), name)); return reply; } else { //软件商店未打开,打开软件商店下载此软件 - qDebug()<<"软件商店未打开,打开软件商店下载此软件"< #include "custom-style.h" -SearchListView::SearchListView(QWidget * parent, const QStringList& list, const int& type) : QTreeView(parent) -{ +SearchListView::SearchListView(QWidget * parent, const QStringList& list, const int& type) : QTreeView(parent) { CustomStyle * style = new CustomStyle(GlobalSettings::getInstance()->getValue(STYLE_NAME_KEY).toString()); this->setStyle(style); @@ -48,29 +47,27 @@ SearchListView::SearchListView(QWidget * parent, const QStringList& list, const this->setItemDelegate(m_styleDelegate); m_type = type; - connect(this->selectionModel(), &QItemSelectionModel::selectionChanged, this, [ = ](const QItemSelection &selected, const QItemSelection &deselected) { + connect(this->selectionModel(), &QItemSelectionModel::selectionChanged, this, [ = ](const QItemSelection & selected, const QItemSelection & deselected) { Q_EMIT this->currentRowChanged(this, getCurrentType(), m_item->m_pathlist.at(this->currentIndex().row())); m_isSelected = true; - if(!selected.isEmpty()) - { + if(!selected.isEmpty()) { QRegion region = visualRegionForSelection(selected); QRect rect = region.boundingRect(); Q_EMIT this->currentSelectPos(mapToParent(rect.topLeft())); } }); - connect(this, &SearchListView::activated, this, [ = ](const QModelIndex& index) { + connect(this, &SearchListView::activated, this, [ = ](const QModelIndex & index) { Q_EMIT this->onRowDoubleClicked(this, getCurrentType(), m_item->m_pathlist.at(index.row())); }); } -SearchListView::~SearchListView() -{ - if (m_model) { +SearchListView::~SearchListView() { + if(m_model) { delete m_model; m_model = NULL; } - if (m_item) { + if(m_item) { delete m_item; m_item = NULL; } @@ -88,11 +85,10 @@ void SearchListView::appendItem(QString path) { /** * @brief SearchListView::setList 设置整个列表 */ -void SearchListView::setList(QStringList list) -{ +void SearchListView::setList(QStringList list) { QModelIndex index = this->currentIndex(); m_model->setList(list); - if (index.row() >= 0 && index.row() < list.length() && m_isSelected) { + if(index.row() >= 0 && index.row() < list.length() && m_isSelected) { this->blockSignals(true); this->setCurrentIndex(index); this->blockSignals(false); @@ -101,13 +97,11 @@ void SearchListView::setList(QStringList list) this->setFixedHeight(m_item->getCurrentSize() * rowheight + 4); } -void SearchListView::setAppList(const QStringList &pathlist, const QStringList &iconlist) -{ +void SearchListView::setAppList(const QStringList &pathlist, const QStringList &iconlist) { m_model->setAppList(pathlist, iconlist); } -void SearchListView::appendBestItem(const QPair &pair) -{ +void SearchListView::appendBestItem(const QPair &pair) { m_model->appendBestItem(pair); } @@ -118,8 +112,7 @@ void SearchListView::removeItem(QString path) { m_model->removeItem(path); } -void SearchListView::clear() -{ +void SearchListView::clear() { this->blockSignals(true); this->clearSelection(); this->blockSignals(false); @@ -132,8 +125,7 @@ void SearchListView::clear() * @brief SearchListView::setKeyword 设置关键词 * @param keyword 关键词 */ -void SearchListView::setKeyword(QString keyword) -{ +void SearchListView::setKeyword(QString keyword) { m_styleDelegate->setSearchKeyword(keyword); } @@ -141,8 +133,7 @@ void SearchListView::setKeyword(QString keyword) * @brief SearchListView::getType 获取此列表类型 * @return */ -int SearchListView::getType() -{ +int SearchListView::getType() { return m_type; } @@ -150,15 +141,12 @@ int SearchListView::getType() * @brief SearchListView::getLength 获取当前显示的列表项数量 * @return */ -int SearchListView::getLength() -{ +int SearchListView::getLength() { return m_item->getCurrentSize(); } -void SearchListView::mousePressEvent(QMouseEvent *event) -{ - if(event->button() == Qt::LeftButton) - { +void SearchListView::mousePressEvent(QMouseEvent *event) { + if(event->button() == Qt::LeftButton) { Q_EMIT mousePressed(); } QTreeView::mousePressEvent(event); @@ -166,7 +154,7 @@ void SearchListView::mousePressEvent(QMouseEvent *event) //获取当前选项所属搜索类型 int SearchListView::getCurrentType() { - switch (m_type) { + switch(m_type) { case SearchItem::SearchType::Apps : // qDebug()<<"qDebug: One row selected, its type is application."; return ResType::App; @@ -197,11 +185,11 @@ int SearchListView::getCurrentType() { * @return */ int SearchListView::getResType(const QString& path) { - if (path.endsWith(".desktop")) { + if(path.endsWith(".desktop")) { return SearchListView::ResType::App; - } else if (QFileInfo(path).isFile()) { + } else if(QFileInfo(path).isFile()) { return SearchListView::ResType::Best; - } else if (QFileInfo(path).isDir()) { + } else if(QFileInfo(path).isDir()) { return SearchListView::ResType::Dir; } else { return SearchListView::ResType::Setting; diff --git a/src/control/search-list-view.h b/src/control/search-list-view.h index df6f642..dfbb07e 100644 --- a/src/control/search-list-view.h +++ b/src/control/search-list-view.h @@ -28,8 +28,7 @@ #include "model/search-item.h" #include "highlight-item-delegate.h" -class SearchListView : public QTreeView -{ +class SearchListView : public QTreeView { Q_OBJECT public: explicit SearchListView(QWidget *, const QStringList&, const int&); @@ -73,7 +72,7 @@ private: int m_type; Q_SIGNALS: - void currentRowChanged(SearchListView *,const int&, const QString&); + void currentRowChanged(SearchListView *, const int&, const QString&); void onRowDoubleClicked(SearchListView *, const int&, const QString&); void currentSelectPos(QPoint pos); void mousePressed(); diff --git a/src/control/show-more-label.cpp b/src/control/show-more-label.cpp index c49b04b..8cb209d 100644 --- a/src/control/show-more-label.cpp +++ b/src/control/show-more-label.cpp @@ -22,20 +22,17 @@ #include #include -ShowMoreLabel::ShowMoreLabel(QWidget *parent) : QWidget(parent) -{ +ShowMoreLabel::ShowMoreLabel(QWidget *parent) : QWidget(parent) { initUi(); m_timer = new QTimer; connect(m_timer, &QTimer::timeout, this, &ShowMoreLabel::refreshLoadState); connect(this, &ShowMoreLabel::showMoreClicked, this, &ShowMoreLabel::startLoading); } -ShowMoreLabel::~ShowMoreLabel() -{ +ShowMoreLabel::~ShowMoreLabel() { } -void ShowMoreLabel::resetLabel() -{ +void ShowMoreLabel::resetLabel() { m_isOpen = false; m_textLabel->setText(tr("Show More...")); } @@ -44,15 +41,13 @@ void ShowMoreLabel::resetLabel() * @brief ShowMoreLabel::getExpanded 获取当前是否是展开状态 * @return true已展开,false已收起 */ -bool ShowMoreLabel::getExpanded() -{ +bool ShowMoreLabel::getExpanded() { return m_isOpen; } -void ShowMoreLabel::initUi() -{ +void ShowMoreLabel::initUi() { m_layout = new QHBoxLayout(this); - m_layout->setContentsMargins(0,0,0,6); + m_layout->setContentsMargins(0, 0, 0, 6); m_textLabel = new QLabel(this); m_textLabel->setText(tr("Show More...")); m_textLabel->setCursor(QCursor(Qt::PointingHandCursor)); @@ -66,22 +61,20 @@ void ShowMoreLabel::initUi() // m_layout->addWidget(m_loadingIconLabel); } -void ShowMoreLabel::startLoading() -{ +void ShowMoreLabel::startLoading() { // m_textLabel->hide(); // m_loadingIconLabel->show(); m_timer->start(0.4 * 1000); m_textLabel->setCursor(QCursor(Qt::ArrowCursor)); } -void ShowMoreLabel::stopLoading() -{ +void ShowMoreLabel::stopLoading() { // m_loadingIconLabel->hide(); // m_textLabel->show(); - if (m_timer->isActive()) { + if(m_timer->isActive()) { m_timer->stop(); } - if (m_isOpen) { + if(m_isOpen) { m_textLabel->setText(tr("Retract")); } else { m_textLabel->setText(tr("Show More...")); @@ -89,39 +82,38 @@ void ShowMoreLabel::stopLoading() m_textLabel->setCursor(QCursor(Qt::PointingHandCursor)); } -void ShowMoreLabel::refreshLoadState() -{ - switch (m_currentState) { - case 0: { - m_textLabel->setText(tr("Loading")); - m_currentState ++; - break; - } - case 1: { - m_textLabel->setText(tr("Loading.")); - m_currentState ++; - break; - } - case 2: { - m_textLabel->setText(tr("Loading..")); - m_currentState ++; - break; - } - case 3: { - m_textLabel->setText(tr("Loading...")); - m_currentState = 0; - break; - } - default: - break; +void ShowMoreLabel::refreshLoadState() { + switch(m_currentState) { + case 0: { + m_textLabel->setText(tr("Loading")); + m_currentState ++; + break; + } + case 1: { + m_textLabel->setText(tr("Loading.")); + m_currentState ++; + break; + } + case 2: { + m_textLabel->setText(tr("Loading..")); + m_currentState ++; + break; + } + case 3: { + m_textLabel->setText(tr("Loading...")); + m_currentState = 0; + break; + } + default: + break; } } -bool ShowMoreLabel::eventFilter(QObject *watched, QEvent *event){ - if (watched == m_textLabel) { - if (event->type() == QEvent::MouseButtonPress) { - if (! m_timer->isActive()) { - if (!m_isOpen) { +bool ShowMoreLabel::eventFilter(QObject *watched, QEvent *event) { + if(watched == m_textLabel) { + if(event->type() == QEvent::MouseButtonPress) { + if(! m_timer->isActive()) { + if(!m_isOpen) { m_isOpen = true; Q_EMIT this->showMoreClicked(); } else { diff --git a/src/control/show-more-label.h b/src/control/show-more-label.h index 00ec02e..f412fae 100644 --- a/src/control/show-more-label.h +++ b/src/control/show-more-label.h @@ -26,8 +26,7 @@ #include #include -class ShowMoreLabel : public QWidget -{ +class ShowMoreLabel : public QWidget { Q_OBJECT public: explicit ShowMoreLabel(QWidget *parent = nullptr); diff --git a/src/control/title-label.cpp b/src/control/title-label.cpp index 95066a6..0fedb2f 100644 --- a/src/control/title-label.cpp +++ b/src/control/title-label.cpp @@ -22,19 +22,16 @@ #include #include -TitleLabel::TitleLabel(QWidget * parent) : QLabel(parent) -{ +TitleLabel::TitleLabel(QWidget * parent) : QLabel(parent) { this->setContentsMargins(8, 0, 0, 0); this->setFixedHeight(24); } -TitleLabel::~TitleLabel() -{ +TitleLabel::~TitleLabel() { } -void TitleLabel::paintEvent(QPaintEvent * event) -{ +void TitleLabel::paintEvent(QPaintEvent * event) { Q_UNUSED(event) QStyleOption opt; diff --git a/src/control/title-label.h b/src/control/title-label.h index 2ad9556..a9a7d40 100644 --- a/src/control/title-label.h +++ b/src/control/title-label.h @@ -23,8 +23,7 @@ #include -class TitleLabel : public QLabel -{ +class TitleLabel : public QLabel { public: TitleLabel(QWidget * parent = nullptr); ~TitleLabel(); diff --git a/src/create-index-ask-dialog.cpp b/src/create-index-ask-dialog.cpp index 1f982a9..037914b 100644 --- a/src/create-index-ask-dialog.cpp +++ b/src/create-index-ask-dialog.cpp @@ -22,16 +22,14 @@ #include "create-index-ask-dialog.h" #include -CreateIndexAskDialog::CreateIndexAskDialog(QWidget *parent) : QDialog(parent) -{ +CreateIndexAskDialog::CreateIndexAskDialog(QWidget *parent) : QDialog(parent) { this->setWindowIcon(QIcon::fromTheme("kylin-search")); this->setWindowTitle(tr("ukui-search")); initUi(); } -void CreateIndexAskDialog::initUi() -{ +void CreateIndexAskDialog::initUi() { this->setFixedSize(380, 202); m_mainLyt = new QVBoxLayout(this); this->setLayout(m_mainLyt); @@ -116,8 +114,7 @@ void CreateIndexAskDialog::initUi() /** * @brief CreateIndexAskDialog::paintEvent 绘制窗口背景(默认背景较暗) */ -void CreateIndexAskDialog::paintEvent(QPaintEvent *event) -{ +void CreateIndexAskDialog::paintEvent(QPaintEvent *event) { Q_UNUSED(event) QPainter p(this); @@ -125,7 +122,7 @@ void CreateIndexAskDialog::paintEvent(QPaintEvent *event) QPainterPath rectPath; rectPath.addRect(this->rect()); p.save(); - p.fillPath(rectPath,palette().color(QPalette::Base)); + p.fillPath(rectPath, palette().color(QPalette::Base)); p.restore(); return QDialog::paintEvent(event); } diff --git a/src/create-index-ask-dialog.h b/src/create-index-ask-dialog.h index 8a2f940..c270a30 100644 --- a/src/create-index-ask-dialog.h +++ b/src/create-index-ask-dialog.h @@ -31,8 +31,7 @@ #include #include -class CreateIndexAskDialog : public QDialog -{ +class CreateIndexAskDialog : public QDialog { Q_OBJECT public: CreateIndexAskDialog(QWidget *parent = nullptr); diff --git a/src/custom-style.cpp b/src/custom-style.cpp index 9aa3429..10fee8e 100644 --- a/src/custom-style.cpp +++ b/src/custom-style.cpp @@ -21,19 +21,19 @@ #include "custom-style.h" -CustomStyle::CustomStyle(const QString &proxyStyleName, QObject *parent) : QProxyStyle(proxyStyleName) -{ +CustomStyle::CustomStyle(const QString &proxyStyleName, QObject *parent) : QProxyStyle(proxyStyleName) { } -QSize CustomStyle::sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const -{ - switch (type) { - case CT_ItemViewItem: { - QSize size(0, GlobalSettings::getInstance()->getValue(FONT_SIZE_KEY).toDouble() * 2); - return size; - } break; - default: break; +QSize CustomStyle::sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const { + switch(type) { + case CT_ItemViewItem: { + QSize size(0, GlobalSettings::getInstance()->getValue(FONT_SIZE_KEY).toDouble() * 2); + return size; + } + break; + default: + break; } return QProxyStyle::sizeFromContents(type, option, contentsSize, widget); } diff --git a/src/custom-style.h b/src/custom-style.h index 79ccad8..bc07fee 100644 --- a/src/custom-style.h +++ b/src/custom-style.h @@ -24,11 +24,10 @@ #include #include "global-settings.h" -class CustomStyle : public QProxyStyle -{ +class CustomStyle : public QProxyStyle { Q_OBJECT public: - explicit CustomStyle(const QString &proxyStyleName = "windows",QObject *parent = nullptr); + explicit CustomStyle(const QString &proxyStyleName = "windows", QObject *parent = nullptr); virtual QSize sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget = nullptr) const; }; diff --git a/src/input-box.cpp b/src/input-box.cpp index d6d751a..fd40a30 100644 --- a/src/input-box.cpp +++ b/src/input-box.cpp @@ -23,52 +23,45 @@ /** * @brief ukui-search顶部搜索界面 */ -SeachBarWidget::SeachBarWidget(QWidget *parent):QWidget(parent) -{ +SeachBarWidget::SeachBarWidget(QWidget *parent): QWidget(parent) { } -SeachBarWidget::~SeachBarWidget() -{ +SeachBarWidget::~SeachBarWidget() { } /** * @brief ukui-search 顶部搜索框的ui,包含设置按钮 */ -SeachBar::SeachBar() -{ +SeachBar::SeachBar() { setFocusPolicy(Qt::NoFocus); } -SearchBarWidgetLayout::SearchBarWidgetLayout() -{ +SearchBarWidgetLayout::SearchBarWidgetLayout() { } -SearchBarWidgetLayout::~SearchBarWidgetLayout() -{ +SearchBarWidgetLayout::~SearchBarWidgetLayout() { } -SeachBar::~SeachBar() -{ +SeachBar::~SeachBar() { } /** * @brief 顶部搜索框所在界面的布局 */ -SearchBarHLayout::SearchBarHLayout(QWidget *parent):QHBoxLayout(parent) -{ +SearchBarHLayout::SearchBarHLayout(QWidget *parent): QHBoxLayout(parent) { initUI(); m_timer = new QTimer; - connect(m_timer, &QTimer::timeout, this, [ = ](){ + connect(m_timer, &QTimer::timeout, this, [ = ]() { m_timer->stop(); Q_EMIT this->textChanged(m_queryLineEdit->text()); }); connect(m_queryLineEdit, &SearchLineEdit::textChanged, this, [ = ](QString text) { - if (m_isEmpty) { + if(m_isEmpty) { m_isEmpty = false; Q_EMIT this->textChanged(text); } else { - if (text == "") { + if(text == "") { m_isEmpty = true; m_timer->stop(); Q_EMIT this->textChanged(m_queryLineEdit->text()); @@ -80,14 +73,12 @@ SearchBarHLayout::SearchBarHLayout(QWidget *parent):QHBoxLayout(parent) }); } -SearchBarHLayout::~SearchBarHLayout() -{ - if (m_timer) { +SearchBarHLayout::~SearchBarHLayout() { + if(m_timer) { delete m_timer; m_timer = NULL; } - if(m_queryLineEdit) - { + if(m_queryLineEdit) { delete m_queryLineEdit; m_queryLineEdit = nullptr; } @@ -96,21 +87,20 @@ SearchBarHLayout::~SearchBarHLayout() /** * @brief 初始化ui */ -void SearchBarHLayout::initUI() -{ +void SearchBarHLayout::initUI() { m_queryLineEdit = new SearchLineEdit(); m_queryLineEdit->installEventFilter(this); - m_queryLineEdit->setTextMargins(30,1,0,1); - this->setContentsMargins(0,0,0,0); - this->setAlignment(m_queryLineEdit,Qt::AlignCenter); + m_queryLineEdit->setTextMargins(30, 1, 0, 1); + this->setContentsMargins(0, 0, 0, 0); + this->setAlignment(m_queryLineEdit, Qt::AlignCenter); this->addWidget(m_queryLineEdit); m_queryWidget = new QWidget(m_queryLineEdit); m_queryWidget->setFocusPolicy(Qt::NoFocus); m_queryWidget->setStyleSheet("border:0px;background:transparent"); - QHBoxLayout* queryWidLayout= new QHBoxLayout; - queryWidLayout->setContentsMargins(8,4,0,0); + QHBoxLayout* queryWidLayout = new QHBoxLayout; + queryWidLayout->setContentsMargins(8, 4, 0, 0); queryWidLayout->setAlignment(Qt::AlignJustify); queryWidLayout->setSpacing(5); m_queryWidget->setLayout(queryWidLayout); @@ -125,7 +115,7 @@ void SearchBarHLayout::initUI() m_queryText = new QLabel; m_queryText->setText(tr("Search")); m_queryText->setStyleSheet("background:transparent;color:#626c6e;"); - m_queryText->setContentsMargins(0,0,0,4); + m_queryText->setContentsMargins(0, 0, 0, 4); m_queryText->adjustSize(); queryWidLayout->addWidget(m_queryIcon); @@ -133,10 +123,10 @@ void SearchBarHLayout::initUI() m_queryWidget->setGeometry(QRect((m_queryLineEdit->width() - (m_queryIcon->width() + m_queryText->width() + 15)) / 2 - 10, 0, m_queryIcon->width() + m_queryText->width() + 20, 35)); //设置图标初始位置 - m_animation= new QPropertyAnimation(m_queryWidget,"geometry"); + m_animation = new QPropertyAnimation(m_queryWidget, "geometry"); m_animation->setDuration(100); //动画时长 - connect(m_animation,&QPropertyAnimation::finished,this, [ = ]() { - if (m_isSearching) { + connect(m_animation, &QPropertyAnimation::finished, this, [ = ]() { + if(m_isSearching) { m_queryWidget->layout()->removeWidget(m_queryText); m_queryText->setParent(nullptr); } else { @@ -145,8 +135,7 @@ void SearchBarHLayout::initUI() }); } -void SearchBarHLayout::effectiveSearchRecord() -{ +void SearchBarHLayout::effectiveSearchRecord() { m_queryLineEdit->record(); } @@ -156,7 +145,7 @@ void SearchBarHLayout::focusIn() { void SearchBarHLayout::focusOut() { m_queryLineEdit->clearFocus(); - if (! m_queryText->parent()) { + if(! m_queryText->parent()) { m_queryWidget->layout()->addWidget(m_queryText); m_queryText->adjustSize(); } @@ -172,31 +161,30 @@ QString SearchBarHLayout::text() { return m_queryLineEdit->text(); } -bool SearchBarHLayout::eventFilter(QObject *watched, QEvent *event) -{ - if (watched == m_queryLineEdit) { - if (event->type()==QEvent::FocusIn) { - if (m_queryLineEdit->text().isEmpty()) { - m_animation->stop(); - m_animation->setStartValue(m_queryWidget->geometry()); - m_animation->setEndValue(QRect(0, 0, m_queryIcon->width() + 10, 35)); - m_animation->setEasingCurve(QEasingCurve::OutQuad); - m_animation->start(); - } - m_isSearching=true; - } else if (event->type()==QEvent::FocusOut) { - if (m_queryLineEdit->text().isEmpty()) { - if (m_isSearching) { +bool SearchBarHLayout::eventFilter(QObject *watched, QEvent *event) { + if(watched == m_queryLineEdit) { + if(event->type() == QEvent::FocusIn) { + if(m_queryLineEdit->text().isEmpty()) { + m_animation->stop(); + m_animation->setStartValue(m_queryWidget->geometry()); + m_animation->setEndValue(QRect(0, 0, m_queryIcon->width() + 10, 35)); + m_animation->setEasingCurve(QEasingCurve::OutQuad); + m_animation->start(); + } + m_isSearching = true; + } else if(event->type() == QEvent::FocusOut) { + if(m_queryLineEdit->text().isEmpty()) { + if(m_isSearching) { m_animation->stop(); m_queryText->adjustSize(); m_animation->setStartValue(QRect(0, 0, m_queryIcon->width() + 5, 35)); m_animation->setEndValue(QRect((m_queryLineEdit->width() - (m_queryIcon->width() + m_queryText->width() + 10)) / 2, 0, - m_queryIcon->width() + m_queryText->width() + 20, 35)); + m_queryIcon->width() + m_queryText->width() + 20, 35)); m_animation->setEasingCurve(QEasingCurve::InQuad); m_animation->start(); } } - m_isSearching=false; + m_isSearching = false; } } return QObject::eventFilter(watched, event); @@ -205,8 +193,7 @@ bool SearchBarHLayout::eventFilter(QObject *watched, QEvent *event) /** * @brief UKuiSearchLineEdit 全局搜索的输入框 */ -SearchLineEdit::SearchLineEdit() -{ +SearchLineEdit::SearchLineEdit() { this->setFocusPolicy(Qt::ClickFocus); this->installEventFilter(this); // this->setContextMenuPolicy(Qt::NoContextMenu); @@ -229,25 +216,23 @@ SearchLineEdit::SearchLineEdit() /*发送输入框文字改变的dbus*/ QDBusConnection::sessionBus().unregisterService("org.ukui.search.service"); QDBusConnection::sessionBus().registerService("org.ukui.search.service"); - QDBusConnection::sessionBus().registerObject("/lineEdit/textChanged", this,QDBusConnection :: ExportAllSlots | QDBusConnection :: ExportAllSignals); + QDBusConnection::sessionBus().registerObject("/lineEdit/textChanged", this, QDBusConnection :: ExportAllSlots | QDBusConnection :: ExportAllSignals); connect(this, &QLineEdit::textChanged, this, &SearchLineEdit::lineEditTextChanged); - connect(this, &QLineEdit::textChanged, this, [=](){ + connect(this, &QLineEdit::textChanged, this, [ = ]() { m_isRecorded = false; }); } -void SearchLineEdit::record() -{ - if(m_isRecorded == true||text().size() <= 1||text().isEmpty()) +void SearchLineEdit::record() { + if(m_isRecorded == true || text().size() <= 1 || text().isEmpty()) return; - GlobalSettings::getInstance()->setSearchRecord(text(),QDateTime::currentDateTime()); + GlobalSettings::getInstance()->setSearchRecord(text(), QDateTime::currentDateTime()); m_isRecorded = true; m_model->setStringList(GlobalSettings::getInstance()->getSearchRecord()); } -SearchLineEdit::~SearchLineEdit() -{ +SearchLineEdit::~SearchLineEdit() { } @@ -259,9 +244,8 @@ SearchLineEdit::~SearchLineEdit() * QDBusConnection::sessionBus().connect(QString(), QString("/lineEdit/textChanged"), "org.ukui.search.inputbox", "InputBoxTextChanged", this, SLOT(client_get(QString))); * 在槽函数client_get(void) 中处理接受到的点击信号 */ -void SearchLineEdit::lineEditTextChanged(QString arg) -{ +void SearchLineEdit::lineEditTextChanged(QString arg) { QDBusMessage message = QDBusMessage::createSignal("/lineEdit/textChanged", "org.ukui.search.inputbox", "InputBoxTextChanged"); - message<screenGeometry(m->screenNumber(QCursor::pos())); int desk_x = desk_rect.width(); @@ -143,8 +143,7 @@ void searchMethod(FileUtils::SearchMethod sm){ qWarning() << "searchMethod end: " << static_cast(FileUtils::searchMethod); } */ -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { //Init log module initUkuiLog4qt("ukui-search"); @@ -152,24 +151,21 @@ int main(int argc, char *argv[]) char *p_home = NULL; unsigned int i = 0; - while(p_home == NULL) - { + while(p_home == NULL) { ::sleep(1); ++i; p_home = getenv("HOME"); - if(i%5==0) - { - qWarning()<<"I can't find home! I'm done here!!"; + if(i % 5 == 0) { + qWarning() << "I can't find home! I'm done here!!"; printf("I can't find home! I'm done here!!"); - syslog(LOG_ERR,"I can't find home! I'm done here!!\n"); + syslog(LOG_ERR, "I can't find home! I'm done here!!\n"); } } p_home = NULL; - while(!QDir(QDir::homePath()).exists()) - { - qWarning()<<"Home is not exits!!"; + while(!QDir(QDir::homePath()).exists()) { + qWarning() << "Home is not exits!!"; printf("Home is not exits!!"); - syslog(LOG_ERR,"Home is not exits!!\n"); + syslog(LOG_ERR, "Home is not exits!!\n"); ::sleep(1); } @@ -178,24 +174,23 @@ int main(int argc, char *argv[]) // Register meta type qDebug() << "ukui-search main start"; - qRegisterMetaType>("QPair"); + qRegisterMetaType>("QPair"); qRegisterMetaType("Document"); // If qt version bigger than 5.12, enable high dpi scaling and use high dpi pixmaps? #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) - QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); + QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif // Make sure only one ukui-search is running. QtSingleApplication app("ukui-search", argc, argv); app.setQuitOnLastWindowClosed(false); - if(app.isRunning()) - { + if(app.isRunning()) { app.sendMessage(QApplication::arguments().length() > 1 ? QApplication::arguments().at(1) : app.applicationFilePath()); qDebug() << QObject::tr("ukui-search is already running!"); return EXIT_SUCCESS; @@ -206,23 +201,23 @@ int main(int argc, char *argv[]) parser.addOptions({debugOption, showsearch}); parser.process(app); }*/ -/* - // Create a fifo at ~/.config/org.ukui/ukui-search, the fifo is used to control the order of child processes' running. - QDir fifoDir = QDir(QDir::homePath()+"/.config/org.ukui/ukui-search"); - if(!fifoDir.exists()) - qDebug()<<"create fifo path"<moveToPanel(); centerToScreen(w); XAtomHelper::getInstance()->setWindowMotifHint(w->winId(), w->m_hints); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f8706a8..36ce54d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -50,8 +50,7 @@ extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int tran * 可能造成窗口属性的混乱 */ MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent) -{ + QMainWindow(parent) { m_searcher = new SearchManager(this); m_settingsMatch = new SettingsMatch(this); @@ -62,13 +61,13 @@ MainWindow::MainWindow(QWidget *parent) : this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAutoFillBackground(false); this->setFocusPolicy(Qt::StrongFocus); - this->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); + this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); this->setWindowTitle(tr("ukui-search")); initUi(); initTimer(); // setProperty("useStyleWindowManager", false); //禁止拖动 - m_hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + m_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; m_hints.functions = MWM_FUNC_ALL; m_hints.decorations = MWM_DECOR_BORDER; XAtomHelper::getInstance()->setWindowMotifHint(winId(), m_hints); @@ -81,11 +80,11 @@ MainWindow::MainWindow(QWidget *parent) : setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon())); KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); - connect(qApp, &QApplication::paletteChanged, this, [ = ](const QPalette &pal) { + connect(qApp, &QApplication::paletteChanged, this, [ = ](const QPalette & pal) { this->setPalette(pal); this->update(); - Q_FOREACH (QWidget *widget, this->findChildren()) { - if (widget) { + Q_FOREACH(QWidget *widget, this->findChildren()) { + if(widget) { widget->update(); } } @@ -93,7 +92,7 @@ MainWindow::MainWindow(QWidget *parent) : m_search_result_file = new QQueue; m_search_result_dir = new QQueue; - m_search_result_content = new QQueue>; + m_search_result_content = new QQueue>; m_search_result_thread = new SearchResult(this); m_seach_app_thread = new SearchAppThread(this); // m_search_result_thread->start(); @@ -111,7 +110,7 @@ MainWindow::MainWindow(QWidget *parent) : }); qRegisterMetaType>("QVector"); connect(m_seach_app_thread, &SearchAppThread::searchResultApp, this, [ = ](const QVector& applist) { - qDebug()<<"Append applist: "<setAppList(applist); }); @@ -119,10 +118,9 @@ MainWindow::MainWindow(QWidget *parent) : m_sys_tray_icon->setIcon(QIcon::fromTheme("system-search-symbolic")); m_sys_tray_icon->setToolTip(tr("Global Search")); m_sys_tray_icon->show(); - connect(m_sys_tray_icon,&QSystemTrayIcon::activated,this,[=](QSystemTrayIcon::ActivationReason reason){ - if(reason == QSystemTrayIcon::Trigger) - { - if (!this->isVisible()) { + connect(m_sys_tray_icon, &QSystemTrayIcon::activated, this, [ = ](QSystemTrayIcon::ActivationReason reason) { + if(reason == QSystemTrayIcon::Trigger) { + if(!this->isVisible()) { clearSearchResult(); // this->moveToPanel(); centerToScreen(this); @@ -146,29 +144,28 @@ MainWindow::MainWindow(QWidget *parent) : } -MainWindow::~MainWindow() -{ - if (m_searchWidget) { +MainWindow::~MainWindow() { + if(m_searchWidget) { delete m_searchWidget; m_searchWidget = NULL; } - if (m_searchLayout) { + if(m_searchLayout) { delete m_searchLayout; m_searchLayout = NULL; } - if (m_settingsWidget) { + if(m_settingsWidget) { delete m_settingsWidget; m_settingsWidget = NULL; } - if (m_askDialog) { + if(m_askDialog) { delete m_askDialog; m_askDialog = NULL; } - if (m_askTimer) { + if(m_askTimer) { delete m_askTimer; m_askTimer = NULL; } - if (m_search_gsettings) { + if(m_search_gsettings) { delete m_search_gsettings; m_search_gsettings = NULL; } @@ -178,8 +175,7 @@ MainWindow::~MainWindow() * @brief initUi * 设置本窗口的大小 this->setFixedSize(640, 640); */ -void MainWindow::initUi() -{ +void MainWindow::initUi() { this->setFixedSize(640, 590); m_frame = new QFrame(this); @@ -206,8 +202,8 @@ void MainWindow::initUi() m_menuBtn->setProperty("isWindowButton", 0x01); m_menuBtn->setFlat(true); connect(m_menuBtn, &QPushButton::clicked, this, [ = ]() { - if (m_settingsWidget) { //当此窗口已存在时,仅需置顶 - if (!m_settingsWidget->isVisible()) { + if(m_settingsWidget) { //当此窗口已存在时,仅需置顶 + if(!m_settingsWidget->isVisible()) { centerToScreen(m_settingsWidget); } m_settingsWidget->showWidget(); @@ -217,8 +213,8 @@ void MainWindow::initUi() connect(this, &MainWindow::webEngineChanged, m_settingsWidget, [ = ]() { m_settingsWidget->resetWebEngine(); }); - connect(m_settingsWidget, &SettingsWidget::webEngineChanged, this, [ = ](const QString &engine) { - if (m_search_gsettings && m_search_gsettings->keys().contains(WEB_ENGINE_KEY)) { + connect(m_settingsWidget, &SettingsWidget::webEngineChanged, this, [ = ](const QString & engine) { + if(m_search_gsettings && m_search_gsettings->keys().contains(WEB_ENGINE_KEY)) { m_search_gsettings->set(WEB_ENGINE_KEY, engine); } else { GlobalSettings::getInstance()->setValue(WEB_ENGINE, engine); @@ -251,15 +247,15 @@ void MainWindow::initUi() mainlayout->addWidget(m_titleFrame); mainlayout->addWidget(m_contentFrame); mainlayout->addWidget(m_searchWidget); - connect(m_contentFrame,&ContentWidget::mousePressed,m_searchLayout,&SearchBarHLayout::effectiveSearchRecord); + connect(m_contentFrame, &ContentWidget::mousePressed, m_searchLayout, &SearchBarHLayout::effectiveSearchRecord); connect(QApplication::primaryScreen(), &QScreen::geometryChanged, this, &MainWindow::monitorResolutionChange); connect(qApp, &QApplication::primaryScreenChanged, this, &MainWindow::primaryScreenChangedSlot); connect(m_searchLayout, &SearchBarHLayout::textChanged, this, [ = ](QString text) { - if (text == "") { - if (m_search_result_thread->isRunning()) { + if(text == "") { + if(m_search_result_thread->isRunning()) { m_search_result_thread->requestInterruption(); m_search_result_thread->quit(); } @@ -268,16 +264,16 @@ void MainWindow::initUi() m_askTimer->stop(); } else { m_contentFrame->setCurrentIndex(1); - QTimer::singleShot(10,this,[=](){ + QTimer::singleShot(10, this, [ = ]() { m_search_result_file->clear(); m_search_result_dir->clear(); m_search_result_content->clear(); - if (! m_search_result_thread->isRunning()) { + if(! m_search_result_thread->isRunning()) { m_search_result_thread->start(); } searchContent(text); //允许弹窗且当前次搜索(为关闭主界面,算一次搜索过程)未询问且当前为暴力搜索 - if (GlobalSettings::getInstance()->getValue(ENABLE_CREATE_INDEX_ASK_DIALOG).toString() != "false" && !m_currentSearchAsked && FileUtils::searchMethod == FileUtils::SearchMethod::DIRECTSEARCH) + if(GlobalSettings::getInstance()->getValue(ENABLE_CREATE_INDEX_ASK_DIALOG).toString() != "false" && !m_currentSearchAsked && FileUtils::searchMethod == FileUtils::SearchMethod::DIRECTSEARCH) m_askTimer->start(); }); } @@ -291,27 +287,27 @@ void MainWindow::initUi() //创建索引询问弹窗 m_askDialog = new CreateIndexAskDialog(this); MotifWmHints ask_dialog_hints; - ask_dialog_hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + ask_dialog_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; ask_dialog_hints.functions = MWM_FUNC_ALL; ask_dialog_hints.decorations = MWM_DECOR_BORDER; XAtomHelper::getInstance()->setWindowMotifHint(m_askDialog->winId(), ask_dialog_hints); connect(m_askDialog, &CreateIndexAskDialog::closed, this, [ = ]() { m_isAskDialogVisible = false; }); - connect(m_askDialog, &CreateIndexAskDialog::btnClicked, this, [ = ](const bool &create_index, const bool &no_longer_ask) { - if (no_longer_ask) { + connect(m_askDialog, &CreateIndexAskDialog::btnClicked, this, [ = ](const bool & create_index, const bool & no_longer_ask) { + if(no_longer_ask) { GlobalSettings::getInstance()->setValue(ENABLE_CREATE_INDEX_ASK_DIALOG, "false"); } else { GlobalSettings::getInstance()->setValue(ENABLE_CREATE_INDEX_ASK_DIALOG, "true"); } - if (create_index) { - if (m_search_gsettings && m_search_gsettings->keys().contains(SEARCH_METHOD_KEY)) { + if(create_index) { + if(m_search_gsettings && m_search_gsettings->keys().contains(SEARCH_METHOD_KEY)) { m_search_gsettings->set(SEARCH_METHOD_KEY, true); } else { - //调用创建索引接口 - Q_EMIT this->searchMethodChanged(FileUtils::SearchMethod::INDEXSEARCH); - //创建索引十秒后重新搜索一次(如果用户十秒内没有退出搜索界面且没有重新搜索) - m_researchTimer->start(); + //调用创建索引接口 + Q_EMIT this->searchMethodChanged(FileUtils::SearchMethod::INDEXSEARCH); + //创建索引十秒后重新搜索一次(如果用户十秒内没有退出搜索界面且没有重新搜索) + m_researchTimer->start(); } } }); @@ -321,9 +317,8 @@ void MainWindow::initUi() * @brief bootOptionsFilter 过滤终端命令 * @param opt */ -void MainWindow::bootOptionsFilter(QString opt) -{ - if (opt == "-s" || opt == "--show") { +void MainWindow::bootOptionsFilter(QString opt) { + if(opt == "-s" || opt == "--show") { clearSearchResult(); // this->moveToPanel(); centerToScreen(this); @@ -347,8 +342,7 @@ void MainWindow::clearSearchResult() { /** * @brief MainWindow::createIndexSlot 允许创建索引的槽函数 */ -void MainWindow::createIndexSlot() -{ +void MainWindow::createIndexSlot() { } /** @@ -360,8 +354,7 @@ void MainWindow::createIndexSlot() * @brief monitorResolutionChange 监听屏幕改变 * @param rect */ -void MainWindow::monitorResolutionChange(QRect rect) -{ +void MainWindow::monitorResolutionChange(QRect rect) { Q_UNUSED(rect); } @@ -369,8 +362,7 @@ void MainWindow::monitorResolutionChange(QRect rect) * @brief primaryScreenChangedSlot 监听分辨率改变 * @param screen */ -void MainWindow::primaryScreenChangedSlot(QScreen *screen) -{ +void MainWindow::primaryScreenChangedSlot(QScreen *screen) { Q_UNUSED(screen); } @@ -379,7 +371,7 @@ void MainWindow::primaryScreenChangedSlot(QScreen *screen) * @brief searchContent 搜索关键字 * @param searchcontent */ -void MainWindow::searchContent(QString keyword){ +void MainWindow::searchContent(QString keyword) { m_contentFrame->setKeyword(keyword); //设置搜索 @@ -399,8 +391,7 @@ void MainWindow::searchContent(QString keyword){ /** * @brief MainWindow::moveToPanel 将主界面移动到任务栏旁边(跟随任务栏位置) */ -void MainWindow::moveToPanel() -{ +void MainWindow::moveToPanel() { QRect availableGeometry = qApp->primaryScreen()->availableGeometry(); QRect screenGeometry = qApp->primaryScreen()->geometry(); @@ -408,7 +399,7 @@ void MainWindow::moveToPanel() "/org/ukui/SettingsDaemon/wayland", "org.ukui.SettingsDaemon.wayland", QDBusConnection::sessionBus()); - if (QDBusReply(primaryScreenInterface.call("x")).isValid()) { + if(QDBusReply(primaryScreenInterface.call("x")).isValid()) { QDBusReply x = primaryScreenInterface.call("x"); QDBusReply y = primaryScreenInterface.call("y"); QDBusReply width = primaryScreenInterface.call("width"); @@ -426,25 +417,25 @@ void MainWindow::moveToPanel() QDesktopWidget * desktopWidget = QApplication::desktop(); QRect screenMainRect = desktopWidget->screenGeometry(0);//获取设备屏幕大小 - QDBusInterface interface( "com.ukui.panel.desktop", - "/", - "com.ukui.panel.desktop", - QDBusConnection::sessionBus() ); + QDBusInterface interface("com.ukui.panel.desktop", + "/", + "com.ukui.panel.desktop", + QDBusConnection::sessionBus()); int position = QDBusReply(interface.call("GetPanelPosition", "position")); int height = QDBusReply(interface.call("GetPanelSize", "height")); int d = 8; //窗口边沿到任务栏距离 - if (position == 0) { + if(position == 0) { //任务栏在下侧 this->move(availableGeometry.x() + availableGeometry.width() - this->width() - d, screenGeometry.y() + screenGeometry.height() - this->height() - height - d); } else if(position == 1) { //任务栏在上侧 this->move(availableGeometry.x() + availableGeometry.width() - this->width() - d, screenGeometry.y() + height + d); - } else if (position == 2) { + } else if(position == 2) { //任务栏在左侧 this->move(screenGeometry.x() + height + d, screenGeometry.y() + screenGeometry.height() - this->height() - d); - } else if (position == 3) { + } else if(position == 3) { //任务栏在右侧 this->move(screenGeometry.x() + screenGeometry.width() - this->width() - height - d, screenGeometry.y() + screenGeometry.height() - this->height() - d); } @@ -455,8 +446,8 @@ void MainWindow::moveToPanel() * @param widget */ void MainWindow::centerToScreen(QWidget* widget) { - if (!widget) - return; + if(!widget) + return; QDesktopWidget* m = QApplication::desktop(); QRect desk_rect = m->screenGeometry(m->screenNumber(QCursor::pos())); int desk_x = desk_rect.width(); @@ -467,7 +458,7 @@ void MainWindow::centerToScreen(QWidget* widget) { "/org/ukui/SettingsDaemon/wayland", "org.ukui.SettingsDaemon.wayland", QDBusConnection::sessionBus()); - if (QDBusReply(primaryScreenInterface.call("x")).isValid()) { + if(QDBusReply(primaryScreenInterface.call("x")).isValid()) { QDBusReply width = primaryScreenInterface.call("width"); QDBusReply height = primaryScreenInterface.call("height"); desk_x = width; @@ -476,26 +467,25 @@ void MainWindow::centerToScreen(QWidget* widget) { widget->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 2 - y / 2 + desk_rect.top()); } -void MainWindow::initGsettings() -{ +void MainWindow::initGsettings() { const QByteArray id(UKUI_SEARCH_SCHEMAS); - if (QGSettings::isSchemaInstalled(id)) { + if(QGSettings::isSchemaInstalled(id)) { m_search_gsettings = new QGSettings(id); - connect(m_search_gsettings, &QGSettings::changed, this, [ = ](const QString &key) { - if (key == SEARCH_METHOD_KEY) { + connect(m_search_gsettings, &QGSettings::changed, this, [ = ](const QString & key) { + if(key == SEARCH_METHOD_KEY) { bool is_index_search = m_search_gsettings->get(SEARCH_METHOD_KEY).toBool(); this->setSearchMethod(is_index_search); - } else if (key == WEB_ENGINE_KEY) { + } else if(key == WEB_ENGINE_KEY) { QString web_engine = m_search_gsettings->get(WEB_ENGINE_KEY).toString(); GlobalSettings::getInstance()->setValue(WEB_ENGINE, web_engine); Q_EMIT this->webEngineChanged(); } }); - if (m_search_gsettings->keys().contains(SEARCH_METHOD_KEY)) { + if(m_search_gsettings->keys().contains(SEARCH_METHOD_KEY)) { bool is_index_search = m_search_gsettings->get(SEARCH_METHOD_KEY).toBool(); this->setSearchMethod(is_index_search); } - if (m_search_gsettings->keys().contains(WEB_ENGINE_KEY)) { + if(m_search_gsettings->keys().contains(WEB_ENGINE_KEY)) { QString web_engine = m_search_gsettings->get(WEB_ENGINE_KEY).toString(); GlobalSettings::getInstance()->setValue(WEB_ENGINE, web_engine); } @@ -503,17 +493,15 @@ void MainWindow::initGsettings() } //使用GSetting获取当前窗口应该使用的透明度 -double MainWindow::getTransparentData() -{ +double MainWindow::getTransparentData() { return GlobalSettings::getInstance()->getValue(TRANSPARENCY_KEY).toDouble(); } -void MainWindow::initTimer() -{ +void MainWindow::initTimer() { m_askTimer = new QTimer; m_askTimer->setInterval(5 * 1000); connect(m_askTimer, &QTimer::timeout, this, [ = ]() { - if (this->isVisible()) { + if(this->isVisible()) { m_isAskDialogVisible = true; m_askDialog->show(); m_currentSearchAsked = true; @@ -523,7 +511,7 @@ void MainWindow::initTimer() m_researchTimer = new QTimer; m_researchTimer->setInterval(10 * 1000); connect(m_researchTimer, &QTimer::timeout, this, [ = ]() { - if (this->isVisible()) { + if(this->isVisible()) { searchContent(m_searchLayout->text()); } m_researchTimer->stop(); @@ -534,9 +522,8 @@ void MainWindow::initTimer() * @brief MainWindow::setSearchMethod 设置搜索模式 * @param is_index_search true为索引搜索,false为暴力搜索 */ -void MainWindow::setSearchMethod(const bool &is_index_search) -{ - if (is_index_search) { +void MainWindow::setSearchMethod(const bool &is_index_search) { + if(is_index_search) { //调用创建索引接口 Q_EMIT this->searchMethodChanged(FileUtils::SearchMethod::INDEXSEARCH); //创建索引十秒后重新搜索一次(如果用户十秒内没有退出搜索界面且没有重新搜索) @@ -554,18 +541,17 @@ void MainWindow::setSearchMethod(const bool &is_index_search) * @param result * @return */ -bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) -{ +bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) { Q_UNUSED(result); - if (eventType != "xcb_generic_event_t") { + if(eventType != "xcb_generic_event_t") { return false; } xcb_generic_event_t *event = (xcb_generic_event_t*)message; - switch (event->response_type & ~0x80) { + switch(event->response_type & ~0x80) { case XCB_FOCUS_OUT: - if (!m_isAskDialogVisible) { + if(!m_isAskDialogVisible) { m_currentSearchAsked = false; this->hide(); m_askTimer->stop(); @@ -583,9 +569,8 @@ bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *r return false; } -void MainWindow::keyPressEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Escape) { +void MainWindow::keyPressEvent(QKeyEvent *event) { + if(event->key() == Qt::Key_Escape) { this->hide(); m_contentFrame->closeWebView(); m_search_result_thread->requestInterruption(); diff --git a/src/mainwindow.h b/src/mainwindow.h index 21074a8..9f90e68 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -59,8 +59,7 @@ #define WEB_ENGINE_KEY "webEngine" class SearchResult; -class MainWindow : public QMainWindow -{ +class MainWindow : public QMainWindow { friend class SearchResult; Q_OBJECT @@ -103,7 +102,7 @@ private: QQueue *m_search_result_file = nullptr; QQueue *m_search_result_dir = nullptr; - QQueue> *m_search_result_content = nullptr; + QQueue> *m_search_result_content = nullptr; SearchResult * m_search_result_thread = nullptr; SearchAppThread * m_seach_app_thread = nullptr; diff --git a/src/model/search-item-model.cpp b/src/model/search-item-model.cpp index ecdca91..548b56d 100644 --- a/src/model/search-item-model.cpp +++ b/src/model/search-item-model.cpp @@ -21,11 +21,10 @@ #include "search-item-model.h" #include -SearchItemModel::SearchItemModel(QObject *parent) : QAbstractItemModel (parent) -{ +SearchItemModel::SearchItemModel(QObject *parent) : QAbstractItemModel(parent) { } -SearchItemModel::~SearchItemModel(){ +SearchItemModel::~SearchItemModel() { } @@ -36,9 +35,8 @@ SearchItemModel::~SearchItemModel(){ * @param parent * @return */ -QModelIndex SearchItemModel::index(int row, int column, const QModelIndex &parent) const -{ - if (row < 0 || row > m_item->m_pathlist.count() - 1) +QModelIndex SearchItemModel::index(int row, int column, const QModelIndex &parent) const { + if(row < 0 || row > m_item->m_pathlist.count() - 1) return QModelIndex(); return createIndex(row, column, m_item); } @@ -48,8 +46,7 @@ QModelIndex SearchItemModel::index(int row, int column, const QModelIndex &paren * @param child * @return */ -QModelIndex SearchItemModel::parent(const QModelIndex &child) const -{ +QModelIndex SearchItemModel::parent(const QModelIndex &child) const { return QModelIndex(); } @@ -59,8 +56,7 @@ QModelIndex SearchItemModel::parent(const QModelIndex &child) const * @param index 条目的索引 * @return model显示的行数 */ -int SearchItemModel::rowCount(const QModelIndex& index) const -{ +int SearchItemModel::rowCount(const QModelIndex& index) const { return index.isValid() ? 0 : m_item->m_pathlist.count(); } @@ -69,8 +65,7 @@ int SearchItemModel::rowCount(const QModelIndex& index) const * @param index 条目的索引 * @return model显示的列数 */ -int SearchItemModel::columnCount(const QModelIndex& index) const -{ +int SearchItemModel::columnCount(const QModelIndex& index) const { return index.isValid() ? 0 : 2; } @@ -92,13 +87,12 @@ int SearchItemModel::columnCount(const QModelIndex& index) const * @param role 显示内容的类型 * @return 显示内容数据 */ -QVariant SearchItemModel::data(const QModelIndex &index, int role) const -{ +QVariant SearchItemModel::data(const QModelIndex &index, int role) const { if(!index.isValid()) return QVariant(); - switch (index.column()) { + switch(index.column()) { case Icon: { - switch (role) { + switch(role) { case Qt::DecorationRole: { return m_item->getIcon(index.row()); } @@ -107,13 +101,13 @@ QVariant SearchItemModel::data(const QModelIndex &index, int role) const } } case Name: { - switch (role) { + switch(role) { case Qt::DisplayRole: { return QVariant(m_item->getName(index.row())); } - // case Qt::ForegroundRole: { - // return QColor(50, 50, 50); - // } + // case Qt::ForegroundRole: { + // return QColor(50, 50, 50); + // } default: return QVariant(); } @@ -123,8 +117,7 @@ QVariant SearchItemModel::data(const QModelIndex &index, int role) const return QVariant(); } -bool SearchItemModel::insertRows(int row, int count, const QModelIndex &parent) -{ +bool SearchItemModel::insertRows(int row, int count, const QModelIndex &parent) { this->beginInsertRows(parent, row, count); this->endInsertRows(); return true; @@ -152,15 +145,13 @@ void SearchItemModel::appendItem(QString path) { * @brief SearchItemModel::setList 直接以列表形式添加搜索结果 * @param list */ -void SearchItemModel::setList(QStringList list) -{ +void SearchItemModel::setList(QStringList list) { this->beginResetModel(); m_item->m_pathlist = list; this->endResetModel(); } -void SearchItemModel::setAppList(const QStringList &pathlist, const QStringList &iconlist) -{ +void SearchItemModel::setAppList(const QStringList &pathlist, const QStringList &iconlist) { this->beginResetModel(); m_item->m_app_pathlist = pathlist; m_item->m_app_iconlist = iconlist; @@ -171,9 +162,8 @@ void SearchItemModel::setAppList(const QStringList &pathlist, const QStringList * @brief SearchItemModel::insertBestItem 向最佳匹配列表添加一项 * @param pair <类型,路径或名称> */ -void SearchItemModel::appendBestItem(const QPair & pair) -{ - m_item->m_bestList.append(pair); +void SearchItemModel::appendBestItem(const QPair & pair) { + m_item->m_bestList.append(pair); } /** @@ -183,8 +173,7 @@ void SearchItemModel::removeItem(QString path) { m_item->removeItem(path); } -void SearchItemModel::clear() -{ +void SearchItemModel::clear() { this->beginResetModel(); m_item->clear(); this->endResetModel(); @@ -195,9 +184,8 @@ void SearchItemModel::clear() * @param str 图标名称或路径,应用安装时为图标名,未安装时为路径 * @param is_installed 应用是否已安装 */ -void SearchItemModel::setBestAppIcon(const QString &str, const bool & is_installed) -{ - if (is_installed) { +void SearchItemModel::setBestAppIcon(const QString &str, const bool & is_installed) { + if(is_installed) { m_item->m_bestAppIcon = QIcon::fromTheme(str); } else { m_item->m_bestAppIcon = QIcon(str); diff --git a/src/model/search-item-model.h b/src/model/search-item-model.h index 721d0a4..eb7b2a6 100644 --- a/src/model/search-item-model.h +++ b/src/model/search-item-model.h @@ -27,8 +27,7 @@ class SearchItem; -class SearchItemModel : public QAbstractItemModel -{ +class SearchItemModel : public QAbstractItemModel { friend class SearchItem; Q_OBJECT public: diff --git a/src/model/search-item.cpp b/src/model/search-item.cpp index 7794160..37a2948 100644 --- a/src/model/search-item.cpp +++ b/src/model/search-item.cpp @@ -22,12 +22,10 @@ #include #include -SearchItem::SearchItem(QObject *parent) : QObject(parent) -{ +SearchItem::SearchItem(QObject *parent) : QObject(parent) { } -SearchItem::~SearchItem() -{ +SearchItem::~SearchItem() { } /** @@ -36,34 +34,34 @@ SearchItem::~SearchItem() * @return 图标 */ QIcon SearchItem::getIcon(int index) { - if (index < 0 || index >= m_pathlist.count()) + if(index < 0 || index >= m_pathlist.count()) return QIcon(""); - switch (m_searchtype) { - case Settings : //设置项,返回控制面板对应插件的图标 - return FileUtils::getSettingIcon(m_pathlist.at(index), false); - case Contents: - case Dirs : - case Files : //文件,返回文件图标 - return FileUtils::getFileIcon(QString("file://%1").arg(m_pathlist.at(index))); - case Apps : {//应用,返回应用图标 + switch(m_searchtype) { + case Settings : //设置项,返回控制面板对应插件的图标 + return FileUtils::getSettingIcon(m_pathlist.at(index), false); + case Contents: + case Dirs : + case Files : //文件,返回文件图标 + return FileUtils::getFileIcon(QString("file://%1").arg(m_pathlist.at(index))); + case Apps : {//应用,返回应用图标 // return FileUtils::getAppIcon(m_pathlist.at(index)); - if (m_app_pathlist.length() > index && m_app_pathlist.at(index) == "") { //未安装,存储的是图标路径 - return QIcon(m_app_iconlist.at(index)); - } else if (m_app_pathlist.length() > index) { //已安装,存储的是图标名 - if (QIcon::fromTheme(m_app_iconlist.at(index)).isNull()) { - return QIcon(":/res/icons/desktop.png"); - } else { - return QIcon::fromTheme(m_app_iconlist.at(index)); - } - } else { + if(m_app_pathlist.length() > index && m_app_pathlist.at(index) == "") { //未安装,存储的是图标路径 + return QIcon(m_app_iconlist.at(index)); + } else if(m_app_pathlist.length() > index) { //已安装,存储的是图标名 + if(QIcon::fromTheme(m_app_iconlist.at(index)).isNull()) { return QIcon(":/res/icons/desktop.png"); + } else { + return QIcon::fromTheme(m_app_iconlist.at(index)); } + } else { + return QIcon(":/res/icons/desktop.png"); } - case Best : {//最佳匹配,含全部类型,需要自己判断,返回不同类型的图标 - return getBestIcon(index); - } - default: - return QIcon(":/res/icons/edit-find-symbolic.svg"); + } + case Best : {//最佳匹配,含全部类型,需要自己判断,返回不同类型的图标 + return getBestIcon(index); + } + default: + return QIcon(":/res/icons/edit-find-symbolic.svg"); } } @@ -73,24 +71,24 @@ QIcon SearchItem::getIcon(int index) { * @return 名字 */ QString SearchItem::getName(int index) { - if (index < 0 || index >= m_pathlist.count()) + if(index < 0 || index >= m_pathlist.count()) return 0; - switch (m_searchtype) { - case Settings : //设置项,返回功能点名 - return FileUtils::getSettingName(m_pathlist.at(index)); - case Contents: - case Dirs : - case Files : //文件,返回文件名 - return FileUtils::getFileName(m_pathlist.at(index)); - case Apps : {//应用,返回应用名 - QString whole_name = m_pathlist.at(index); - QString app_name = whole_name.contains("/") ? whole_name.left(whole_name.indexOf("/")) : whole_name; - return app_name; - } - case Best : //最佳匹配,含全部类型,需要自己判断,返回不同类型的名称 - return getBestName(index); - default: - return m_pathlist.at(index); + switch(m_searchtype) { + case Settings : //设置项,返回功能点名 + return FileUtils::getSettingName(m_pathlist.at(index)); + case Contents: + case Dirs : + case Files : //文件,返回文件名 + return FileUtils::getFileName(m_pathlist.at(index)); + case Apps : {//应用,返回应用名 + QString whole_name = m_pathlist.at(index); + QString app_name = whole_name.contains("/") ? whole_name.left(whole_name.indexOf("/")) : whole_name; + return app_name; + } + case Best : //最佳匹配,含全部类型,需要自己判断,返回不同类型的名称 + return getBestName(index); + default: + return m_pathlist.at(index); } } @@ -99,8 +97,7 @@ QString SearchItem::getName(int index) { * @param index 索引行 * @return */ -QIcon SearchItem::getBestIcon(const int &index) -{ +QIcon SearchItem::getBestIcon(const int &index) { // if (m_pathlist.at(index).endsWith(".desktop")) { // return FileUtils::getAppIcon(m_pathlist.at(index)); // } else if (QFileInfo(m_pathlist.at(index)).isFile() || QFileInfo(m_pathlist.at(index)).isDir()) { @@ -108,19 +105,19 @@ QIcon SearchItem::getBestIcon(const int &index) // } else { // return FileUtils::getSettingIcon(m_pathlist.at(index), false); // } - if (m_bestList.isEmpty() || !m_bestList.length() > index) return QIcon::fromTheme("unknown"); - switch(m_bestList.at(index).first) { - case Apps: { - return this->m_bestAppIcon; + if(m_bestList.isEmpty() || !m_bestList.length() > index) return QIcon::fromTheme("unknown"); + switch(m_bestList.at(index).first) { + case Apps: { + return this->m_bestAppIcon; // return FileUtils::getAppIcon(m_pathlist.at(index)); - } - case Settings: { - return FileUtils::getSettingIcon(m_pathlist.at(index), false); - } - default: { - return FileUtils::getFileIcon(QString("file://%1").arg(m_pathlist.at(index))); - } - } + } + case Settings: { + return FileUtils::getSettingIcon(m_pathlist.at(index), false); + } + default: { + return FileUtils::getFileIcon(QString("file://%1").arg(m_pathlist.at(index))); + } + } } /** @@ -128,21 +125,20 @@ QIcon SearchItem::getBestIcon(const int &index) * @param index 索引行 * @return */ -QString SearchItem::getBestName(const int &index) -{ - if (m_bestList.isEmpty() || !m_bestList.length() > index) return ""; +QString SearchItem::getBestName(const int &index) { + if(m_bestList.isEmpty() || !m_bestList.length() > index) return ""; switch(m_bestList.at(index).first) { - case Apps: { - QString whole_name = m_bestList.at(index).second; - QString app_name = whole_name.contains("/") ? whole_name.left(whole_name.indexOf("/")) : whole_name; - return app_name; - } - case Settings: { - return FileUtils::getSettingName(m_pathlist.at(index)); - } - default: { - return FileUtils::getFileName(m_pathlist.at(index)); - } + case Apps: { + QString whole_name = m_bestList.at(index).second; + QString app_name = whole_name.contains("/") ? whole_name.left(whole_name.indexOf("/")) : whole_name; + return app_name; + } + case Settings: { + return FileUtils::getSettingName(m_pathlist.at(index)); + } + default: { + return FileUtils::getFileName(m_pathlist.at(index)); + } } } @@ -167,8 +163,7 @@ int SearchItem::getCurrentSize() { return m_pathlist.length(); } -void SearchItem::clear() -{ +void SearchItem::clear() { m_pathlist.clear(); m_app_pathlist.clear(); m_app_iconlist.clear(); diff --git a/src/model/search-item.h b/src/model/search-item.h index f3b5b4f..651443e 100644 --- a/src/model/search-item.h +++ b/src/model/search-item.h @@ -26,8 +26,7 @@ #include "search-item-model.h" #include "file-utils.h" -class SearchItem : public QObject -{ +class SearchItem : public QObject { friend class SearchItemModel; friend class SearchListView; Q_OBJECT diff --git a/src/search-app-thread.cpp b/src/search-app-thread.cpp index ffd1493..7ab4980 100644 --- a/src/search-app-thread.cpp +++ b/src/search-app-thread.cpp @@ -3,14 +3,12 @@ size_t uniqueSymbol = 0; QMutex m_mutex; -SearchAppThread::SearchAppThread(QObject *parent) : QObject(parent) -{ +SearchAppThread::SearchAppThread(QObject *parent) : QObject(parent) { m_pool.setMaxThreadCount(1); m_pool.setExpiryTimeout(1000); } -void SearchAppThread::startSearch(const QString & keyword) -{ +void SearchAppThread::startSearch(const QString & keyword) { SearchApp *appsearch; appsearch = new SearchApp(keyword); // appsearch->setKeyword(keyword); @@ -19,13 +17,11 @@ void SearchAppThread::startSearch(const QString & keyword) } -SearchApp::SearchApp(const QString& keyword, QObject * parent) : QObject(parent) -{ +SearchApp::SearchApp(const QString& keyword, QObject * parent) : QObject(parent) { m_keyword = keyword; } -SearchApp::~SearchApp() -{ +SearchApp::~SearchApp() { } ///** @@ -37,8 +33,7 @@ SearchApp::~SearchApp() // m_keyword = keyword; //} -void SearchApp::run() -{ +void SearchApp::run() { m_mutex.lock(); uniqueSymbol++; m_mutex.unlock(); @@ -46,22 +41,20 @@ void SearchApp::run() QStringList nameList, pathList, iconList, descList; QVector appVector; AppMatch::getAppMatch()->startMatchApp(m_keyword, m_installed_apps, m_uninstalled_apps); - QMapIterator installed_iter(m_installed_apps); - while(installed_iter.hasNext()) - { + QMapIterator installed_iter(m_installed_apps); + while(installed_iter.hasNext()) { installed_iter.next(); nameList << installed_iter.key().app_name; pathList << installed_iter.value().at(0); iconList << installed_iter.value().at(1); descList << installed_iter.value().at(3); } - QMapIterator uninstalled_iter(m_uninstalled_apps); - while(uninstalled_iter.hasNext()) - { + QMapIterator uninstalled_iter(m_uninstalled_apps); + while(uninstalled_iter.hasNext()) { uninstalled_iter.next(); QString name; //当返回列表的value中含包名时,将名称按“应用名/包名”的格式存储 - if (!uninstalled_iter.value().at(2).isEmpty() && uninstalled_iter.value().at(2) != "") { + if(!uninstalled_iter.value().at(2).isEmpty() && uninstalled_iter.value().at(2) != "") { name = uninstalled_iter.key().app_name + "/" + uninstalled_iter.value().at(2); } else name = uninstalled_iter.key().app_name; nameList << name; @@ -74,7 +67,7 @@ void SearchApp::run() appVector.append(iconList); appVector.append(descList); m_mutex.lock(); - if (uniqueSymbol == uniqueSymbol) { + if(uniqueSymbol == uniqueSymbol) { Q_EMIT this->searchResultApp(appVector); } m_mutex.unlock(); diff --git a/src/search-app-thread.h b/src/search-app-thread.h index 1ac8eeb..213927c 100644 --- a/src/search-app-thread.h +++ b/src/search-app-thread.h @@ -5,8 +5,7 @@ #include #include "libsearch.h" -class SearchAppThread : public QObject -{ +class SearchAppThread : public QObject { Q_OBJECT public: @@ -20,8 +19,7 @@ Q_SIGNALS: }; -class SearchApp : public QObject, public QRunnable -{ +class SearchApp : public QObject, public QRunnable { Q_OBJECT public: SearchApp(const QString& keyword, QObject * parent = nullptr); @@ -31,8 +29,8 @@ protected: void run() override; private: QString m_keyword; - QMap m_installed_apps; - QMap m_uninstalled_apps; + QMap m_installed_apps; + QMap m_uninstalled_apps; Q_SIGNALS: void searchResultApp(const QVector&); }; diff --git a/src/search-result.cpp b/src/search-result.cpp index b5bd471..9e35ec5 100644 --- a/src/search-result.cpp +++ b/src/search-result.cpp @@ -20,8 +20,7 @@ */ #include "search-result.h" -SearchResult::SearchResult(QObject * parent) : QThread(parent) -{ +SearchResult::SearchResult(QObject * parent) : QThread(parent) { m_mainwindow = static_cast(parent); // m_timer = new QTimer; // QObject::connect(m_timer, &QTimer::timeout, this, [ = ](){ @@ -31,23 +30,21 @@ SearchResult::SearchResult(QObject * parent) : QThread(parent) // }); } -SearchResult::~SearchResult() -{ +SearchResult::~SearchResult() { // if (m_timer) { // delete m_timer; // m_timer = NULL; // } } -void SearchResult::run() -{ +void SearchResult::run() { QTimer * m_timer = new QTimer; m_timer->setInterval(3000); int emptyLists = 0; while(!isInterruptionRequested()) { emptyLists = 0; m_mainwindow->m_searcher->m_mutex1.lock(); - if (!m_mainwindow->m_search_result_file->isEmpty()) { + if(!m_mainwindow->m_search_result_file->isEmpty()) { Q_EMIT this->searchResultFile(m_mainwindow->m_search_result_file->dequeue()); m_mainwindow->m_searcher->m_mutex1.unlock(); } else { @@ -55,7 +52,7 @@ void SearchResult::run() m_mainwindow->m_searcher->m_mutex1.unlock(); } m_mainwindow->m_searcher->m_mutex2.lock(); - if (!m_mainwindow->m_search_result_dir->isEmpty()) { + if(!m_mainwindow->m_search_result_dir->isEmpty()) { Q_EMIT this->searchResultDir(m_mainwindow->m_search_result_dir->dequeue()); m_mainwindow->m_searcher->m_mutex2.unlock(); } else { @@ -65,19 +62,19 @@ void SearchResult::run() m_mainwindow->m_searcher->m_mutex3.lock(); // if (!m_mainwindow->m_search_result_content->isEmpty()) // qDebug() << m_mainwindow->m_search_result_content->head(); - if (!m_mainwindow->m_search_result_content->isEmpty()) { + if(!m_mainwindow->m_search_result_content->isEmpty()) { Q_EMIT this->searchResultContent(m_mainwindow->m_search_result_content->dequeue()); m_mainwindow->m_searcher->m_mutex3.unlock(); } else { emptyLists ++; m_mainwindow->m_searcher->m_mutex3.unlock(); } - if (m_timer->isActive() && m_timer->remainingTime() < 0.01) { + if(m_timer->isActive() && m_timer->remainingTime() < 0.01) { this->requestInterruption(); } - if (emptyLists == 3 && !m_timer->isActive()) { + if(emptyLists == 3 && !m_timer->isActive()) { m_timer->start(); - } else if (emptyLists != 3) { + } else if(emptyLists != 3) { m_timer->stop(); } else { msleep(100); diff --git a/src/search-result.h b/src/search-result.h index 8156ab5..531d239 100644 --- a/src/search-result.h +++ b/src/search-result.h @@ -25,8 +25,7 @@ #include #include "mainwindow.h" -class SearchResult : public QThread -{ +class SearchResult : public QThread { Q_OBJECT public: SearchResult(QObject * parent = nullptr); diff --git a/src/settings-widget.cpp b/src/settings-widget.cpp index 04fe3a1..4c35f6d 100644 --- a/src/settings-widget.cpp +++ b/src/settings-widget.cpp @@ -30,14 +30,13 @@ #include "file-utils.h" extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); -SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent) -{ +SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent) { this->setWindowIcon(QIcon::fromTheme("kylin-search")); this->setWindowTitle(tr("ukui-search-settings")); // this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); // this->setAttribute(Qt::WA_TranslucentBackground); - m_hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS; + m_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; m_hints.functions = MWM_FUNC_ALL; m_hints.decorations = MWM_DECOR_BORDER; XAtomHelper::getInstance()->setWindowMotifHint(winId(), m_hints); @@ -48,8 +47,7 @@ SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent) resetWebEngine(); } -SettingsWidget::~SettingsWidget() -{ +SettingsWidget::~SettingsWidget() { } /** @@ -96,7 +94,7 @@ void SettingsWidget::initUi() { m_contentFrame = new QFrame(this); m_contentLyt = new QVBoxLayout(m_contentFrame); m_contentFrame->setLayout(m_contentLyt); - m_contentLyt->setContentsMargins(8,0,8,0); + m_contentLyt->setContentsMargins(8, 0, 8, 0); m_mainLyt->addWidget(m_contentFrame); //设置 @@ -188,14 +186,14 @@ void SettingsWidget::initUi() { // connect(m_engineBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), [ = ] (int id) { // setWebEngine(id); // }); - connect(m_baiduBtn, &QRadioButton::clicked, [ = ] (bool checked) { - if (checked) setWebEngine("baidu"); + connect(m_baiduBtn, &QRadioButton::clicked, [ = ](bool checked) { + if(checked) setWebEngine("baidu"); }); - connect(m_sougouBtn, &QRadioButton::clicked, [ = ] (bool checked) { - if (checked) setWebEngine("sougou"); + connect(m_sougouBtn, &QRadioButton::clicked, [ = ](bool checked) { + if(checked) setWebEngine("sougou"); }); - connect(m_360Btn, &QRadioButton::clicked, [ = ] (bool checked) { - if (checked) setWebEngine("360"); + connect(m_360Btn, &QRadioButton::clicked, [ = ](bool checked) { + if(checked) setWebEngine("360"); }); m_contentLyt->addWidget(m_searchEngineLabel); @@ -247,11 +245,10 @@ void SettingsWidget::setupBlackList(const QStringList& list) { * @param layout 需要清空的布局 */ void SettingsWidget::clearLayout(QLayout * layout) { - if (! layout) return; + if(! layout) return; QLayoutItem * child; - while ((child = layout->takeAt(0)) != 0) { - if(child->widget()) - { + while((child = layout->takeAt(0)) != 0) { + if(child->widget()) { child->widget()->setParent(NULL); } delete child; @@ -262,10 +259,9 @@ void SettingsWidget::clearLayout(QLayout * layout) { /** * @brief SettingsWidget::refreshIndexState 定时刷新索引项 */ -void SettingsWidget::refreshIndexState() -{ +void SettingsWidget::refreshIndexState() { // qDebug()<<"FileUtils::_index_status: "<setIndexState(true); } else { this->setIndexState(false); @@ -273,8 +269,8 @@ void SettingsWidget::refreshIndexState() m_indexNumLabel->setText(QString("%1/%2").arg(QString::number(SearchManager::getCurrentIndexCount())).arg(QString::number(FileUtils::_max_index_count))); m_timer = new QTimer; connect(m_timer, &QTimer::timeout, this, [ = ]() { - qDebug()<<"FileUtils::_index_status: "<setIndexState(true); } else { this->setIndexState(false); @@ -293,15 +289,15 @@ void SettingsWidget::onBtnDelClicked(const QString& path) { QPushButton * buttonYes = message.addButton(tr("Yes"), QMessageBox::YesRole); message.addButton(tr("No"), QMessageBox::NoRole); message.exec(); - if (message.clickedButton() != buttonYes) { + if(message.clickedButton() != buttonYes) { return; } int returnCode = 0; - if (GlobalSettings::getInstance()->setBlockDirs(path, returnCode, true)) { - qDebug()<<"Remove block dir in onBtnDelClicked() successed."; - Q_FOREACH (FolderListItem * item, m_dirListWidget->findChildren()) { - if (item->getPath() == path) { + if(GlobalSettings::getInstance()->setBlockDirs(path, returnCode, true)) { + qDebug() << "Remove block dir in onBtnDelClicked() successed."; + Q_FOREACH(FolderListItem * item, m_dirListWidget->findChildren()) { + if(item->getPath() == path) { item->deleteLater(); item = NULL; m_blockdirs --; @@ -317,14 +313,13 @@ void SettingsWidget::onBtnDelClicked(const QString& path) { /** * @brief SettingsWidget::resetWebEngine 获取当前的搜索引擎并反映在UI控件上 */ -void SettingsWidget::resetWebEngine() -{ +void SettingsWidget::resetWebEngine() { QString engine = GlobalSettings::getInstance()->getValue(WEB_ENGINE).toString(); m_engineBtnGroup->blockSignals(true); - if (!engine.isEmpty()) { - if (engine == "360") { + if(!engine.isEmpty()) { + if(engine == "360") { m_360Btn->setChecked(true); - } else if (engine == "sougou") { + } else if(engine == "sougou") { m_sougouBtn->setChecked(true); } else { m_baiduBtn->setChecked(true); @@ -339,8 +334,7 @@ void SettingsWidget::resetWebEngine() * @brief SettingsWidget::setWebEngine * @param engine 选择的搜索引擎 */ -void SettingsWidget::setWebEngine(const QString& engine) -{ +void SettingsWidget::setWebEngine(const QString& engine) { // GlobalSettings::getInstance()->setValue(WEB_ENGINE, engine); Q_EMIT this->webEngineChanged(engine); } @@ -350,7 +344,7 @@ void SettingsWidget::setWebEngine(const QString& engine) * @param isCreatingIndex 是否正在创建索引 */ void SettingsWidget::setIndexState(bool isCreatingIndex) { - if (isCreatingIndex) { + if(isCreatingIndex) { m_indexStateLabel->setText(tr("Creating ...")); return; } @@ -368,8 +362,7 @@ void SettingsWidget::setIndexNum(int num) { /** * @brief SettingsWidget::showWidget 显示此窗口 */ -void SettingsWidget::showWidget() -{ +void SettingsWidget::showWidget() { Qt::WindowFlags flags = this->windowFlags(); flags |= Qt::WindowStaysOnTopHint; this->setWindowFlags(flags); @@ -414,17 +407,17 @@ void SettingsWidget::onBtnAddClicked() { fileDialog->setLabelText(QFileDialog::FileName, tr("FileName: ")); fileDialog->setLabelText(QFileDialog::FileType, tr("FileType: ")); fileDialog->setLabelText(QFileDialog::Reject, tr("Cancel")); - if (fileDialog->exec() != QDialog::Accepted) { + if(fileDialog->exec() != QDialog::Accepted) { fileDialog->deleteLater(); return; } QString selectedDir = 0; int returnCode; selectedDir = fileDialog->selectedFiles().first(); - qDebug()<<"Selected a folder in onBtnAddClicked(): "<settings-widget.cpp #238"; - if (GlobalSettings::getInstance()->setBlockDirs(selectedDir, returnCode)) { + qDebug() << "Selected a folder in onBtnAddClicked(): " << selectedDir << ". ->settings-widget.cpp #238"; + if(GlobalSettings::getInstance()->setBlockDirs(selectedDir, returnCode)) { setupBlackList(GlobalSettings::getInstance()->getBlockDirs()); - qDebug()<<"Add block dir in onBtnAddClicked() successed. ->settings-widget.cpp #238"; + qDebug() << "Add block dir in onBtnAddClicked() successed. ->settings-widget.cpp #238"; } else { showWarningDialog(returnCode); } @@ -472,15 +465,14 @@ void SettingsWidget::paintEvent(QPaintEvent *event) { // 绘制一个背景 p.save(); - p.fillPath(rectPath,palette().color(QPalette::Base)); + p.fillPath(rectPath, palette().color(QPalette::Base)); p.restore(); } /** * @brief SettingsWidget::resize 重新计算窗口应有大小 */ -void SettingsWidget::resize() -{ +void SettingsWidget::resize() { // if (m_blockdirs <= 1) { // this->setFixedSize(528, 455); // } else if (m_blockdirs <= 3) { @@ -488,7 +480,7 @@ void SettingsWidget::resize() // } else { // this->setFixedSize(528, 515); // } - if (m_blockdirs <= 4) { + if(m_blockdirs <= 4) { m_dirListArea->setFixedHeight(32 * m_blockdirs + 4); m_dirListWidget->setFixedHeight(32 * m_blockdirs); } else { @@ -502,27 +494,26 @@ void SettingsWidget::resize() * @brief SettingsWidget::showWarningDialog 显示警告弹窗 * @param errorCode 错误码 */ -void SettingsWidget::showWarningDialog(const int & errorCode) -{ - qWarning()<<"Add block dir in onBtnAddClicked() failed. Code: "<settings-widget.cpp #238"; +void SettingsWidget::showWarningDialog(const int & errorCode) { + qWarning() << "Add block dir in onBtnAddClicked() failed. Code: " << errorCode << " ->settings-widget.cpp #238"; QString errorMessage; - switch (errorCode) { - case 1: { - errorMessage = tr("Choosen path is Empty!"); - break; - } - case 2: { - errorMessage = tr("Choosen path is not in \"home\"!"); - break; - } - case 3: { - errorMessage = tr("Its' parent folder has been blocked!"); - break; - } - default: { - errorMessage = tr("Set blocked folder failed!"); - break; - } + switch(errorCode) { + case 1: { + errorMessage = tr("Choosen path is Empty!"); + break; + } + case 2: { + errorMessage = tr("Choosen path is not in \"home\"!"); + break; + } + case 3: { + errorMessage = tr("Its' parent folder has been blocked!"); + break; + } + default: { + errorMessage = tr("Set blocked folder failed!"); + break; + } } QMessageBox message(QMessageBox::Warning, tr("Search"), errorMessage); message.addButton(tr("OK"), QMessageBox::AcceptRole); diff --git a/src/settings-widget.h b/src/settings-widget.h index 87ce459..b91a8d8 100644 --- a/src/settings-widget.h +++ b/src/settings-widget.h @@ -35,8 +35,7 @@ #include #include "xatom-helper.h" -class SettingsWidget : public QWidget -{ +class SettingsWidget : public QWidget { Q_OBJECT public: explicit SettingsWidget(QWidget *parent = nullptr); diff --git a/src/singleapplication/qt-local-peer.cpp b/src/singleapplication/qt-local-peer.cpp index 9670eee..4a62537 100644 --- a/src/singleapplication/qt-local-peer.cpp +++ b/src/singleapplication/qt-local-peer.cpp @@ -61,10 +61,9 @@ namespace QtLP_Private { const char* QtLocalPeer::ack = "ack"; QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) - : QObject(parent), id(appId) -{ + : QObject(parent), id(appId) { QString prefix = id; - if (id.isEmpty()) { + if(id.isEmpty()) { id = QCoreApplication::applicationFilePath(); #if defined(Q_OS_WIN) id = id.toLower(); @@ -80,11 +79,11 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) + QLatin1Char('-') + QString::number(idNum, 16); #if defined(Q_OS_WIN) - if (!pProcessIdToSessionId) { + if(!pProcessIdToSessionId) { QLibrary lib("kernel32"); pProcessIdToSessionId = (PProcessIdToSessionId)lib.resolve("ProcessIdToSessionId"); } - if (pProcessIdToSessionId) { + if(pProcessIdToSessionId) { DWORD sessionId = 0; pProcessIdToSessionId(GetCurrentProcessId(), &sessionId); socketName += QLatin1Char('-') + QString::number(sessionId, 16); @@ -103,33 +102,31 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) -bool QtLocalPeer::isClient() -{ - if (lockFile.isLocked()) +bool QtLocalPeer::isClient() { + if(lockFile.isLocked()) return false; - if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false)) + if(!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false)) return true; //由于文件锁的存在,仅当本进程第一次启动时能执行到此并使server进行监听和关联槽函数 bool res = server->listen(socketName); #if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) // ### Workaround - if (!res && server->serverError() == QAbstractSocket::AddressInUseError) { - QFile::remove(QDir::cleanPath(QDir::tempPath())+QLatin1Char('/')+socketName); + if(!res && server->serverError() == QAbstractSocket::AddressInUseError) { + QFile::remove(QDir::cleanPath(QDir::tempPath()) + QLatin1Char('/') + socketName); res = server->listen(socketName); } #endif - if (!res) + if(!res) qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString())); QObject::connect(server, &QLocalServer::newConnection, this, &QtLocalPeer::receiveConnection); return false; } -bool QtLocalPeer::sendMessage(const QString &message, int timeout) -{ - if (!isClient()) +bool QtLocalPeer::sendMessage(const QString &message, int timeout) { + if(!isClient()) return false; QLocalSocket socket; @@ -137,8 +134,8 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout) for(int i = 0; i < 2; i++) { // Try twice, in case the other instance is just starting up socket.connectToServer(socketName); - connOk = socket.waitForConnected(timeout/2); - if (connOk || i) + connOk = socket.waitForConnected(timeout / 2); + if(connOk || i) break; int ms = 250; #if defined(Q_OS_WIN) @@ -148,16 +145,16 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout) nanosleep(&ts, NULL); #endif } - if (!connOk) + if(!connOk) return false; QByteArray uMsg(message.toUtf8()); QDataStream ds(&socket); ds.writeBytes(uMsg.constData(), uMsg.size()); bool res = socket.waitForBytesWritten(timeout); - if (res) { + if(res) { res &= socket.waitForReadyRead(timeout); // wait for ack - if (res) + if(res) res &= (socket.read(qstrlen(ack)) == ack); } return res; @@ -166,19 +163,18 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout) /** * @brief QtLocalPeer::receiveConnection 当新进程启动时,会尝试连接此进程server,server接收到newConnection信号并触发此槽函数 */ -void QtLocalPeer::receiveConnection() -{ +void QtLocalPeer::receiveConnection() { QLocalSocket* socket = server->nextPendingConnection(); //获取新进程的socket - if (!socket) + if(!socket) return; - while (true) { - if (socket->state() == QLocalSocket::UnconnectedState) { + while(true) { + if(socket->state() == QLocalSocket::UnconnectedState) { qWarning("QtLocalPeer: Peer disconnected"); delete socket; return; } - if (socket->bytesAvailable() >= qint64(sizeof(quint32))) + if(socket->bytesAvailable() >= qint64(sizeof(quint32))) break; socket->waitForReadyRead(); } @@ -194,8 +190,8 @@ void QtLocalPeer::receiveConnection() got = ds.readRawData(uMsgBuf, remaining); remaining -= got; uMsgBuf += got; - } while (remaining && got >= 0 && socket->waitForReadyRead(2000)); - if (got < 0) { + } while(remaining && got >= 0 && socket->waitForReadyRead(2000)); + if(got < 0) { qWarning("QtLocalPeer: Message reception failed %s", socket->errorString().toLatin1().constData()); delete socket; return; diff --git a/src/singleapplication/qt-local-peer.h b/src/singleapplication/qt-local-peer.h index 3726274..883aec2 100644 --- a/src/singleapplication/qt-local-peer.h +++ b/src/singleapplication/qt-local-peer.h @@ -50,16 +50,16 @@ #include "qt-locked-file.h" -class QtLocalPeer : public QObject -{ +class QtLocalPeer : public QObject { Q_OBJECT public: QtLocalPeer(QObject *parent = 0, const QString &appId = QString()); bool isClient(); bool sendMessage(const QString &message, int timeout); - QString applicationId() const - { return id; } + QString applicationId() const { + return id; + } Q_SIGNALS: void messageReceived(const QString &message); diff --git a/src/singleapplication/qt-locked-file-unix.cpp b/src/singleapplication/qt-locked-file-unix.cpp index cec8c8a..5147252 100644 --- a/src/singleapplication/qt-locked-file-unix.cpp +++ b/src/singleapplication/qt-locked-file-unix.cpp @@ -46,20 +46,19 @@ #include "qt-locked-file.h" -bool QtLockedFile::lock(LockMode mode, bool block) -{ - if (!isOpen()) { +bool QtLockedFile::lock(LockMode mode, bool block) { + if(!isOpen()) { qWarning("QtLockedFile::lock(): file is not opened"); return false; } - - if (mode == NoLock) + + if(mode == NoLock) return unlock(); - - if (mode == m_lock_mode) + + if(mode == m_lock_mode) return true; - if (m_lock_mode != NoLock) + if(m_lock_mode != NoLock) unlock(); struct flock fl; @@ -69,27 +68,26 @@ bool QtLockedFile::lock(LockMode mode, bool block) fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK; int cmd = block ? F_SETLKW : F_SETLK; int ret = fcntl(handle(), cmd, &fl); - - if (ret == -1) { - if (errno != EINTR && errno != EAGAIN) + + if(ret == -1) { + if(errno != EINTR && errno != EAGAIN) qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno)); return false; } - + m_lock_mode = mode; return true; } -bool QtLockedFile::unlock() -{ - if (!isOpen()) { +bool QtLockedFile::unlock() { + if(!isOpen()) { qWarning("QtLockedFile::unlock(): file is not opened"); return false; } - if (!isLocked()) + if(!isLocked()) return true; struct flock fl; @@ -98,19 +96,18 @@ bool QtLockedFile::unlock() fl.l_len = 0; fl.l_type = F_UNLCK; int ret = fcntl(handle(), F_SETLKW, &fl); - - if (ret == -1) { + + if(ret == -1) { qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno)); return false; } - + m_lock_mode = NoLock; return true; } -QtLockedFile::~QtLockedFile() -{ - if (isOpen()) +QtLockedFile::~QtLockedFile() { + if(isOpen()) unlock(); } diff --git a/src/singleapplication/qt-locked-file.cpp b/src/singleapplication/qt-locked-file.cpp index 62e09d2..707b4cf 100644 --- a/src/singleapplication/qt-locked-file.cpp +++ b/src/singleapplication/qt-locked-file.cpp @@ -82,8 +82,7 @@ \sa QFile::QFile() */ QtLockedFile::QtLockedFile() - : QFile() -{ + : QFile() { #ifdef Q_OS_WIN wmutex = 0; rmutex = 0; @@ -99,8 +98,7 @@ QtLockedFile::QtLockedFile() \sa QFile::QFile() */ QtLockedFile::QtLockedFile(const QString &name) - : QFile(name) -{ + : QFile(name) { #ifdef Q_OS_WIN wmutex = 0; rmutex = 0; @@ -121,9 +119,8 @@ QtLockedFile::QtLockedFile(const QString &name) \sa QFile::open(), QFile::resize() */ -bool QtLockedFile::open(OpenMode mode) -{ - if (mode & QIODevice::Truncate) { +bool QtLockedFile::open(OpenMode mode) { + if(mode & QIODevice::Truncate) { qWarning("QtLockedFile::open(): Truncate mode not allowed."); return false; } @@ -136,8 +133,7 @@ bool QtLockedFile::open(OpenMode mode) \sa lockMode() */ -bool QtLockedFile::isLocked() const -{ +bool QtLockedFile::isLocked() const { return m_lock_mode != NoLock; } @@ -147,8 +143,7 @@ bool QtLockedFile::isLocked() const \sa isLocked() */ -QtLockedFile::LockMode QtLockedFile::lockMode() const -{ +QtLockedFile::LockMode QtLockedFile::lockMode() const { return m_lock_mode; } diff --git a/src/singleapplication/qt-locked-file.h b/src/singleapplication/qt-locked-file.h index cc18278..332d648 100644 --- a/src/singleapplication/qt-locked-file.h +++ b/src/singleapplication/qt-locked-file.h @@ -65,8 +65,7 @@ namespace QtLP_Private { -class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile -{ +class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile { public: enum LockMode { NoLock = 0, ReadLock, WriteLock }; diff --git a/src/singleapplication/qt-single-application.cpp b/src/singleapplication/qt-single-application.cpp index 91b6e7f..95b1900 100644 --- a/src/singleapplication/qt-single-application.cpp +++ b/src/singleapplication/qt-single-application.cpp @@ -141,8 +141,7 @@ */ -void QtSingleApplication::sysInit(const QString &appId) -{ +void QtSingleApplication::sysInit(const QString &appId) { actWin = 0; peer = new QtLocalPeer(this, appId); // connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&))); @@ -161,8 +160,7 @@ void QtSingleApplication::sysInit(const QString &appId) */ QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled) - : QApplication(argc, argv, GUIenabled) -{ + : QApplication(argc, argv, GUIenabled) { sysInit(); } @@ -174,8 +172,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled */ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char **argv) - : QApplication(argc, argv) -{ + : QApplication(argc, argv) { sysInit(appId); } @@ -187,8 +184,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char * argv, and \a type are passed on to the QAppliation constructor. */ QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type) - : QApplication(argc, argv, type) -{ + : QApplication(argc, argv, type) { sysInit(); } @@ -201,8 +197,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type) and \a cmap are passed on to the QApplication constructor. */ QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE cmap) - : QApplication(dpy, visual, cmap) -{ + : QApplication(dpy, visual, cmap) { sysInit(); } @@ -214,8 +209,7 @@ QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HA constructor. */ QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) - : QApplication(dpy, argc, argv, visual, cmap) -{ + : QApplication(dpy, argc, argv, visual, cmap) { sysInit(); } @@ -227,8 +221,7 @@ QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Q constructor. */ QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap) - : QApplication(dpy, argc, argv, visual, cmap) -{ + : QApplication(dpy, argc, argv, visual, cmap) { sysInit(appId); } # endif // Q_WS_X11 @@ -246,8 +239,7 @@ QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int \sa sendMessage() */ -bool QtSingleApplication::isRunning() -{ +bool QtSingleApplication::isRunning() { return peer->isClient(); } @@ -265,8 +257,7 @@ bool QtSingleApplication::isRunning() \sa isRunning(), messageReceived() */ -bool QtSingleApplication::sendMessage(const QString &message, int timeout) -{ +bool QtSingleApplication::sendMessage(const QString &message, int timeout) { return peer->sendMessage(message, timeout); } @@ -275,8 +266,7 @@ bool QtSingleApplication::sendMessage(const QString &message, int timeout) Returns the application identifier. Two processes with the same identifier will be regarded as instances of the same application. */ -QString QtSingleApplication::id() const -{ +QString QtSingleApplication::id() const { return peer->applicationId(); } @@ -293,8 +283,7 @@ QString QtSingleApplication::id() const \sa activateWindow(), messageReceived() */ -void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage) -{ +void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage) { actWin = aw; //目前不需要用到此处的置顶方法,故此信号槽暂时注释掉,若后续需要根据新起进程传递的信号执行部分操作时可以把这里放开 // if (activateOnMessage) @@ -310,8 +299,7 @@ void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessag \sa setActivationWindow() */ -QWidget* QtSingleApplication::activationWindow() const -{ +QWidget* QtSingleApplication::activationWindow() const { return actWin; } @@ -330,8 +318,7 @@ QWidget* QtSingleApplication::activationWindow() const \sa setActivationWindow(), messageReceived(), initialize() */ -void QtSingleApplication::activateWindow() -{ +void QtSingleApplication::activateWindow() { //单例置顶策略,由于bootOptionsFilter in mainwindow自带置顶策略,故注掉此处 // if (actWin) { // if(this->applicationState() & Qt::ApplicationInactive) diff --git a/src/singleapplication/qt-single-application.h b/src/singleapplication/qt-single-application.h index 5098bb3..15df5a8 100644 --- a/src/singleapplication/qt-single-application.h +++ b/src/singleapplication/qt-single-application.h @@ -64,8 +64,7 @@ class QtLocalPeer; # define QT_QTSINGLEAPPLICATION_EXPORT #endif -class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication -{ +class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication { Q_OBJECT public: @@ -75,7 +74,7 @@ public: QtSingleApplication(int &argc, char **argv, Type type); # if defined(Q_WS_X11) QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); - QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); + QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0); QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0); # endif // Q_WS_X11 #endif // QT_VERSION < 0x050000 @@ -87,8 +86,10 @@ public: QWidget* activationWindow() const; // Obsolete: - void initialize(bool dummy = true) - { isRunning(); Q_UNUSED(dummy) } + void initialize(bool dummy = true) { + isRunning(); + Q_UNUSED(dummy) + } public Q_SLOTS: bool sendMessage(const QString &message, int timeout = 5000); diff --git a/src/xatom-helper.cpp b/src/xatom-helper.cpp index 1dae3a2..9c17419 100644 --- a/src/xatom-helper.cpp +++ b/src/xatom-helper.cpp @@ -32,46 +32,40 @@ static XAtomHelper *global_instance = nullptr; -XAtomHelper *XAtomHelper::getInstance() -{ - if (!global_instance) +XAtomHelper *XAtomHelper::getInstance() { + if(!global_instance) global_instance = new XAtomHelper; return global_instance; } -bool XAtomHelper::isFrameLessWindow(int winId) -{ +bool XAtomHelper::isFrameLessWindow(int winId) { auto hints = getInstance()->getWindowMotifHint(winId); - if (hints.flags == MWM_HINTS_DECORATIONS && hints.functions == 1) { + if(hints.flags == MWM_HINTS_DECORATIONS && hints.functions == 1) { return true; } return false; } -bool XAtomHelper::isWindowDecorateBorderOnly(int winId) -{ +bool XAtomHelper::isWindowDecorateBorderOnly(int winId) { return isWindowMotifHintDecorateBorderOnly(getInstance()->getWindowMotifHint(winId)); } -bool XAtomHelper::isWindowMotifHintDecorateBorderOnly(const MotifWmHints &hint) -{ +bool XAtomHelper::isWindowMotifHintDecorateBorderOnly(const MotifWmHints &hint) { bool isDeco = false; - if (hint.flags & MWM_HINTS_DECORATIONS && hint.flags != MWM_HINTS_DECORATIONS) { - if (hint.decorations == MWM_DECOR_BORDER) + if(hint.flags & MWM_HINTS_DECORATIONS && hint.flags != MWM_HINTS_DECORATIONS) { + if(hint.decorations == MWM_DECOR_BORDER) isDeco = true; } return isDeco; } -bool XAtomHelper::isUKUICsdSupported() -{ +bool XAtomHelper::isUKUICsdSupported() { // fixme: return false; } -bool XAtomHelper::isUKUIDecorationWindow(int winId) -{ - if (m_ukuiDecorationAtion == None) +bool XAtomHelper::isUKUIDecorationWindow(int winId) { + if(m_ukuiDecorationAtion == None) return false; Atom type; @@ -88,8 +82,8 @@ bool XAtomHelper::isUKUIDecorationWindow(int winId) &format, &nitems, &bytes_after, &data); - if (type == m_ukuiDecorationAtion) { - if (nitems == 1) { + if(type == m_ukuiDecorationAtion) { + if(nitems == 1) { isUKUIDecoration = data[0]; } } @@ -97,8 +91,7 @@ bool XAtomHelper::isUKUIDecorationWindow(int winId) return isUKUIDecoration; } -UnityCorners XAtomHelper::getWindowBorderRadius(int winId) -{ +UnityCorners XAtomHelper::getWindowBorderRadius(int winId) { UnityCorners corners; Atom type; @@ -107,19 +100,19 @@ UnityCorners XAtomHelper::getWindowBorderRadius(int winId) ulong bytes_after; uchar *data; - if (m_unityBorderRadiusAtom != None) { + if(m_unityBorderRadiusAtom != None) { XGetWindowProperty(QX11Info::display(), winId, m_unityBorderRadiusAtom, 0, LONG_MAX, false, XA_CARDINAL, &type, &format, &nitems, &bytes_after, &data); - if (type == XA_CARDINAL) { - if (nitems == 4) { + if(type == XA_CARDINAL) { + if(nitems == 4) { corners.topLeft = static_cast(data[0]); - corners.topRight = static_cast(data[1*sizeof (ulong)]); - corners.bottomLeft = static_cast(data[2*sizeof (ulong)]); - corners.bottomRight = static_cast(data[3*sizeof (ulong)]); + corners.topRight = static_cast(data[1 * sizeof(ulong)]); + corners.bottomLeft = static_cast(data[2 * sizeof(ulong)]); + corners.bottomRight = static_cast(data[3 * sizeof(ulong)]); } XFree(data); } @@ -128,50 +121,45 @@ UnityCorners XAtomHelper::getWindowBorderRadius(int winId) return corners; } -void XAtomHelper::setWindowBorderRadius(int winId, const UnityCorners &data) -{ - if (m_unityBorderRadiusAtom == None) +void XAtomHelper::setWindowBorderRadius(int winId, const UnityCorners &data) { + if(m_unityBorderRadiusAtom == None) return; ulong corners[4] = {data.topLeft, data.topRight, data.bottomLeft, data.bottomRight}; XChangeProperty(QX11Info::display(), winId, m_unityBorderRadiusAtom, XA_CARDINAL, - 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &corners, sizeof (corners)/sizeof (corners[0])); + 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &corners, sizeof(corners) / sizeof(corners[0])); } -void XAtomHelper::setWindowBorderRadius(int winId, int topLeft, int topRight, int bottomLeft, int bottomRight) -{ - if (m_unityBorderRadiusAtom == None) +void XAtomHelper::setWindowBorderRadius(int winId, int topLeft, int topRight, int bottomLeft, int bottomRight) { + if(m_unityBorderRadiusAtom == None) return; ulong corners[4] = {(ulong)topLeft, (ulong)topRight, (ulong)bottomLeft, (ulong)bottomRight}; XChangeProperty(QX11Info::display(), winId, m_unityBorderRadiusAtom, XA_CARDINAL, - 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &corners, sizeof (corners)/sizeof (corners[0])); + 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &corners, sizeof(corners) / sizeof(corners[0])); } -void XAtomHelper::setUKUIDecoraiontHint(int winId, bool set) -{ - if (m_ukuiDecorationAtion == None) +void XAtomHelper::setUKUIDecoraiontHint(int winId, bool set) { + if(m_ukuiDecorationAtion == None) return; XChangeProperty(QX11Info::display(), winId, m_ukuiDecorationAtion, m_ukuiDecorationAtion, 32, XCB_PROP_MODE_REPLACE, (const unsigned char *) &set, 1); } -void XAtomHelper::setWindowMotifHint(int winId, const MotifWmHints &hints) -{ - if (m_unityBorderRadiusAtom == None) +void XAtomHelper::setWindowMotifHint(int winId, const MotifWmHints &hints) { + if(m_unityBorderRadiusAtom == None) return; XChangeProperty(QX11Info::display(), winId, m_motifWMHintsAtom, m_motifWMHintsAtom, - 32, XCB_PROP_MODE_REPLACE, (const unsigned char *)&hints, sizeof (MotifWmHints)/ sizeof (ulong)); + 32, XCB_PROP_MODE_REPLACE, (const unsigned char *)&hints, sizeof(MotifWmHints) / sizeof(ulong)); } -MotifWmHints XAtomHelper::getWindowMotifHint(int winId) -{ +MotifWmHints XAtomHelper::getWindowMotifHint(int winId) { MotifWmHints hints; - if (m_unityBorderRadiusAtom == None) + if(m_unityBorderRadiusAtom == None) return hints; uchar *data; @@ -181,10 +169,10 @@ MotifWmHints XAtomHelper::getWindowMotifHint(int winId) ulong bytes_after; XGetWindowProperty(QX11Info::display(), winId, m_motifWMHintsAtom, - 0, sizeof (MotifWmHints)/sizeof (long), false, AnyPropertyType, &type, + 0, sizeof(MotifWmHints) / sizeof(long), false, AnyPropertyType, &type, &format, &nitems, &bytes_after, &data); - if (type == None) { + if(type == None) { return hints; } else { hints = *(MotifWmHints *)data; @@ -193,9 +181,8 @@ MotifWmHints XAtomHelper::getWindowMotifHint(int winId) return hints; } -XAtomHelper::XAtomHelper(QObject *parent) : QObject(parent) -{ - if (!QX11Info::isPlatformX11()) +XAtomHelper::XAtomHelper(QObject *parent) : QObject(parent) { + if(!QX11Info::isPlatformX11()) return; m_motifWMHintsAtom = XInternAtom(QX11Info::display(), "_MOTIF_WM_HINTS", true); @@ -203,13 +190,11 @@ XAtomHelper::XAtomHelper(QObject *parent) : QObject(parent) m_ukuiDecorationAtion = XInternAtom(QX11Info::display(), "_KWIN_UKUI_DECORAION", false); } -Atom XAtomHelper::registerUKUICsdNetWmSupportAtom() -{ +Atom XAtomHelper::registerUKUICsdNetWmSupportAtom() { // fixme: return None; } -void XAtomHelper::unregisterUKUICsdNetWmSupportAtom() -{ +void XAtomHelper::unregisterUKUICsdNetWmSupportAtom() { // fixme: } diff --git a/src/xatom-helper.h b/src/xatom-helper.h index c8d1701..615ce6d 100644 --- a/src/xatom-helper.h +++ b/src/xatom-helper.h @@ -75,8 +75,7 @@ namespace UKUI { class Decoration; } -class XAtomHelper : public QObject -{ +class XAtomHelper : public QObject { // friend class UKUI::Decoration; Q_OBJECT public: diff --git a/ukuisearch-systemdbus/main.cpp b/ukuisearch-systemdbus/main.cpp index e30180b..eae7df1 100644 --- a/ukuisearch-systemdbus/main.cpp +++ b/ukuisearch-systemdbus/main.cpp @@ -24,19 +24,19 @@ #include "sysdbusregister.h" -int main(int argc, char *argv[]){ +int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); app.setOrganizationName("Kylin Team"); app.setApplicationName("ukui-search-service"); QDBusConnection systemBus = QDBusConnection::systemBus(); - if (!systemBus.registerService("com.ukui.search.qt.systemdbus")){ + if(!systemBus.registerService("com.ukui.search.qt.systemdbus")) { qCritical() << "QDbus register service failed reason:" << systemBus.lastError(); exit(1); } - if (!systemBus.registerObject("/", new SysdbusRegister(), QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals)){ + if(!systemBus.registerObject("/", new SysdbusRegister(), QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals)) { qCritical() << "QDbus register object failed reason:" << systemBus.lastError(); exit(2); } diff --git a/ukuisearch-systemdbus/sysdbusregister.cpp b/ukuisearch-systemdbus/sysdbusregister.cpp index 6b538b4..194e59f 100644 --- a/ukuisearch-systemdbus/sysdbusregister.cpp +++ b/ukuisearch-systemdbus/sysdbusregister.cpp @@ -25,12 +25,10 @@ #include #include -SysdbusRegister::SysdbusRegister() -{ +SysdbusRegister::SysdbusRegister() { } -SysdbusRegister::~SysdbusRegister() -{ +SysdbusRegister::~SysdbusRegister() { } void SysdbusRegister::exitService() { @@ -44,67 +42,61 @@ void SysdbusRegister::exitService() { * sprintf(cmd, "echo fs.inotify.max_user_watches=9999999 | sudo tee -a /etc/sysctl.conf"); */ -QString SysdbusRegister::setInotifyMaxUserWatchesStep1() -{ +QString SysdbusRegister::setInotifyMaxUserWatchesStep1() { QByteArray ba; FILE * fp = NULL; char cmd[128]; char buf[1024]; sprintf(cmd, "echo 9999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches"); - if ((fp = popen(cmd, "r")) != NULL){ + if((fp = popen(cmd, "r")) != NULL) { rewind(fp); - while (!feof(fp)) { - fgets(buf, sizeof (buf), fp); + while(!feof(fp)) { + fgets(buf, sizeof(buf), fp); ba.append(buf); } pclose(fp); fp = NULL; - } - else{ + } else { return QString("popen open failed"); } return QString(ba); } -QString SysdbusRegister::setInotifyMaxUserWatchesStep2() -{ +QString SysdbusRegister::setInotifyMaxUserWatchesStep2() { QByteArray ba; FILE * fp = NULL; char cmd[128]; char buf[1024]; sprintf(cmd, "sysctl -w fs.inotify.max_user_watches=\"9999999\""); - if ((fp = popen(cmd, "r")) != NULL){ + if((fp = popen(cmd, "r")) != NULL) { rewind(fp); - while (!feof(fp)) { - fgets(buf, sizeof (buf), fp); + while(!feof(fp)) { + fgets(buf, sizeof(buf), fp); ba.append(buf); } pclose(fp); fp = NULL; - } - else{ + } else { return QString("popen open failed"); } return QString(ba); } -QString SysdbusRegister::setInotifyMaxUserWatchesStep3() -{ +QString SysdbusRegister::setInotifyMaxUserWatchesStep3() { QByteArray ba; FILE * fp = NULL; char cmd[128]; char buf[1024]; sprintf(cmd, "echo fs.inotify.max_user_watches=9999999 | sudo tee -a /etc/sysctl.conf"); - if ((fp = popen(cmd, "r")) != NULL){ + if((fp = popen(cmd, "r")) != NULL) { rewind(fp); - while (!feof(fp)) { - fgets(buf, sizeof (buf), fp); + while(!feof(fp)) { + fgets(buf, sizeof(buf), fp); ba.append(buf); } pclose(fp); fp = NULL; - } - else{ + } else { return QString("popen open failed"); } return QString(ba); diff --git a/ukuisearch-systemdbus/sysdbusregister.h b/ukuisearch-systemdbus/sysdbusregister.h index 2483fe1..caa9bc7 100644 --- a/ukuisearch-systemdbus/sysdbusregister.h +++ b/ukuisearch-systemdbus/sysdbusregister.h @@ -26,8 +26,7 @@ #include #include -class SysdbusRegister : public QObject -{ +class SysdbusRegister : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.ukui.search.interface")