Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
submodules: recursive

- name: Test
run: npx --yes @bazel/bazelisk test //:bazel_smoke_test
3 changes: 0 additions & 3 deletions .github/workflows/cmake-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
submodules: recursive

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand All @@ -37,4 +35,3 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} --verbose

2 changes: 0 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
submodules: recursive

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 0 additions & 7 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")

package(default_visibility = ["//visibility:public"])

cc_library(
name = "limonp",
hdrs = glob(["deps/limonp/include/limonp/**/*.hpp"]),
includes = ["deps/limonp/include"],
)

filegroup(
name = "dict",
srcs = glob(["dict/**"]),
Expand All @@ -17,7 +11,6 @@ cc_library(
name = "cppjieba",
hdrs = glob(["include/cppjieba/**/*.hpp"]),
includes = ["include"],
deps = [":limonp"],
)

cc_test(
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Unreleased

+ deps: remove the limonp submodule dependency

## v5.6.7

+ docs: document dictionary file formats
Expand Down
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
CMAKE_MINIMUM_REQUIRED (VERSION 3.10)
PROJECT(CPPJIEBA)

find_package(limonp)
if(limonp_FOUND)
get_target_property(LIMONP_INCLUDE_DIR limonp::limonp INTERFACE_INCLUDE_DIRECTORIES)
else()
set(LIMONP_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/deps/limonp/include")
endif()
INCLUDE_DIRECTORIES("${LIMONP_INCLUDE_DIR}"
${PROJECT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)

if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
Expand All @@ -31,7 +24,6 @@ if(NOT TARGET cppjieba)
add_library(cppjieba INTERFACE)
target_include_directories(cppjieba INTERFACE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/deps/limonp/include
)
endif()

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ CppJieba是"结巴(Jieba)"中文分词的C++版本
```sh
git clone https://github.com/yanyiwu/cppjieba.git
cd cppjieba
git submodule init
git submodule update
mkdir build
cd build
cmake ..
Expand Down
1 change: 0 additions & 1 deletion deps/limonp
Submodule limonp deleted from 4065c5
9 changes: 4 additions & 5 deletions include/cppjieba/DictTrie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
#include "limonp/StringUtil.hpp"
#include "limonp/Logging.hpp"
#include "Utils.hpp"
#include "UnicodeFile.hpp"
#include "Unicode.hpp"
#include "Trie.hpp"
Expand Down Expand Up @@ -113,7 +112,7 @@ class DictTrie {
void InserUserDictNode(const std::string& line) {
std::vector<std::string> buf;
DictUnit node_info;
limonp::Split(line, buf, " ");
Split(line, buf, " ");
if(buf.size() == 1){
MakeNodeInfo(node_info,
buf[0],
Expand Down Expand Up @@ -150,7 +149,7 @@ class DictTrie {
}

void LoadUserDict(const std::string& filePaths) {
std::vector<std::string> files = limonp::Split(filePaths, "|;");
std::vector<std::string> files = Split(filePaths, "|;");
for (size_t i = 0; i < files.size(); i++) {
std::ifstream ifs;
OpenInputFile(ifs, files[i]);
Expand Down Expand Up @@ -244,7 +243,7 @@ class DictTrie {
std::string line;
std::vector<std::string> buf;
while (getline(ifs, line)) {
limonp::Split(line, buf, " ");
Split(line, buf, " ");
XCHECK(buf.size() == DICT_COLUMN_NUM) << "split result illegal, line:" << line;
DictUnit node_info;
XCHECK(DecodeUTF8RunesInString(buf[0], node_info.word)) << "UTF-8 decode failed for dict word: " << buf[0];
Expand Down
2 changes: 1 addition & 1 deletion include/cppjieba/FullSegment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <algorithm>
#include <set>
#include <cassert>
#include "limonp/Logging.hpp"
#include "Utils.hpp"
#include "DictTrie.hpp"
#include "SegmentBase.hpp"
#include "Unicode.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/cppjieba/HMMModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
#define CPPJIEBA_HMMMODEL_H

#include "UnicodeFile.hpp"
#include "limonp/StringUtil.hpp"
#include "Utils.hpp"
#include "Trie.hpp"

namespace cppjieba {

using namespace limonp;
typedef unordered_map<Rune, double> EmitProbMap;

struct HMMModel {
Expand Down
3 changes: 2 additions & 1 deletion include/cppjieba/KeywordExtractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define CPPJIEBA_KEYWORD_EXTRACTOR_H

#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include "MixSegment.hpp"
Expand Down Expand Up @@ -106,7 +107,7 @@ class KeywordExtractor {
XLOG(ERROR) << "lineno: " << lineno << " empty. skipped.";
continue;
}
limonp::Split(line, buf, " ");
Split(line, buf, " ");
if (buf.size() != 2) {
XLOG(ERROR) << "line: " << line << ", lineno: " << lineno << " empty. skipped.";
continue;
Expand Down
2 changes: 1 addition & 1 deletion include/cppjieba/MPSegment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <algorithm>
#include <set>
#include <cassert>
#include "limonp/Logging.hpp"
#include "Utils.hpp"
#include "DictTrie.hpp"
#include "SegmentTagged.hpp"
#include "PosTagger.hpp"
Expand Down
1 change: 0 additions & 1 deletion include/cppjieba/MixSegment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <cassert>
#include "MPSegment.hpp"
#include "HMMSegment.hpp"
#include "limonp/StringUtil.hpp"
#include "PosTagger.hpp"

namespace cppjieba {
Expand Down
3 changes: 1 addition & 2 deletions include/cppjieba/PosTagger.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef CPPJIEBA_POS_TAGGING_H
#define CPPJIEBA_POS_TAGGING_H

#include "limonp/StringUtil.hpp"
#include "Utils.hpp"
#include "SegmentTagged.hpp"
#include "DictTrie.hpp"

namespace cppjieba {
using namespace limonp;

static const char* const POS_M = "m";
static const char* const POS_ENG = "eng";
Expand Down
2 changes: 1 addition & 1 deletion include/cppjieba/PreFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CPPJIEBA_PRE_FILTER_H

#include "Trie.hpp"
#include "limonp/Logging.hpp"
#include "Utils.hpp"

namespace cppjieba {

Expand Down
2 changes: 1 addition & 1 deletion include/cppjieba/QuerySegment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <algorithm>
#include <set>
#include <cassert>
#include "limonp/Logging.hpp"
#include "Utils.hpp"
#include "DictTrie.hpp"
#include "SegmentBase.hpp"
#include "FullSegment.hpp"
Expand Down
4 changes: 1 addition & 3 deletions include/cppjieba/SegmentBase.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef CPPJIEBA_SEGMENTBASE_H
#define CPPJIEBA_SEGMENTBASE_H

#include "limonp/Logging.hpp"
#include "Utils.hpp"
#include "PreFilter.hpp"
#include <cassert>

Expand All @@ -10,8 +10,6 @@ namespace cppjieba {

const char* const SPECIAL_SEPARATORS = " \t\n\xEF\xBC\x8C\xE3\x80\x82";

using namespace limonp;

class SegmentBase {
public:
SegmentBase() {
Expand Down
12 changes: 6 additions & 6 deletions include/cppjieba/TextRankExtractor.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef CPPJIEBA_TEXTRANK_EXTRACTOR_H
#define CPPJIEBA_TEXTRANK_EXTRACTOR_H
#define CPPJIEBA_TEXTRANK_EXTRACTOR_H

#include <cmath>
#include <map>
#include "Jieba.hpp"
#include "UnicodeFile.hpp"

namespace cppjieba {
using namespace limonp;
using namespace std;

namespace cppjieba {
using namespace std;

class TextRankExtractor {
public:
Expand Down
4 changes: 2 additions & 2 deletions include/cppjieba/Trie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <vector>
#include <queue>
#include "limonp/StdExtension.hpp"
#include "Utils.hpp"
#include "Unicode.hpp"

namespace cppjieba {
Expand All @@ -28,7 +28,7 @@ struct DictUnit {
struct Dag {
RuneStr runestr;
// [offset, nexts.first]
limonp::LocalVector<pair<size_t, const DictUnit*> > nexts;
LocalVector<pair<size_t, const DictUnit*> > nexts;
const DictUnit * pInfo;
double weight;
size_t nextPos; // TODO
Expand Down
4 changes: 2 additions & 2 deletions include/cppjieba/Unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string>
#include <vector>
#include <ostream>
#include "limonp/LocalVector.hpp"
#include "Utils.hpp"

namespace cppjieba {

Expand Down Expand Up @@ -53,7 +53,7 @@ inline std::ostream& operator << (std::ostream& os, const RuneStr& r) {
return os << "{\"rune\": \"" << r.rune << "\", \"offset\": " << r.offset << ", \"len\": " << r.len << "}";
}

typedef limonp::LocalVector<Rune> Unicode;
typedef LocalVector<Rune> Unicode;
typedef std::vector<RuneStr> RuneStrArray;

// [left, right]
Expand Down
Loading
Loading