├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── SECURITY.md └── workflows │ ├── c-cpp.yml │ └── codeql.yml ├── .vscode ├── c_cpp_properties.json ├── launch.json ├── settings.json └── tasks.json ├── CMakeLists.txt ├── LICENSE ├── build ├── .cmake │ └── api │ │ └── v1 │ │ ├── query │ │ └── client-vscode │ │ │ └── query.json │ │ └── reply │ │ ├── cache-v2-c40851932f9212484687.json │ │ ├── cmakeFiles-v1-7432f6a554720e2fff2c.json │ │ ├── codemodel-v2-af77b1f8e7b4443ca5cc.json │ │ ├── index-2024-12-15T13-44-31-0021.json │ │ └── target-YatSearchEngine-Debug-c635310d7914443189ce.json ├── CMakeCache.txt ├── CMakeFiles │ ├── 3.16.3 │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeSystem.cmake │ │ └── CompilerIdCXX │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ └── a.out │ ├── CMakeDirectoryInformation.cmake │ ├── CMakeOutput.log │ ├── Makefile.cmake │ ├── Makefile2 │ ├── TargetDirectories.txt │ ├── YatSearchEngine.dir │ │ ├── CXX.includecache │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ ├── cmake_clean.cmake │ │ ├── depend.internal │ │ ├── depend.make │ │ ├── flags.make │ │ ├── link.txt │ │ ├── progress.make │ │ └── src │ │ │ ├── RegexSearch.cpp.o │ │ │ ├── TextSearchEngine.cpp.o │ │ │ ├── main.cpp.o │ │ │ └── oyyphash.cpp.o │ ├── cmake.check_cache │ └── progress.marks ├── Makefile ├── YatSearchEngine ├── cmake_install.cmake └── compile_commands.json ├── dat └── index.dat ├── include ├── RegexSearch.h ├── TextSearchEngine.h └── oyyphash.h ├── log └── query_log.txt ├── logo_pic ├── Nobg.png ├── logo.png ├── logo.txt └── logo_out.txt ├── readme.md ├── source-text ├── bible.txt ├── text1.txt ├── text2.txt ├── 中国共产党章程.txt └── 百年孤独.txt └── src ├── RegexSearch.cpp ├── TextSearchEngine.cpp ├── main.cpp └── oyyphash.cpp /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | ouyyp5@mail2.sysu.edu.cn. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to Yat Search Engine 3 | 4 | Thank you for considering contributing to **Yat Search Engine**! Contributions are welcome and appreciated. By participating in this project, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md). 5 | 6 | --- 7 | 8 | ## How Can You Contribute? 9 | 10 | ### 1. Reporting Bugs 11 | If you encounter any issues while using the project: 12 | - **Search existing issues** to check if the bug has already been reported. 13 | - Open a [new issue](https://github.com/ouyangyipeng/Yat-Search-Engine/issues) and provide: 14 | - A clear and descriptive title. 15 | - Steps to reproduce the issue. 16 | - Your environment details (e.g., operating system, browser version, etc.). 17 | - Any relevant logs or screenshots. 18 | 19 | --- 20 | 21 | ### 2. Suggesting Features 22 | Have an idea to make this project better? Great! Open a [feature request issue](https://github.com/ouyangyipeng/Yat-Search-Engine/issues/new?template=feature_request.md) with: 23 | - A clear explanation of the feature. 24 | - Why it’s needed and how it benefits the project. 25 | - Any examples or screenshots, if applicable. 26 | 27 | --- 28 | 29 | ### 3. Contributing Code 30 | #### Steps to contribute code: 31 | 1. **Fork the repository**: Click on the "Fork" button at the top of this repository. 32 | 2. **Clone your forked repository**: 33 | ```bash 34 | git clone https://github.com/your-username/Yat-Search-Engine.git 35 | ``` 36 | 3. **Create a new branch** for your contribution: 37 | ```bash 38 | git checkout -b feature/your-feature-name 39 | ``` 40 | 4. **Make your changes**: Add or update files as necessary. 41 | 5. **Run tests**: Ensure that all existing tests pass and write new ones if necessary. 42 | 6. **Commit your changes**: 43 | ```bash 44 | git commit -m "Add: Description of your changes" 45 | ``` 46 | 7. **Push your changes**: 47 | ```bash 48 | git push origin feature/your-feature-name 49 | ``` 50 | 8. **Create a pull request**: Open a pull request (PR) against the `main` branch of the original repository and provide: 51 | - A clear title and description. 52 | - A link to the issue it resolves (if applicable). 53 | 54 | #### Guidelines for Code Contributions 55 | - Follow the coding style of the project. 56 | - Write clear and concise commit messages. 57 | - Ensure your code is well-documented and readable. 58 | - Avoid introducing breaking changes without proper discussion. 59 | 60 | --- 61 | 62 | ### 4. Improving Documentation 63 | You can contribute by: 64 | - Fixing typos or grammatical errors. 65 | - Adding new sections or examples. 66 | - Clarifying existing documentation. 67 | 68 | --- 69 | 70 | ## Community Guidelines 71 | - Be respectful and inclusive. 72 | - Provide constructive feedback and collaborate effectively. 73 | - Follow the [Code of Conduct](CODE_OF_CONDUCT.md). 74 | 75 | --- 76 | 77 | ## Need Help? 78 | If you have any questions or need assistance, feel free to: 79 | - Open an issue in the [issue tracker](https://github.com/ouyangyipeng/Yat-Search-Engine/issues). 80 | - Reach out to the project maintainers. 81 | 82 | Thank you for helping to improve **Yat Search Engine**! 🚀 83 | 84 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Thank you for helping to improve the security of **Yat Search Engine**. We take security issues seriously and appreciate your efforts to make our project safer for everyone. 4 | 5 | --- 6 | 7 | ## Supported Versions 8 | 9 | We actively support and patch the following versions: 10 | 11 | | Version | Supported | 12 | |---------|--------------------| 13 | | 1.x | ✅ | 14 | | < 1.0 | ❌ | 15 | 16 | If you are using an unsupported version, please update to the latest version to benefit from security patches. 17 | 18 | --- 19 | 20 | ## Reporting a Vulnerability 21 | 22 | If you discover a security vulnerability, please follow these steps: 23 | 24 | 1. **Do not disclose it publicly.** 25 | Instead, send a detailed report via email to **[your-email@example.com](mailto:your-email@example.com)**. 26 | 27 | 2. **Include the following information in your report**: 28 | - A clear description of the vulnerability. 29 | - Steps to reproduce the issue. 30 | - Any potential impact or exploitation scenarios. 31 | - Your name and contact information (optional). 32 | 33 | 3. **Response Timeline**: 34 | - We aim to acknowledge your report within **48 hours**. 35 | - A detailed response will be provided within **5 working days**, including an assessment and a plan for mitigation, if necessary. 36 | 37 | --- 38 | 39 | ## Preferred Languages 40 | 41 | We prefer reports to be written in **English** or **Chinese**. 42 | 43 | --- 44 | 45 | ## Security Updates 46 | 47 | You can find security updates and patched versions in the [Releases](https://github.com/ouyangyipeng/Yat-Search-Engine/releases) section of this repository. 48 | 49 | --- 50 | 51 | ## Acknowledgments 52 | 53 | We value and appreciate your efforts to keep **Yat Search Engine** secure. Contributors who responsibly disclose vulnerabilities may be publicly acknowledged in our [Security Hall of Fame](https://github.com/ouyangyipeng/Yat-Search-Engine/SECURITY.md#security-hall-of-fame) (with your permission). 54 | 55 | --- 56 | 57 | ## Hall of Fame 58 | 59 | - *Fernandez Owen(oyyp)* 60 | 61 | --- 62 | 63 | Thank you for helping us make **Yat Search Engine** more secure! If you have any questions, please contact us at **[your-email@example.com](mailto:your-email@example.com)**. 64 | -------------------------------------------------------------------------------- /.github/workflows/c-cpp.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: configure 17 | run: ./configure 18 | - name: make 19 | run: make 20 | - name: make check 21 | run: make check 22 | - name: make distcheck 23 | run: make distcheck 24 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL Advanced" 13 | 14 | on: 15 | push: 16 | branches: [ "main" ] 17 | pull_request: 18 | branches: [ "main" ] 19 | schedule: 20 | - cron: '27 7 * * 4' 21 | 22 | jobs: 23 | analyze: 24 | name: Analyze (${{ matrix.language }}) 25 | # Runner size impacts CodeQL analysis time. To learn more, please see: 26 | # - https://gh.io/recommended-hardware-resources-for-running-codeql 27 | # - https://gh.io/supported-runners-and-hardware-resources 28 | # - https://gh.io/using-larger-runners (GitHub.com only) 29 | # Consider using larger runners or machines with greater resources for possible analysis time improvements. 30 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} 31 | permissions: 32 | # required for all workflows 33 | security-events: write 34 | 35 | # required to fetch internal or private CodeQL packs 36 | packages: read 37 | 38 | # only required for workflows in private repositories 39 | actions: read 40 | contents: read 41 | 42 | strategy: 43 | fail-fast: false 44 | matrix: 45 | include: 46 | - language: c-cpp 47 | build-mode: autobuild 48 | # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' 49 | # Use `c-cpp` to analyze code written in C, C++ or both 50 | # Use 'java-kotlin' to analyze code written in Java, Kotlin or both 51 | # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both 52 | # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, 53 | # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. 54 | # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how 55 | # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages 56 | steps: 57 | - name: Checkout repository 58 | uses: actions/checkout@v4 59 | 60 | # Initializes the CodeQL tools for scanning. 61 | - name: Initialize CodeQL 62 | uses: github/codeql-action/init@v3 63 | with: 64 | languages: ${{ matrix.language }} 65 | build-mode: ${{ matrix.build-mode }} 66 | # If you wish to specify custom queries, you can do so here or in a config file. 67 | # By default, queries listed here will override any specified in a config file. 68 | # Prefix the list here with "+" to use these queries and those in the config file. 69 | 70 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 71 | # queries: security-extended,security-and-quality 72 | 73 | # If the analyze step fails for one of the languages you are analyzing with 74 | # "We were unable to automatically build your code", modify the matrix above 75 | # to set the build mode to "manual" for that language. Then modify this step 76 | # to build your code. 77 | # ℹ️ Command-line programs to run using the OS shell. 78 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 79 | - if: matrix.build-mode == 'manual' 80 | shell: bash 81 | run: | 82 | echo 'If you are using a "manual" build mode for one or more of the' \ 83 | 'languages you are analyzing, replace this with the commands to build' \ 84 | 'your code, for example:' 85 | echo ' make bootstrap' 86 | echo ' make release' 87 | exit 1 88 | 89 | - name: Perform CodeQL Analysis 90 | uses: github/codeql-action/analyze@v3 91 | with: 92 | category: "/language:${{matrix.language}}" 93 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "${workspaceFolder}/include", 7 | "${workspaceFolder}/build" 8 | ], 9 | "defines": [], 10 | "compilerPath": "/usr/bin/g++", 11 | "cStandard": "c17", 12 | "cppStandard": "c++17", 13 | "intelliSenseMode": "linux-gcc-x64" 14 | } 15 | ], 16 | "version": 4 17 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch TextSearchEngine", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "program": "${workspaceFolder}/build/YatSearchEngine", 9 | "args": [], 10 | "stopAtEntry": false, 11 | "cwd": "${workspaceFolder}", 12 | "environment": [], 13 | "externalConsole": false, 14 | "MIMode": "gdb", 15 | "miDebuggerPath": "/usr/bin/gdb", 16 | "setupCommands": [ 17 | { 18 | "description": "Enable pretty-printing for gdb", 19 | "text": "-enable-pretty-printing", 20 | "ignoreFailures": true 21 | } 22 | ] 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "array": "cpp", 4 | "atomic": "cpp", 5 | "*.tcc": "cpp", 6 | "bitset": "cpp", 7 | "cctype": "cpp", 8 | "clocale": "cpp", 9 | "cmath": "cpp", 10 | "cstdarg": "cpp", 11 | "cstddef": "cpp", 12 | "cstdint": "cpp", 13 | "cstdio": "cpp", 14 | "cstdlib": "cpp", 15 | "cstring": "cpp", 16 | "ctime": "cpp", 17 | "cwchar": "cpp", 18 | "cwctype": "cpp", 19 | "deque": "cpp", 20 | "unordered_map": "cpp", 21 | "vector": "cpp", 22 | "exception": "cpp", 23 | "algorithm": "cpp", 24 | "iterator": "cpp", 25 | "map": "cpp", 26 | "memory": "cpp", 27 | "memory_resource": "cpp", 28 | "optional": "cpp", 29 | "regex": "cpp", 30 | "string": "cpp", 31 | "string_view": "cpp", 32 | "system_error": "cpp", 33 | "tuple": "cpp", 34 | "type_traits": "cpp", 35 | "utility": "cpp", 36 | "fstream": "cpp", 37 | "initializer_list": "cpp", 38 | "iosfwd": "cpp", 39 | "iostream": "cpp", 40 | "istream": "cpp", 41 | "limits": "cpp", 42 | "new": "cpp", 43 | "ostream": "cpp", 44 | "sstream": "cpp", 45 | "stdexcept": "cpp", 46 | "streambuf": "cpp", 47 | "typeinfo": "cpp", 48 | "set": "cpp", 49 | "functional": "cpp", 50 | "codecvt": "cpp", 51 | "chrono": "cpp", 52 | "ratio": "cpp", 53 | "bit": "cpp", 54 | "condition_variable": "cpp", 55 | "numeric": "cpp", 56 | "random": "cpp", 57 | "shared_mutex": "cpp", 58 | "cinttypes": "cpp", 59 | "iomanip": "cpp" 60 | } 61 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Build with CMake", 6 | "type": "shell", 7 | "command": "cmake --build build", 8 | "group": "build" 9 | }, 10 | { 11 | "type": "cppbuild", 12 | "label": "C/C++: g++ 生成活动文件", 13 | "command": "/usr/bin/g++", 14 | "args": [ 15 | "-fdiagnostics-color=always", 16 | "-g", 17 | "${file}", 18 | "-o", 19 | "${fileDirname}/${fileBasenameNoExtension}" 20 | ], 21 | "options": { 22 | "cwd": "${fileDirname}" 23 | }, 24 | "problemMatcher": [ 25 | "$gcc" 26 | ], 27 | "group": { 28 | "kind": "build", 29 | "isDefault": true 30 | }, 31 | "detail": "调试器生成的任务。" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 指定 CMake 最低版本 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | # 项目名称和语言 5 | project(YatSearchEngine LANGUAGES CXX) 6 | 7 | # 设置 C++ 标准 8 | set(CMAKE_CXX_STANDARD 17) 9 | set(CMAKE_CXX_STANDARD_REQUIRED True) 10 | 11 | # 包含头文件目录 12 | include_directories(include) 13 | 14 | # 源文件列表 15 | set(SOURCES 16 | src/main.cpp 17 | src/TextSearchEngine.cpp 18 | src/RegexSearch.cpp 19 | src/oyyphash.cpp 20 | ) 21 | 22 | # 添加可执行文件 23 | add_executable(YatSearchEngine ${SOURCES}) 24 | 25 | # 设置可执行文件输出目录 26 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build) 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Fernández Owen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build/.cmake/api/v1/query/client-vscode/query.json: -------------------------------------------------------------------------------- 1 | {"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]} -------------------------------------------------------------------------------- /build/.cmake/api/v1/reply/cmakeFiles-v1-7432f6a554720e2fff2c.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs" : 3 | [ 4 | { 5 | "path" : "CMakeLists.txt" 6 | }, 7 | { 8 | "isGenerated" : true, 9 | "path" : "build/CMakeFiles/3.16.3/CMakeSystem.cmake" 10 | }, 11 | { 12 | "isCMake" : true, 13 | "isExternal" : true, 14 | "path" : "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake" 15 | }, 16 | { 17 | "isGenerated" : true, 18 | "path" : "build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" 19 | }, 20 | { 21 | "isCMake" : true, 22 | "isExternal" : true, 23 | "path" : "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake" 24 | }, 25 | { 26 | "isCMake" : true, 27 | "isExternal" : true, 28 | "path" : "/usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake" 29 | }, 30 | { 31 | "isCMake" : true, 32 | "isExternal" : true, 33 | "path" : "/usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake" 34 | }, 35 | { 36 | "isCMake" : true, 37 | "isExternal" : true, 38 | "path" : "/usr/share/cmake-3.16/Modules/Platform/Linux.cmake" 39 | }, 40 | { 41 | "isCMake" : true, 42 | "isExternal" : true, 43 | "path" : "/usr/share/cmake-3.16/Modules/Platform/UnixPaths.cmake" 44 | }, 45 | { 46 | "isCMake" : true, 47 | "isExternal" : true, 48 | "path" : "/usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake" 49 | }, 50 | { 51 | "isCMake" : true, 52 | "isExternal" : true, 53 | "path" : "/usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake" 54 | }, 55 | { 56 | "isCMake" : true, 57 | "isExternal" : true, 58 | "path" : "/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake" 59 | }, 60 | { 61 | "isCMake" : true, 62 | "isExternal" : true, 63 | "path" : "/usr/share/cmake-3.16/Modules/Compiler/GNU.cmake" 64 | }, 65 | { 66 | "isCMake" : true, 67 | "isExternal" : true, 68 | "path" : "/usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 69 | }, 70 | { 71 | "isCMake" : true, 72 | "isExternal" : true, 73 | "path" : "/usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake" 74 | }, 75 | { 76 | "isCMake" : true, 77 | "isExternal" : true, 78 | "path" : "/usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" 79 | }, 80 | { 81 | "isCMake" : true, 82 | "isExternal" : true, 83 | "path" : "/usr/share/cmake-3.16/Modules/Platform/Linux-GNU-CXX.cmake" 84 | }, 85 | { 86 | "isCMake" : true, 87 | "isExternal" : true, 88 | "path" : "/usr/share/cmake-3.16/Modules/Platform/Linux-GNU.cmake" 89 | }, 90 | { 91 | "isCMake" : true, 92 | "isExternal" : true, 93 | "path" : "/usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake" 94 | } 95 | ], 96 | "kind" : "cmakeFiles", 97 | "paths" : 98 | { 99 | "build" : "/workspaces/Yat-Search-Engine/build", 100 | "source" : "/workspaces/Yat-Search-Engine" 101 | }, 102 | "version" : 103 | { 104 | "major" : 1, 105 | "minor" : 0 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /build/.cmake/api/v1/reply/codemodel-v2-af77b1f8e7b4443ca5cc.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : 3 | [ 4 | { 5 | "directories" : 6 | [ 7 | { 8 | "build" : ".", 9 | "minimumCMakeVersion" : 10 | { 11 | "string" : "3.10" 12 | }, 13 | "projectIndex" : 0, 14 | "source" : ".", 15 | "targetIndexes" : 16 | [ 17 | 0 18 | ] 19 | } 20 | ], 21 | "name" : "Debug", 22 | "projects" : 23 | [ 24 | { 25 | "directoryIndexes" : 26 | [ 27 | 0 28 | ], 29 | "name" : "YatSearchEngine", 30 | "targetIndexes" : 31 | [ 32 | 0 33 | ] 34 | } 35 | ], 36 | "targets" : 37 | [ 38 | { 39 | "directoryIndex" : 0, 40 | "id" : "YatSearchEngine::@6890427a1f51a3e7e1df", 41 | "jsonFile" : "target-YatSearchEngine-Debug-c635310d7914443189ce.json", 42 | "name" : "YatSearchEngine", 43 | "projectIndex" : 0 44 | } 45 | ] 46 | } 47 | ], 48 | "kind" : "codemodel", 49 | "paths" : 50 | { 51 | "build" : "/workspaces/Yat-Search-Engine/build", 52 | "source" : "/workspaces/Yat-Search-Engine" 53 | }, 54 | "version" : 55 | { 56 | "major" : 2, 57 | "minor" : 0 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /build/.cmake/api/v1/reply/index-2024-12-15T13-44-31-0021.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake" : 3 | { 4 | "generator" : 5 | { 6 | "name" : "Unix Makefiles" 7 | }, 8 | "paths" : 9 | { 10 | "cmake" : "/usr/bin/cmake", 11 | "cpack" : "/usr/bin/cpack", 12 | "ctest" : "/usr/bin/ctest", 13 | "root" : "/usr/share/cmake-3.16" 14 | }, 15 | "version" : 16 | { 17 | "isDirty" : false, 18 | "major" : 3, 19 | "minor" : 16, 20 | "patch" : 3, 21 | "string" : "3.16.3", 22 | "suffix" : "" 23 | } 24 | }, 25 | "objects" : 26 | [ 27 | { 28 | "jsonFile" : "codemodel-v2-af77b1f8e7b4443ca5cc.json", 29 | "kind" : "codemodel", 30 | "version" : 31 | { 32 | "major" : 2, 33 | "minor" : 0 34 | } 35 | }, 36 | { 37 | "jsonFile" : "cache-v2-c40851932f9212484687.json", 38 | "kind" : "cache", 39 | "version" : 40 | { 41 | "major" : 2, 42 | "minor" : 0 43 | } 44 | }, 45 | { 46 | "jsonFile" : "cmakeFiles-v1-7432f6a554720e2fff2c.json", 47 | "kind" : "cmakeFiles", 48 | "version" : 49 | { 50 | "major" : 1, 51 | "minor" : 0 52 | } 53 | } 54 | ], 55 | "reply" : 56 | { 57 | "client-vscode" : 58 | { 59 | "query.json" : 60 | { 61 | "requests" : 62 | [ 63 | { 64 | "kind" : "cache", 65 | "version" : 2 66 | }, 67 | { 68 | "kind" : "codemodel", 69 | "version" : 2 70 | }, 71 | { 72 | "kind" : "toolchains", 73 | "version" : 1 74 | }, 75 | { 76 | "kind" : "cmakeFiles", 77 | "version" : 1 78 | } 79 | ], 80 | "responses" : 81 | [ 82 | { 83 | "jsonFile" : "cache-v2-c40851932f9212484687.json", 84 | "kind" : "cache", 85 | "version" : 86 | { 87 | "major" : 2, 88 | "minor" : 0 89 | } 90 | }, 91 | { 92 | "jsonFile" : "codemodel-v2-af77b1f8e7b4443ca5cc.json", 93 | "kind" : "codemodel", 94 | "version" : 95 | { 96 | "major" : 2, 97 | "minor" : 0 98 | } 99 | }, 100 | { 101 | "error" : "unknown request kind 'toolchains'" 102 | }, 103 | { 104 | "jsonFile" : "cmakeFiles-v1-7432f6a554720e2fff2c.json", 105 | "kind" : "cmakeFiles", 106 | "version" : 107 | { 108 | "major" : 1, 109 | "minor" : 0 110 | } 111 | } 112 | ] 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /build/.cmake/api/v1/reply/target-YatSearchEngine-Debug-c635310d7914443189ce.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "YatSearchEngine" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "include_directories" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 23, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 12, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-g " 46 | }, 47 | { 48 | "fragment" : "-std=gnu++17" 49 | } 50 | ], 51 | "includes" : 52 | [ 53 | { 54 | "backtrace" : 2, 55 | "path" : "/workspaces/Yat-Search-Engine/include" 56 | } 57 | ], 58 | "language" : "CXX", 59 | "sourceIndexes" : 60 | [ 61 | 0, 62 | 1, 63 | 2, 64 | 3 65 | ] 66 | } 67 | ], 68 | "id" : "YatSearchEngine::@6890427a1f51a3e7e1df", 69 | "link" : 70 | { 71 | "commandFragments" : 72 | [ 73 | { 74 | "fragment" : "-g", 75 | "role" : "flags" 76 | }, 77 | { 78 | "fragment" : "", 79 | "role" : "flags" 80 | } 81 | ], 82 | "language" : "CXX" 83 | }, 84 | "name" : "YatSearchEngine", 85 | "nameOnDisk" : "YatSearchEngine", 86 | "paths" : 87 | { 88 | "build" : ".", 89 | "source" : "." 90 | }, 91 | "sourceGroups" : 92 | [ 93 | { 94 | "name" : "Source Files", 95 | "sourceIndexes" : 96 | [ 97 | 0, 98 | 1, 99 | 2, 100 | 3 101 | ] 102 | } 103 | ], 104 | "sources" : 105 | [ 106 | { 107 | "backtrace" : 1, 108 | "compileGroupIndex" : 0, 109 | "path" : "src/main.cpp", 110 | "sourceGroupIndex" : 0 111 | }, 112 | { 113 | "backtrace" : 1, 114 | "compileGroupIndex" : 0, 115 | "path" : "src/TextSearchEngine.cpp", 116 | "sourceGroupIndex" : 0 117 | }, 118 | { 119 | "backtrace" : 1, 120 | "compileGroupIndex" : 0, 121 | "path" : "src/RegexSearch.cpp", 122 | "sourceGroupIndex" : 0 123 | }, 124 | { 125 | "backtrace" : 1, 126 | "compileGroupIndex" : 0, 127 | "path" : "src/oyyphash.cpp", 128 | "sourceGroupIndex" : 0 129 | } 130 | ], 131 | "type" : "EXECUTABLE" 132 | } 133 | -------------------------------------------------------------------------------- /build/CMakeCache.txt: -------------------------------------------------------------------------------- 1 | # This is the CMakeCache file. 2 | # For build in directory: /workspaces/Yat-Search-Engine/build 3 | # It was generated by CMake: /usr/bin/cmake 4 | # You can edit this file to change values found and used by cmake. 5 | # If you do not want to change any of the values, simply exit the editor. 6 | # If you do want to change a value, simply edit, save, and exit the editor. 7 | # The syntax for the file is as follows: 8 | # KEY:TYPE=VALUE 9 | # KEY is the name of a variable in the cache. 10 | # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. 11 | # VALUE is the current value for the KEY. 12 | 13 | ######################## 14 | # EXTERNAL cache entries 15 | ######################## 16 | 17 | //Path to a program. 18 | CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line 19 | 20 | //Path to a program. 21 | CMAKE_AR:FILEPATH=/usr/bin/ar 22 | 23 | //No help, variable specified on the command line. 24 | CMAKE_BUILD_TYPE:STRING=Debug 25 | 26 | //Enable/Disable color output during build. 27 | CMAKE_COLOR_MAKEFILE:BOOL=ON 28 | 29 | //No help, variable specified on the command line. 30 | CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ 31 | 32 | //A wrapper around 'ar' adding the appropriate '--plugin' option 33 | // for the GCC compiler 34 | CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 35 | 36 | //A wrapper around 'ranlib' adding the appropriate '--plugin' option 37 | // for the GCC compiler 38 | CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 39 | 40 | //Flags used by the CXX compiler during all build types. 41 | CMAKE_CXX_FLAGS:STRING= 42 | 43 | //Flags used by the CXX compiler during DEBUG builds. 44 | CMAKE_CXX_FLAGS_DEBUG:STRING=-g 45 | 46 | //Flags used by the CXX compiler during MINSIZEREL builds. 47 | CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG 48 | 49 | //Flags used by the CXX compiler during RELEASE builds. 50 | CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG 51 | 52 | //Flags used by the CXX compiler during RELWITHDEBINFO builds. 53 | CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG 54 | 55 | //No help, variable specified on the command line. 56 | CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc 57 | 58 | //Path to a program. 59 | CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND 60 | 61 | //Flags used by the linker during all build types. 62 | CMAKE_EXE_LINKER_FLAGS:STRING= 63 | 64 | //Flags used by the linker during DEBUG builds. 65 | CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= 66 | 67 | //Flags used by the linker during MINSIZEREL builds. 68 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= 69 | 70 | //Flags used by the linker during RELEASE builds. 71 | CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= 72 | 73 | //Flags used by the linker during RELWITHDEBINFO builds. 74 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 75 | 76 | //No help, variable specified on the command line. 77 | CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE 78 | 79 | //Install path prefix, prepended onto install directories. 80 | CMAKE_INSTALL_PREFIX:PATH=/usr/local 81 | 82 | //Path to a program. 83 | CMAKE_LINKER:FILEPATH=/usr/bin/ld 84 | 85 | //Path to a program. 86 | CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make 87 | 88 | //Flags used by the linker during the creation of modules during 89 | // all build types. 90 | CMAKE_MODULE_LINKER_FLAGS:STRING= 91 | 92 | //Flags used by the linker during the creation of modules during 93 | // DEBUG builds. 94 | CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= 95 | 96 | //Flags used by the linker during the creation of modules during 97 | // MINSIZEREL builds. 98 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= 99 | 100 | //Flags used by the linker during the creation of modules during 101 | // RELEASE builds. 102 | CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= 103 | 104 | //Flags used by the linker during the creation of modules during 105 | // RELWITHDEBINFO builds. 106 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= 107 | 108 | //Path to a program. 109 | CMAKE_NM:FILEPATH=/usr/bin/nm 110 | 111 | //Path to a program. 112 | CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy 113 | 114 | //Path to a program. 115 | CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump 116 | 117 | //Value Computed by CMake 118 | CMAKE_PROJECT_DESCRIPTION:STATIC= 119 | 120 | //Value Computed by CMake 121 | CMAKE_PROJECT_HOMEPAGE_URL:STATIC= 122 | 123 | //Value Computed by CMake 124 | CMAKE_PROJECT_NAME:STATIC=YatSearchEngine 125 | 126 | //Path to a program. 127 | CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib 128 | 129 | //Path to a program. 130 | CMAKE_READELF:FILEPATH=/usr/bin/readelf 131 | 132 | //Flags used by the linker during the creation of shared libraries 133 | // during all build types. 134 | CMAKE_SHARED_LINKER_FLAGS:STRING= 135 | 136 | //Flags used by the linker during the creation of shared libraries 137 | // during DEBUG builds. 138 | CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= 139 | 140 | //Flags used by the linker during the creation of shared libraries 141 | // during MINSIZEREL builds. 142 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= 143 | 144 | //Flags used by the linker during the creation of shared libraries 145 | // during RELEASE builds. 146 | CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= 147 | 148 | //Flags used by the linker during the creation of shared libraries 149 | // during RELWITHDEBINFO builds. 150 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= 151 | 152 | //If set, runtime paths are not added when installing shared libraries, 153 | // but are added when building. 154 | CMAKE_SKIP_INSTALL_RPATH:BOOL=NO 155 | 156 | //If set, runtime paths are not added when using shared libraries. 157 | CMAKE_SKIP_RPATH:BOOL=NO 158 | 159 | //Flags used by the linker during the creation of static libraries 160 | // during all build types. 161 | CMAKE_STATIC_LINKER_FLAGS:STRING= 162 | 163 | //Flags used by the linker during the creation of static libraries 164 | // during DEBUG builds. 165 | CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= 166 | 167 | //Flags used by the linker during the creation of static libraries 168 | // during MINSIZEREL builds. 169 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= 170 | 171 | //Flags used by the linker during the creation of static libraries 172 | // during RELEASE builds. 173 | CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= 174 | 175 | //Flags used by the linker during the creation of static libraries 176 | // during RELWITHDEBINFO builds. 177 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= 178 | 179 | //Path to a program. 180 | CMAKE_STRIP:FILEPATH=/usr/bin/strip 181 | 182 | //If this value is on, makefiles will be generated without the 183 | // .SILENT directive, and all commands will be echoed to the console 184 | // during the make. This is useful for debugging only. With Visual 185 | // Studio IDE projects all commands are done without /nologo. 186 | CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE 187 | 188 | //Value Computed by CMake 189 | YatSearchEngine_BINARY_DIR:STATIC=/workspaces/Yat-Search-Engine/build 190 | 191 | //Value Computed by CMake 192 | YatSearchEngine_SOURCE_DIR:STATIC=/workspaces/Yat-Search-Engine 193 | 194 | 195 | ######################## 196 | # INTERNAL cache entries 197 | ######################## 198 | 199 | //ADVANCED property for variable: CMAKE_ADDR2LINE 200 | CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 201 | //ADVANCED property for variable: CMAKE_AR 202 | CMAKE_AR-ADVANCED:INTERNAL=1 203 | //This is the directory where this CMakeCache.txt was created 204 | CMAKE_CACHEFILE_DIR:INTERNAL=/workspaces/Yat-Search-Engine/build 205 | //Major version of cmake used to create the current loaded cache 206 | CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 207 | //Minor version of cmake used to create the current loaded cache 208 | CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 209 | //Patch version of cmake used to create the current loaded cache 210 | CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 211 | //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE 212 | CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 213 | //Path to CMake executable. 214 | CMAKE_COMMAND:INTERNAL=/usr/bin/cmake 215 | //Path to cpack program executable. 216 | CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack 217 | //Path to ctest program executable. 218 | CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest 219 | //ADVANCED property for variable: CMAKE_CXX_COMPILER 220 | CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 221 | //ADVANCED property for variable: CMAKE_CXX_COMPILER_AR 222 | CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 223 | //ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB 224 | CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 225 | //ADVANCED property for variable: CMAKE_CXX_FLAGS 226 | CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 227 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG 228 | CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 229 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL 230 | CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 231 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE 232 | CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 233 | //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO 234 | CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 235 | //ADVANCED property for variable: CMAKE_DLLTOOL 236 | CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 237 | //Executable file format 238 | CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF 239 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS 240 | CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 241 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG 242 | CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 243 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL 244 | CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 245 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE 246 | CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 247 | //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO 248 | CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 249 | //ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS 250 | CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 251 | //Name of external makefile project generator. 252 | CMAKE_EXTRA_GENERATOR:INTERNAL= 253 | //Name of generator. 254 | CMAKE_GENERATOR:INTERNAL=Unix Makefiles 255 | //Generator instance identifier. 256 | CMAKE_GENERATOR_INSTANCE:INTERNAL= 257 | //Name of generator platform. 258 | CMAKE_GENERATOR_PLATFORM:INTERNAL= 259 | //Name of generator toolset. 260 | CMAKE_GENERATOR_TOOLSET:INTERNAL= 261 | //Source directory with the top level CMakeLists.txt file for this 262 | // project 263 | CMAKE_HOME_DIRECTORY:INTERNAL=/workspaces/Yat-Search-Engine 264 | //Install .so files without execute permission. 265 | CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 266 | //ADVANCED property for variable: CMAKE_LINKER 267 | CMAKE_LINKER-ADVANCED:INTERNAL=1 268 | //ADVANCED property for variable: CMAKE_MAKE_PROGRAM 269 | CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 270 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS 271 | CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 272 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG 273 | CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 274 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL 275 | CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 276 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE 277 | CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 278 | //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO 279 | CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 280 | //ADVANCED property for variable: CMAKE_NM 281 | CMAKE_NM-ADVANCED:INTERNAL=1 282 | //number of local generators 283 | CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 284 | //ADVANCED property for variable: CMAKE_OBJCOPY 285 | CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 286 | //ADVANCED property for variable: CMAKE_OBJDUMP 287 | CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 288 | //Platform information initialized 289 | CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 290 | //ADVANCED property for variable: CMAKE_RANLIB 291 | CMAKE_RANLIB-ADVANCED:INTERNAL=1 292 | //ADVANCED property for variable: CMAKE_READELF 293 | CMAKE_READELF-ADVANCED:INTERNAL=1 294 | //Path to CMake installation. 295 | CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 296 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS 297 | CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 298 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG 299 | CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 300 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL 301 | CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 302 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE 303 | CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 304 | //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO 305 | CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 306 | //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH 307 | CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 308 | //ADVANCED property for variable: CMAKE_SKIP_RPATH 309 | CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 310 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS 311 | CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 312 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG 313 | CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 314 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL 315 | CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 316 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE 317 | CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 318 | //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO 319 | CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 320 | //ADVANCED property for variable: CMAKE_STRIP 321 | CMAKE_STRIP-ADVANCED:INTERNAL=1 322 | //uname command 323 | CMAKE_UNAME:INTERNAL=/usr/bin/uname 324 | //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE 325 | CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 326 | 327 | -------------------------------------------------------------------------------- /build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/g++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "9.4.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "Linux") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_CXX_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | set(CMAKE_AR "/usr/bin/ar") 23 | set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9") 24 | set(CMAKE_RANLIB "/usr/bin/ranlib") 25 | set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9") 26 | set(CMAKE_LINKER "/usr/bin/ld") 27 | set(CMAKE_MT "") 28 | set(CMAKE_COMPILER_IS_GNUCXX 1) 29 | set(CMAKE_CXX_COMPILER_LOADED 1) 30 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 31 | set(CMAKE_CXX_ABI_COMPILED TRUE) 32 | set(CMAKE_COMPILER_IS_MINGW ) 33 | set(CMAKE_COMPILER_IS_CYGWIN ) 34 | if(CMAKE_COMPILER_IS_CYGWIN) 35 | set(CYGWIN 1) 36 | set(UNIX 1) 37 | endif() 38 | 39 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 40 | 41 | if(CMAKE_COMPILER_IS_MINGW) 42 | set(MINGW 1) 43 | endif() 44 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 46 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 47 | 48 | foreach (lang C OBJC OBJCXX) 49 | if (CMAKE_${lang}_COMPILER_ID_RUN) 50 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 51 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 52 | endforeach() 53 | endif() 54 | endforeach() 55 | 56 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 57 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 58 | 59 | # Save compiler ABI information. 60 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 61 | set(CMAKE_CXX_COMPILER_ABI "ELF") 62 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 63 | 64 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 65 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 66 | endif() 67 | 68 | if(CMAKE_CXX_COMPILER_ABI) 69 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 70 | endif() 71 | 72 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 73 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 74 | endif() 75 | 76 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 77 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 78 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 79 | endif() 80 | 81 | 82 | 83 | 84 | 85 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 86 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") 87 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 88 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 89 | -------------------------------------------------------------------------------- /build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /build/CMakeFiles/3.16.3/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-6.5.0-1025-azure") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "6.5.0-1025-azure") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-6.5.0-1025-azure") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "6.5.0-1025-azure") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp: -------------------------------------------------------------------------------- 1 | /* This source file must have a .cpp extension so that all C++ compilers 2 | recognize the extension without flags. Borland does not know .cxx for 3 | example. */ 4 | #ifndef __cplusplus 5 | # error "A C compiler has been selected for C++." 6 | #endif 7 | 8 | 9 | /* Version number components: V=Version, R=Revision, P=Patch 10 | Version date components: YYYY=Year, MM=Month, DD=Day */ 11 | 12 | #if defined(__COMO__) 13 | # define COMPILER_ID "Comeau" 14 | /* __COMO_VERSION__ = VRR */ 15 | # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) 16 | # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) 17 | 18 | #elif defined(__INTEL_COMPILER) || defined(__ICC) 19 | # define COMPILER_ID "Intel" 20 | # if defined(_MSC_VER) 21 | # define SIMULATE_ID "MSVC" 22 | # endif 23 | # if defined(__GNUC__) 24 | # define SIMULATE_ID "GNU" 25 | # endif 26 | /* __INTEL_COMPILER = VRP */ 27 | # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) 28 | # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) 29 | # if defined(__INTEL_COMPILER_UPDATE) 30 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) 31 | # else 32 | # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) 33 | # endif 34 | # if defined(__INTEL_COMPILER_BUILD_DATE) 35 | /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ 36 | # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) 37 | # endif 38 | # if defined(_MSC_VER) 39 | /* _MSC_VER = VVRR */ 40 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 41 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 42 | # endif 43 | # if defined(__GNUC__) 44 | # define SIMULATE_VERSION_MAJOR DEC(__GNUC__) 45 | # elif defined(__GNUG__) 46 | # define SIMULATE_VERSION_MAJOR DEC(__GNUG__) 47 | # endif 48 | # if defined(__GNUC_MINOR__) 49 | # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) 50 | # endif 51 | # if defined(__GNUC_PATCHLEVEL__) 52 | # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 53 | # endif 54 | 55 | #elif defined(__PATHCC__) 56 | # define COMPILER_ID "PathScale" 57 | # define COMPILER_VERSION_MAJOR DEC(__PATHCC__) 58 | # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) 59 | # if defined(__PATHCC_PATCHLEVEL__) 60 | # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) 61 | # endif 62 | 63 | #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) 64 | # define COMPILER_ID "Embarcadero" 65 | # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) 66 | # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) 67 | # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) 68 | 69 | #elif defined(__BORLANDC__) 70 | # define COMPILER_ID "Borland" 71 | /* __BORLANDC__ = 0xVRR */ 72 | # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) 73 | # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) 74 | 75 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 76 | # define COMPILER_ID "Watcom" 77 | /* __WATCOMC__ = VVRR */ 78 | # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) 79 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 80 | # if (__WATCOMC__ % 10) > 0 81 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 82 | # endif 83 | 84 | #elif defined(__WATCOMC__) 85 | # define COMPILER_ID "OpenWatcom" 86 | /* __WATCOMC__ = VVRP + 1100 */ 87 | # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) 88 | # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) 89 | # if (__WATCOMC__ % 10) > 0 90 | # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) 91 | # endif 92 | 93 | #elif defined(__SUNPRO_CC) 94 | # define COMPILER_ID "SunPro" 95 | # if __SUNPRO_CC >= 0x5100 96 | /* __SUNPRO_CC = 0xVRRP */ 97 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) 98 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) 99 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 100 | # else 101 | /* __SUNPRO_CC = 0xVRP */ 102 | # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) 103 | # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) 104 | # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) 105 | # endif 106 | 107 | #elif defined(__HP_aCC) 108 | # define COMPILER_ID "HP" 109 | /* __HP_aCC = VVRRPP */ 110 | # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) 111 | # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) 112 | # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) 113 | 114 | #elif defined(__DECCXX) 115 | # define COMPILER_ID "Compaq" 116 | /* __DECCXX_VER = VVRRTPPPP */ 117 | # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) 118 | # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) 119 | # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) 120 | 121 | #elif defined(__IBMCPP__) && defined(__COMPILER_VER__) 122 | # define COMPILER_ID "zOS" 123 | /* __IBMCPP__ = VRP */ 124 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 125 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 126 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 127 | 128 | #elif defined(__ibmxl__) && defined(__clang__) 129 | # define COMPILER_ID "XLClang" 130 | # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) 131 | # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) 132 | # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) 133 | # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) 134 | 135 | 136 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 137 | # define COMPILER_ID "XL" 138 | /* __IBMCPP__ = VRP */ 139 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 140 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 141 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 142 | 143 | #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 144 | # define COMPILER_ID "VisualAge" 145 | /* __IBMCPP__ = VRP */ 146 | # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) 147 | # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) 148 | # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) 149 | 150 | #elif defined(__PGI) 151 | # define COMPILER_ID "PGI" 152 | # define COMPILER_VERSION_MAJOR DEC(__PGIC__) 153 | # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) 154 | # if defined(__PGIC_PATCHLEVEL__) 155 | # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) 156 | # endif 157 | 158 | #elif defined(_CRAYC) 159 | # define COMPILER_ID "Cray" 160 | # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) 161 | # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) 162 | 163 | #elif defined(__TI_COMPILER_VERSION__) 164 | # define COMPILER_ID "TI" 165 | /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ 166 | # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) 167 | # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) 168 | # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) 169 | 170 | #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) 171 | # define COMPILER_ID "Fujitsu" 172 | 173 | #elif defined(__ghs__) 174 | # define COMPILER_ID "GHS" 175 | /* __GHS_VERSION_NUMBER = VVVVRP */ 176 | # ifdef __GHS_VERSION_NUMBER 177 | # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) 178 | # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) 179 | # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) 180 | # endif 181 | 182 | #elif defined(__SCO_VERSION__) 183 | # define COMPILER_ID "SCO" 184 | 185 | #elif defined(__ARMCC_VERSION) && !defined(__clang__) 186 | # define COMPILER_ID "ARMCC" 187 | #if __ARMCC_VERSION >= 1000000 188 | /* __ARMCC_VERSION = VRRPPPP */ 189 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) 190 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) 191 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 192 | #else 193 | /* __ARMCC_VERSION = VRPPPP */ 194 | # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) 195 | # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) 196 | # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) 197 | #endif 198 | 199 | 200 | #elif defined(__clang__) && defined(__apple_build_version__) 201 | # define COMPILER_ID "AppleClang" 202 | # if defined(_MSC_VER) 203 | # define SIMULATE_ID "MSVC" 204 | # endif 205 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 206 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 207 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 208 | # if defined(_MSC_VER) 209 | /* _MSC_VER = VVRR */ 210 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 211 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 212 | # endif 213 | # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) 214 | 215 | #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) 216 | # define COMPILER_ID "ARMClang" 217 | # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) 218 | # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) 219 | # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) 220 | # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) 221 | 222 | #elif defined(__clang__) 223 | # define COMPILER_ID "Clang" 224 | # if defined(_MSC_VER) 225 | # define SIMULATE_ID "MSVC" 226 | # endif 227 | # define COMPILER_VERSION_MAJOR DEC(__clang_major__) 228 | # define COMPILER_VERSION_MINOR DEC(__clang_minor__) 229 | # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) 230 | # if defined(_MSC_VER) 231 | /* _MSC_VER = VVRR */ 232 | # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) 233 | # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) 234 | # endif 235 | 236 | #elif defined(__GNUC__) || defined(__GNUG__) 237 | # define COMPILER_ID "GNU" 238 | # if defined(__GNUC__) 239 | # define COMPILER_VERSION_MAJOR DEC(__GNUC__) 240 | # else 241 | # define COMPILER_VERSION_MAJOR DEC(__GNUG__) 242 | # endif 243 | # if defined(__GNUC_MINOR__) 244 | # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) 245 | # endif 246 | # if defined(__GNUC_PATCHLEVEL__) 247 | # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) 248 | # endif 249 | 250 | #elif defined(_MSC_VER) 251 | # define COMPILER_ID "MSVC" 252 | /* _MSC_VER = VVRR */ 253 | # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) 254 | # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) 255 | # if defined(_MSC_FULL_VER) 256 | # if _MSC_VER >= 1400 257 | /* _MSC_FULL_VER = VVRRPPPPP */ 258 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) 259 | # else 260 | /* _MSC_FULL_VER = VVRRPPPP */ 261 | # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) 262 | # endif 263 | # endif 264 | # if defined(_MSC_BUILD) 265 | # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) 266 | # endif 267 | 268 | #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) 269 | # define COMPILER_ID "ADSP" 270 | #if defined(__VISUALDSPVERSION__) 271 | /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ 272 | # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) 273 | # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) 274 | # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) 275 | #endif 276 | 277 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 278 | # define COMPILER_ID "IAR" 279 | # if defined(__VER__) && defined(__ICCARM__) 280 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) 281 | # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) 282 | # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) 283 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 284 | # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) 285 | # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) 286 | # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) 287 | # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) 288 | # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) 289 | # endif 290 | 291 | 292 | /* These compilers are either not known or too old to define an 293 | identification macro. Try to identify the platform and guess that 294 | it is the native compiler. */ 295 | #elif defined(__hpux) || defined(__hpua) 296 | # define COMPILER_ID "HP" 297 | 298 | #else /* unknown compiler */ 299 | # define COMPILER_ID "" 300 | #endif 301 | 302 | /* Construct the string literal in pieces to prevent the source from 303 | getting matched. Store it in a pointer rather than an array 304 | because some compilers will just produce instructions to fill the 305 | array rather than assigning a pointer to a static array. */ 306 | char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; 307 | #ifdef SIMULATE_ID 308 | char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; 309 | #endif 310 | 311 | #ifdef __QNXNTO__ 312 | char const* qnxnto = "INFO" ":" "qnxnto[]"; 313 | #endif 314 | 315 | #if defined(__CRAYXE) || defined(__CRAYXC) 316 | char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; 317 | #endif 318 | 319 | #define STRINGIFY_HELPER(X) #X 320 | #define STRINGIFY(X) STRINGIFY_HELPER(X) 321 | 322 | /* Identify known platforms by name. */ 323 | #if defined(__linux) || defined(__linux__) || defined(linux) 324 | # define PLATFORM_ID "Linux" 325 | 326 | #elif defined(__CYGWIN__) 327 | # define PLATFORM_ID "Cygwin" 328 | 329 | #elif defined(__MINGW32__) 330 | # define PLATFORM_ID "MinGW" 331 | 332 | #elif defined(__APPLE__) 333 | # define PLATFORM_ID "Darwin" 334 | 335 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 336 | # define PLATFORM_ID "Windows" 337 | 338 | #elif defined(__FreeBSD__) || defined(__FreeBSD) 339 | # define PLATFORM_ID "FreeBSD" 340 | 341 | #elif defined(__NetBSD__) || defined(__NetBSD) 342 | # define PLATFORM_ID "NetBSD" 343 | 344 | #elif defined(__OpenBSD__) || defined(__OPENBSD) 345 | # define PLATFORM_ID "OpenBSD" 346 | 347 | #elif defined(__sun) || defined(sun) 348 | # define PLATFORM_ID "SunOS" 349 | 350 | #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) 351 | # define PLATFORM_ID "AIX" 352 | 353 | #elif defined(__hpux) || defined(__hpux__) 354 | # define PLATFORM_ID "HP-UX" 355 | 356 | #elif defined(__HAIKU__) 357 | # define PLATFORM_ID "Haiku" 358 | 359 | #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) 360 | # define PLATFORM_ID "BeOS" 361 | 362 | #elif defined(__QNX__) || defined(__QNXNTO__) 363 | # define PLATFORM_ID "QNX" 364 | 365 | #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) 366 | # define PLATFORM_ID "Tru64" 367 | 368 | #elif defined(__riscos) || defined(__riscos__) 369 | # define PLATFORM_ID "RISCos" 370 | 371 | #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) 372 | # define PLATFORM_ID "SINIX" 373 | 374 | #elif defined(__UNIX_SV__) 375 | # define PLATFORM_ID "UNIX_SV" 376 | 377 | #elif defined(__bsdos__) 378 | # define PLATFORM_ID "BSDOS" 379 | 380 | #elif defined(_MPRAS) || defined(MPRAS) 381 | # define PLATFORM_ID "MP-RAS" 382 | 383 | #elif defined(__osf) || defined(__osf__) 384 | # define PLATFORM_ID "OSF1" 385 | 386 | #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) 387 | # define PLATFORM_ID "SCO_SV" 388 | 389 | #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) 390 | # define PLATFORM_ID "ULTRIX" 391 | 392 | #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) 393 | # define PLATFORM_ID "Xenix" 394 | 395 | #elif defined(__WATCOMC__) 396 | # if defined(__LINUX__) 397 | # define PLATFORM_ID "Linux" 398 | 399 | # elif defined(__DOS__) 400 | # define PLATFORM_ID "DOS" 401 | 402 | # elif defined(__OS2__) 403 | # define PLATFORM_ID "OS2" 404 | 405 | # elif defined(__WINDOWS__) 406 | # define PLATFORM_ID "Windows3x" 407 | 408 | # else /* unknown platform */ 409 | # define PLATFORM_ID 410 | # endif 411 | 412 | #elif defined(__INTEGRITY) 413 | # if defined(INT_178B) 414 | # define PLATFORM_ID "Integrity178" 415 | 416 | # else /* regular Integrity */ 417 | # define PLATFORM_ID "Integrity" 418 | # endif 419 | 420 | #else /* unknown platform */ 421 | # define PLATFORM_ID 422 | 423 | #endif 424 | 425 | /* For windows compilers MSVC and Intel we can determine 426 | the architecture of the compiler being used. This is because 427 | the compilers do not have flags that can change the architecture, 428 | but rather depend on which compiler is being used 429 | */ 430 | #if defined(_WIN32) && defined(_MSC_VER) 431 | # if defined(_M_IA64) 432 | # define ARCHITECTURE_ID "IA64" 433 | 434 | # elif defined(_M_X64) || defined(_M_AMD64) 435 | # define ARCHITECTURE_ID "x64" 436 | 437 | # elif defined(_M_IX86) 438 | # define ARCHITECTURE_ID "X86" 439 | 440 | # elif defined(_M_ARM64) 441 | # define ARCHITECTURE_ID "ARM64" 442 | 443 | # elif defined(_M_ARM) 444 | # if _M_ARM == 4 445 | # define ARCHITECTURE_ID "ARMV4I" 446 | # elif _M_ARM == 5 447 | # define ARCHITECTURE_ID "ARMV5I" 448 | # else 449 | # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) 450 | # endif 451 | 452 | # elif defined(_M_MIPS) 453 | # define ARCHITECTURE_ID "MIPS" 454 | 455 | # elif defined(_M_SH) 456 | # define ARCHITECTURE_ID "SHx" 457 | 458 | # else /* unknown architecture */ 459 | # define ARCHITECTURE_ID "" 460 | # endif 461 | 462 | #elif defined(__WATCOMC__) 463 | # if defined(_M_I86) 464 | # define ARCHITECTURE_ID "I86" 465 | 466 | # elif defined(_M_IX86) 467 | # define ARCHITECTURE_ID "X86" 468 | 469 | # else /* unknown architecture */ 470 | # define ARCHITECTURE_ID "" 471 | # endif 472 | 473 | #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) 474 | # if defined(__ICCARM__) 475 | # define ARCHITECTURE_ID "ARM" 476 | 477 | # elif defined(__ICCRX__) 478 | # define ARCHITECTURE_ID "RX" 479 | 480 | # elif defined(__ICCRH850__) 481 | # define ARCHITECTURE_ID "RH850" 482 | 483 | # elif defined(__ICCRL78__) 484 | # define ARCHITECTURE_ID "RL78" 485 | 486 | # elif defined(__ICCRISCV__) 487 | # define ARCHITECTURE_ID "RISCV" 488 | 489 | # elif defined(__ICCAVR__) 490 | # define ARCHITECTURE_ID "AVR" 491 | 492 | # elif defined(__ICC430__) 493 | # define ARCHITECTURE_ID "MSP430" 494 | 495 | # elif defined(__ICCV850__) 496 | # define ARCHITECTURE_ID "V850" 497 | 498 | # elif defined(__ICC8051__) 499 | # define ARCHITECTURE_ID "8051" 500 | 501 | # else /* unknown architecture */ 502 | # define ARCHITECTURE_ID "" 503 | # endif 504 | 505 | #elif defined(__ghs__) 506 | # if defined(__PPC64__) 507 | # define ARCHITECTURE_ID "PPC64" 508 | 509 | # elif defined(__ppc__) 510 | # define ARCHITECTURE_ID "PPC" 511 | 512 | # elif defined(__ARM__) 513 | # define ARCHITECTURE_ID "ARM" 514 | 515 | # elif defined(__x86_64__) 516 | # define ARCHITECTURE_ID "x64" 517 | 518 | # elif defined(__i386__) 519 | # define ARCHITECTURE_ID "X86" 520 | 521 | # else /* unknown architecture */ 522 | # define ARCHITECTURE_ID "" 523 | # endif 524 | #else 525 | # define ARCHITECTURE_ID 526 | #endif 527 | 528 | /* Convert integer to decimal digit literals. */ 529 | #define DEC(n) \ 530 | ('0' + (((n) / 10000000)%10)), \ 531 | ('0' + (((n) / 1000000)%10)), \ 532 | ('0' + (((n) / 100000)%10)), \ 533 | ('0' + (((n) / 10000)%10)), \ 534 | ('0' + (((n) / 1000)%10)), \ 535 | ('0' + (((n) / 100)%10)), \ 536 | ('0' + (((n) / 10)%10)), \ 537 | ('0' + ((n) % 10)) 538 | 539 | /* Convert integer to hex digit literals. */ 540 | #define HEX(n) \ 541 | ('0' + ((n)>>28 & 0xF)), \ 542 | ('0' + ((n)>>24 & 0xF)), \ 543 | ('0' + ((n)>>20 & 0xF)), \ 544 | ('0' + ((n)>>16 & 0xF)), \ 545 | ('0' + ((n)>>12 & 0xF)), \ 546 | ('0' + ((n)>>8 & 0xF)), \ 547 | ('0' + ((n)>>4 & 0xF)), \ 548 | ('0' + ((n) & 0xF)) 549 | 550 | /* Construct a string literal encoding the version number components. */ 551 | #ifdef COMPILER_VERSION_MAJOR 552 | char const info_version[] = { 553 | 'I', 'N', 'F', 'O', ':', 554 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', 555 | COMPILER_VERSION_MAJOR, 556 | # ifdef COMPILER_VERSION_MINOR 557 | '.', COMPILER_VERSION_MINOR, 558 | # ifdef COMPILER_VERSION_PATCH 559 | '.', COMPILER_VERSION_PATCH, 560 | # ifdef COMPILER_VERSION_TWEAK 561 | '.', COMPILER_VERSION_TWEAK, 562 | # endif 563 | # endif 564 | # endif 565 | ']','\0'}; 566 | #endif 567 | 568 | /* Construct a string literal encoding the internal version number. */ 569 | #ifdef COMPILER_VERSION_INTERNAL 570 | char const info_version_internal[] = { 571 | 'I', 'N', 'F', 'O', ':', 572 | 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', 573 | 'i','n','t','e','r','n','a','l','[', 574 | COMPILER_VERSION_INTERNAL,']','\0'}; 575 | #endif 576 | 577 | /* Construct a string literal encoding the version number components. */ 578 | #ifdef SIMULATE_VERSION_MAJOR 579 | char const info_simulate_version[] = { 580 | 'I', 'N', 'F', 'O', ':', 581 | 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', 582 | SIMULATE_VERSION_MAJOR, 583 | # ifdef SIMULATE_VERSION_MINOR 584 | '.', SIMULATE_VERSION_MINOR, 585 | # ifdef SIMULATE_VERSION_PATCH 586 | '.', SIMULATE_VERSION_PATCH, 587 | # ifdef SIMULATE_VERSION_TWEAK 588 | '.', SIMULATE_VERSION_TWEAK, 589 | # endif 590 | # endif 591 | # endif 592 | ']','\0'}; 593 | #endif 594 | 595 | /* Construct the string literal in pieces to prevent the source from 596 | getting matched. Store it in a pointer rather than an array 597 | because some compilers will just produce instructions to fill the 598 | array rather than assigning a pointer to a static array. */ 599 | char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; 600 | char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; 601 | 602 | 603 | 604 | 605 | #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L 606 | # if defined(__INTEL_CXX11_MODE__) 607 | # if defined(__cpp_aggregate_nsdmi) 608 | # define CXX_STD 201402L 609 | # else 610 | # define CXX_STD 201103L 611 | # endif 612 | # else 613 | # define CXX_STD 199711L 614 | # endif 615 | #elif defined(_MSC_VER) && defined(_MSVC_LANG) 616 | # define CXX_STD _MSVC_LANG 617 | #else 618 | # define CXX_STD __cplusplus 619 | #endif 620 | 621 | const char* info_language_dialect_default = "INFO" ":" "dialect_default[" 622 | #if CXX_STD > 201703L 623 | "20" 624 | #elif CXX_STD >= 201703L 625 | "17" 626 | #elif CXX_STD >= 201402L 627 | "14" 628 | #elif CXX_STD >= 201103L 629 | "11" 630 | #else 631 | "98" 632 | #endif 633 | "]"; 634 | 635 | /*--------------------------------------------------------------------------*/ 636 | 637 | int main(int argc, char* argv[]) 638 | { 639 | int require = 0; 640 | require += info_compiler[argc]; 641 | require += info_platform[argc]; 642 | #ifdef COMPILER_VERSION_MAJOR 643 | require += info_version[argc]; 644 | #endif 645 | #ifdef COMPILER_VERSION_INTERNAL 646 | require += info_version_internal[argc]; 647 | #endif 648 | #ifdef SIMULATE_ID 649 | require += info_simulate[argc]; 650 | #endif 651 | #ifdef SIMULATE_VERSION_MAJOR 652 | require += info_simulate_version[argc]; 653 | #endif 654 | #if defined(__CRAYXE) || defined(__CRAYXC) 655 | require += info_cray[argc]; 656 | #endif 657 | require += info_language_dialect_default[argc]; 658 | (void)argv; 659 | return require; 660 | } 661 | -------------------------------------------------------------------------------- /build/CMakeFiles/3.16.3/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /build/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/workspaces/Yat-Search-Engine") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/workspaces/Yat-Search-Engine/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /build/CMakeFiles/CMakeOutput.log: -------------------------------------------------------------------------------- 1 | The system is: Linux - 6.5.0-1025-azure - x86_64 2 | Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. 3 | Compiler: /usr/bin/g++ 4 | Build flags: 5 | Id flags: 6 | 7 | The output was: 8 | 0 9 | 10 | 11 | Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" 12 | 13 | The CXX compiler identification is GNU, found in "/workspaces/Yat-Search-Engine/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out" 14 | 15 | Determining if the CXX compiler works passed with the following output: 16 | Change Dir: /workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp 17 | 18 | Run Build Command(s):/usr/bin/make cmTC_04ec4/fast && /usr/bin/make -f CMakeFiles/cmTC_04ec4.dir/build.make CMakeFiles/cmTC_04ec4.dir/build 19 | make[1]: Entering directory '/workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp' 20 | Building CXX object CMakeFiles/cmTC_04ec4.dir/testCXXCompiler.cxx.o 21 | /usr/bin/g++ -o CMakeFiles/cmTC_04ec4.dir/testCXXCompiler.cxx.o -c /workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx 22 | Linking CXX executable cmTC_04ec4 23 | /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_04ec4.dir/link.txt --verbose=1 24 | /usr/bin/g++ CMakeFiles/cmTC_04ec4.dir/testCXXCompiler.cxx.o -o cmTC_04ec4 25 | make[1]: Leaving directory '/workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp' 26 | 27 | 28 | 29 | Detecting CXX compiler ABI info compiled with the following output: 30 | Change Dir: /workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp 31 | 32 | Run Build Command(s):/usr/bin/make cmTC_710c5/fast && /usr/bin/make -f CMakeFiles/cmTC_710c5.dir/build.make CMakeFiles/cmTC_710c5.dir/build 33 | make[1]: Entering directory '/workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp' 34 | Building CXX object CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o 35 | /usr/bin/g++ -v -o CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp 36 | Using built-in specs. 37 | COLLECT_GCC=/usr/bin/g++ 38 | OFFLOAD_TARGET_NAMES=nvptx-none:hsa 39 | OFFLOAD_TARGET_DEFAULT=1 40 | Target: x86_64-linux-gnu 41 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 42 | Thread model: posix 43 | gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) 44 | COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' 45 | /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccYIRO3a.s 46 | GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu) 47 | compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP 48 | 49 | GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 50 | ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9" 51 | ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" 52 | ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed" 53 | ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include" 54 | #include "..." search starts here: 55 | #include <...> search starts here: 56 | /usr/include/c++/9 57 | /usr/include/x86_64-linux-gnu/c++/9 58 | /usr/include/c++/9/backward 59 | /usr/lib/gcc/x86_64-linux-gnu/9/include 60 | /usr/local/include 61 | /usr/include/x86_64-linux-gnu 62 | /usr/include 63 | End of search list. 64 | GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu) 65 | compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP 66 | 67 | GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 68 | Compiler executable checksum: 3d1eba838554fa2348dba760e4770469 69 | COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' 70 | as -v --64 -o CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccYIRO3a.s 71 | GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34 72 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/ 73 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/ 74 | COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' 75 | Linking CXX executable cmTC_710c5 76 | /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_710c5.dir/link.txt --verbose=1 77 | /usr/bin/g++ -v CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_710c5 78 | Using built-in specs. 79 | COLLECT_GCC=/usr/bin/g++ 80 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper 81 | OFFLOAD_TARGET_NAMES=nvptx-none:hsa 82 | OFFLOAD_TARGET_DEFAULT=1 83 | Target: x86_64-linux-gnu 84 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 85 | Thread model: posix 86 | gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) 87 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/ 88 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/ 89 | COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_710c5' '-shared-libgcc' '-mtune=generic' '-march=x86-64' 90 | /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccojtiIA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_710c5 /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o 91 | COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_710c5' '-shared-libgcc' '-mtune=generic' '-march=x86-64' 92 | make[1]: Leaving directory '/workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp' 93 | 94 | 95 | 96 | Parsed CXX implicit include dir info from above output: rv=done 97 | found start of include info 98 | found start of implicit include info 99 | add: [/usr/include/c++/9] 100 | add: [/usr/include/x86_64-linux-gnu/c++/9] 101 | add: [/usr/include/c++/9/backward] 102 | add: [/usr/lib/gcc/x86_64-linux-gnu/9/include] 103 | add: [/usr/local/include] 104 | add: [/usr/include/x86_64-linux-gnu] 105 | add: [/usr/include] 106 | end of search list found 107 | collapse include dir [/usr/include/c++/9] ==> [/usr/include/c++/9] 108 | collapse include dir [/usr/include/x86_64-linux-gnu/c++/9] ==> [/usr/include/x86_64-linux-gnu/c++/9] 109 | collapse include dir [/usr/include/c++/9/backward] ==> [/usr/include/c++/9/backward] 110 | collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include] 111 | collapse include dir [/usr/local/include] ==> [/usr/local/include] 112 | collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu] 113 | collapse include dir [/usr/include] ==> [/usr/include] 114 | implicit include dirs: [/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include] 115 | 116 | 117 | Parsed CXX implicit link information from above output: 118 | link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] 119 | ignore line: [Change Dir: /workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp] 120 | ignore line: [] 121 | ignore line: [Run Build Command(s):/usr/bin/make cmTC_710c5/fast && /usr/bin/make -f CMakeFiles/cmTC_710c5.dir/build.make CMakeFiles/cmTC_710c5.dir/build] 122 | ignore line: [make[1]: Entering directory '/workspaces/Yat-Search-Engine/build/CMakeFiles/CMakeTmp'] 123 | ignore line: [Building CXX object CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o] 124 | ignore line: [/usr/bin/g++ -v -o CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp] 125 | ignore line: [Using built-in specs.] 126 | ignore line: [COLLECT_GCC=/usr/bin/g++] 127 | ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa] 128 | ignore line: [OFFLOAD_TARGET_DEFAULT=1] 129 | ignore line: [Target: x86_64-linux-gnu] 130 | ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] 131 | ignore line: [Thread model: posix] 132 | ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ] 133 | ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] 134 | ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccYIRO3a.s] 135 | ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)] 136 | ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] 137 | ignore line: [] 138 | ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] 139 | ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"] 140 | ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"] 141 | ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"] 142 | ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"] 143 | ignore line: [#include "..." search starts here:] 144 | ignore line: [#include <...> search starts here:] 145 | ignore line: [ /usr/include/c++/9] 146 | ignore line: [ /usr/include/x86_64-linux-gnu/c++/9] 147 | ignore line: [ /usr/include/c++/9/backward] 148 | ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include] 149 | ignore line: [ /usr/local/include] 150 | ignore line: [ /usr/include/x86_64-linux-gnu] 151 | ignore line: [ /usr/include] 152 | ignore line: [End of search list.] 153 | ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)] 154 | ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] 155 | ignore line: [] 156 | ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] 157 | ignore line: [Compiler executable checksum: 3d1eba838554fa2348dba760e4770469] 158 | ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] 159 | ignore line: [ as -v --64 -o CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccYIRO3a.s] 160 | ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34] 161 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/] 162 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/] 163 | ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] 164 | ignore line: [Linking CXX executable cmTC_710c5] 165 | ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_710c5.dir/link.txt --verbose=1] 166 | ignore line: [/usr/bin/g++ -v CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_710c5 ] 167 | ignore line: [Using built-in specs.] 168 | ignore line: [COLLECT_GCC=/usr/bin/g++] 169 | ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] 170 | ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa] 171 | ignore line: [OFFLOAD_TARGET_DEFAULT=1] 172 | ignore line: [Target: x86_64-linux-gnu] 173 | ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] 174 | ignore line: [Thread model: posix] 175 | ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ] 176 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/] 177 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/] 178 | ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_710c5' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] 179 | link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccojtiIA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_710c5 /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] 180 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore 181 | arg [-plugin] ==> ignore 182 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore 183 | arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore 184 | arg [-plugin-opt=-fresolution=/tmp/ccojtiIA.res] ==> ignore 185 | arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore 186 | arg [-plugin-opt=-pass-through=-lgcc] ==> ignore 187 | arg [-plugin-opt=-pass-through=-lc] ==> ignore 188 | arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore 189 | arg [-plugin-opt=-pass-through=-lgcc] ==> ignore 190 | arg [--build-id] ==> ignore 191 | arg [--eh-frame-hdr] ==> ignore 192 | arg [-m] ==> ignore 193 | arg [elf_x86_64] ==> ignore 194 | arg [--hash-style=gnu] ==> ignore 195 | arg [--as-needed] ==> ignore 196 | arg [-dynamic-linker] ==> ignore 197 | arg [/lib64/ld-linux-x86-64.so.2] ==> ignore 198 | arg [-pie] ==> ignore 199 | arg [-znow] ==> ignore 200 | arg [-zrelro] ==> ignore 201 | arg [-o] ==> ignore 202 | arg [cmTC_710c5] ==> ignore 203 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore 204 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore 205 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore 206 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9] 207 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] 208 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] 209 | arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] 210 | arg [-L/lib/../lib] ==> dir [/lib/../lib] 211 | arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] 212 | arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] 213 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] 214 | arg [CMakeFiles/cmTC_710c5.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore 215 | arg [-lstdc++] ==> lib [stdc++] 216 | arg [-lm] ==> lib [m] 217 | arg [-lgcc_s] ==> lib [gcc_s] 218 | arg [-lgcc] ==> lib [gcc] 219 | arg [-lc] ==> lib [c] 220 | arg [-lgcc_s] ==> lib [gcc_s] 221 | arg [-lgcc] ==> lib [gcc] 222 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore 223 | arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore 224 | collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9] 225 | collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] 226 | collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib] 227 | collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] 228 | collapse library dir [/lib/../lib] ==> [/lib] 229 | collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] 230 | collapse library dir [/usr/lib/../lib] ==> [/usr/lib] 231 | collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib] 232 | implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc] 233 | implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] 234 | implicit fwks: [] 235 | 236 | 237 | -------------------------------------------------------------------------------- /build/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "/usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake" 11 | "/usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" 12 | "/usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake" 13 | "/usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake" 14 | "/usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake" 15 | "/usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake" 16 | "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake" 17 | "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake" 18 | "/usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 19 | "/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake" 20 | "/usr/share/cmake-3.16/Modules/Compiler/GNU.cmake" 21 | "/usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake" 22 | "/usr/share/cmake-3.16/Modules/Platform/Linux-GNU-CXX.cmake" 23 | "/usr/share/cmake-3.16/Modules/Platform/Linux-GNU.cmake" 24 | "/usr/share/cmake-3.16/Modules/Platform/Linux.cmake" 25 | "/usr/share/cmake-3.16/Modules/Platform/UnixPaths.cmake" 26 | "../CMakeLists.txt" 27 | "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" 28 | "CMakeFiles/3.16.3/CMakeSystem.cmake" 29 | ) 30 | 31 | # The corresponding makefile is: 32 | set(CMAKE_MAKEFILE_OUTPUTS 33 | "Makefile" 34 | "CMakeFiles/cmake.check_cache" 35 | ) 36 | 37 | # Byproducts of CMake generate step: 38 | set(CMAKE_MAKEFILE_PRODUCTS 39 | "CMakeFiles/CMakeDirectoryInformation.cmake" 40 | ) 41 | 42 | # Dependency information for all targets: 43 | set(CMAKE_DEPEND_INFO_FILES 44 | "CMakeFiles/YatSearchEngine.dir/DependInfo.cmake" 45 | ) 46 | -------------------------------------------------------------------------------- /build/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | #============================================================================= 10 | # Special targets provided by cmake. 11 | 12 | # Disable implicit rules so canonical targets will work. 13 | .SUFFIXES: 14 | 15 | 16 | # Remove some rules from gmake that .SUFFIXES does not remove. 17 | SUFFIXES = 18 | 19 | .SUFFIXES: .hpux_make_needs_suffix_list 20 | 21 | 22 | # Suppress display of executed commands. 23 | $(VERBOSE).SILENT: 24 | 25 | 26 | # A target that is always out of date. 27 | cmake_force: 28 | 29 | .PHONY : cmake_force 30 | 31 | #============================================================================= 32 | # Set environment variables for the build. 33 | 34 | # The shell in which to execute make rules. 35 | SHELL = /bin/sh 36 | 37 | # The CMake executable. 38 | CMAKE_COMMAND = /usr/bin/cmake 39 | 40 | # The command to remove a file. 41 | RM = /usr/bin/cmake -E remove -f 42 | 43 | # Escaping for special characters. 44 | EQUALS = = 45 | 46 | # The top-level source directory on which CMake was run. 47 | CMAKE_SOURCE_DIR = /workspaces/Yat-Search-Engine 48 | 49 | # The top-level build directory on which CMake was run. 50 | CMAKE_BINARY_DIR = /workspaces/Yat-Search-Engine/build 51 | 52 | #============================================================================= 53 | # Directory level rules for the build root directory 54 | 55 | # The main recursive "all" target. 56 | all: CMakeFiles/YatSearchEngine.dir/all 57 | 58 | .PHONY : all 59 | 60 | # The main recursive "preinstall" target. 61 | preinstall: 62 | 63 | .PHONY : preinstall 64 | 65 | # The main recursive "clean" target. 66 | clean: CMakeFiles/YatSearchEngine.dir/clean 67 | 68 | .PHONY : clean 69 | 70 | #============================================================================= 71 | # Target rules for target CMakeFiles/YatSearchEngine.dir 72 | 73 | # All Build rule for target. 74 | CMakeFiles/YatSearchEngine.dir/all: 75 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/depend 76 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/build 77 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/workspaces/Yat-Search-Engine/build/CMakeFiles --progress-num=1,2,3,4,5 "Built target YatSearchEngine" 78 | .PHONY : CMakeFiles/YatSearchEngine.dir/all 79 | 80 | # Build rule for subdir invocation for target. 81 | CMakeFiles/YatSearchEngine.dir/rule: cmake_check_build_system 82 | $(CMAKE_COMMAND) -E cmake_progress_start /workspaces/Yat-Search-Engine/build/CMakeFiles 5 83 | $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/YatSearchEngine.dir/all 84 | $(CMAKE_COMMAND) -E cmake_progress_start /workspaces/Yat-Search-Engine/build/CMakeFiles 0 85 | .PHONY : CMakeFiles/YatSearchEngine.dir/rule 86 | 87 | # Convenience name for target. 88 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/rule 89 | 90 | .PHONY : YatSearchEngine 91 | 92 | # clean rule for target. 93 | CMakeFiles/YatSearchEngine.dir/clean: 94 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/clean 95 | .PHONY : CMakeFiles/YatSearchEngine.dir/clean 96 | 97 | #============================================================================= 98 | # Special targets to cleanup operation of make. 99 | 100 | # Special rule to run CMake to check the build system integrity. 101 | # No rule that depends on this can have commands that come from listfiles 102 | # because they might be regenerated. 103 | cmake_check_build_system: 104 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 105 | .PHONY : cmake_check_build_system 106 | 107 | -------------------------------------------------------------------------------- /build/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /workspaces/Yat-Search-Engine/build/CMakeFiles/rebuild_cache.dir 2 | /workspaces/Yat-Search-Engine/build/CMakeFiles/edit_cache.dir 3 | /workspaces/Yat-Search-Engine/build/CMakeFiles/YatSearchEngine.dir 4 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | ../include/RegexSearch.h 10 | string 11 | - 12 | vector 13 | - 14 | locale 15 | - 16 | codecvt 17 | - 18 | fstream 19 | - 20 | iostream 21 | - 22 | 23 | ../include/TextSearchEngine.h 24 | string 25 | - 26 | vector 27 | - 28 | functional 29 | - 30 | locale 31 | - 32 | codecvt 33 | - 34 | fstream 35 | - 36 | iostream 37 | - 38 | oyyphash.h 39 | ../include/oyyphash.h 40 | 41 | ../include/oyyphash.h 42 | string 43 | - 44 | vector 45 | - 46 | utility 47 | - 48 | 49 | /workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp 50 | TextSearchEngine.h 51 | /workspaces/Yat-Search-Engine/src/TextSearchEngine.h 52 | iostream 53 | - 54 | fstream 55 | - 56 | sstream 57 | - 58 | algorithm 59 | - 60 | regex 61 | - 62 | cctype 63 | - 64 | locale 65 | - 66 | 67 | /workspaces/Yat-Search-Engine/src/main.cpp 68 | TextSearchEngine.h 69 | /workspaces/Yat-Search-Engine/src/TextSearchEngine.h 70 | RegexSearch.h 71 | /workspaces/Yat-Search-Engine/src/RegexSearch.h 72 | oyyphash.h 73 | /workspaces/Yat-Search-Engine/src/oyyphash.h 74 | iostream 75 | - 76 | limits 77 | - 78 | locale 79 | - 80 | fstream 81 | - 82 | vector 83 | - 84 | string 85 | - 86 | codecvt 87 | - 88 | filesystem 89 | - 90 | chrono 91 | - 92 | 93 | /workspaces/Yat-Search-Engine/src/oyyphash.cpp 94 | oyyphash.h 95 | /workspaces/Yat-Search-Engine/src/oyyphash.h 96 | algorithm 97 | - 98 | 99 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/workspaces/Yat-Search-Engine/src/RegexSearch.cpp" "/workspaces/Yat-Search-Engine/build/CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o" 8 | "/workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp" "/workspaces/Yat-Search-Engine/build/CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o" 9 | "/workspaces/Yat-Search-Engine/src/main.cpp" "/workspaces/Yat-Search-Engine/build/CMakeFiles/YatSearchEngine.dir/src/main.cpp.o" 10 | "/workspaces/Yat-Search-Engine/src/oyyphash.cpp" "/workspaces/Yat-Search-Engine/build/CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o" 11 | ) 12 | set(CMAKE_CXX_COMPILER_ID "GNU") 13 | 14 | # The include file search paths: 15 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 16 | "../include" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /usr/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /usr/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /workspaces/Yat-Search-Engine 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /workspaces/Yat-Search-Engine/build 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/YatSearchEngine.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/YatSearchEngine.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/YatSearchEngine.dir/flags.make 59 | 60 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: CMakeFiles/YatSearchEngine.dir/flags.make 61 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: ../src/main.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/workspaces/Yat-Search-Engine/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/YatSearchEngine.dir/src/main.cpp.o" 63 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/YatSearchEngine.dir/src/main.cpp.o -c /workspaces/Yat-Search-Engine/src/main.cpp 64 | 65 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/YatSearchEngine.dir/src/main.cpp.i" 67 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /workspaces/Yat-Search-Engine/src/main.cpp > CMakeFiles/YatSearchEngine.dir/src/main.cpp.i 68 | 69 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/YatSearchEngine.dir/src/main.cpp.s" 71 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /workspaces/Yat-Search-Engine/src/main.cpp -o CMakeFiles/YatSearchEngine.dir/src/main.cpp.s 72 | 73 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o: CMakeFiles/YatSearchEngine.dir/flags.make 74 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o: ../src/TextSearchEngine.cpp 75 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/workspaces/Yat-Search-Engine/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o" 76 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o -c /workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp 77 | 78 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.i: cmake_force 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.i" 80 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp > CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.i 81 | 82 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.s: cmake_force 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.s" 84 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp -o CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.s 85 | 86 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o: CMakeFiles/YatSearchEngine.dir/flags.make 87 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o: ../src/RegexSearch.cpp 88 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/workspaces/Yat-Search-Engine/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o" 89 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o -c /workspaces/Yat-Search-Engine/src/RegexSearch.cpp 90 | 91 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.i: cmake_force 92 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.i" 93 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /workspaces/Yat-Search-Engine/src/RegexSearch.cpp > CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.i 94 | 95 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.s: cmake_force 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.s" 97 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /workspaces/Yat-Search-Engine/src/RegexSearch.cpp -o CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.s 98 | 99 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o: CMakeFiles/YatSearchEngine.dir/flags.make 100 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o: ../src/oyyphash.cpp 101 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/workspaces/Yat-Search-Engine/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o" 102 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o -c /workspaces/Yat-Search-Engine/src/oyyphash.cpp 103 | 104 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.i: cmake_force 105 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.i" 106 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /workspaces/Yat-Search-Engine/src/oyyphash.cpp > CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.i 107 | 108 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.s: cmake_force 109 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.s" 110 | /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /workspaces/Yat-Search-Engine/src/oyyphash.cpp -o CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.s 111 | 112 | # Object files for target YatSearchEngine 113 | YatSearchEngine_OBJECTS = \ 114 | "CMakeFiles/YatSearchEngine.dir/src/main.cpp.o" \ 115 | "CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o" \ 116 | "CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o" \ 117 | "CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o" 118 | 119 | # External object files for target YatSearchEngine 120 | YatSearchEngine_EXTERNAL_OBJECTS = 121 | 122 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/src/main.cpp.o 123 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o 124 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o 125 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o 126 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/build.make 127 | YatSearchEngine: CMakeFiles/YatSearchEngine.dir/link.txt 128 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/workspaces/Yat-Search-Engine/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Linking CXX executable YatSearchEngine" 129 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/YatSearchEngine.dir/link.txt --verbose=$(VERBOSE) 130 | 131 | # Rule to build all files generated by this target. 132 | CMakeFiles/YatSearchEngine.dir/build: YatSearchEngine 133 | 134 | .PHONY : CMakeFiles/YatSearchEngine.dir/build 135 | 136 | CMakeFiles/YatSearchEngine.dir/clean: 137 | $(CMAKE_COMMAND) -P CMakeFiles/YatSearchEngine.dir/cmake_clean.cmake 138 | .PHONY : CMakeFiles/YatSearchEngine.dir/clean 139 | 140 | CMakeFiles/YatSearchEngine.dir/depend: 141 | cd /workspaces/Yat-Search-Engine/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /workspaces/Yat-Search-Engine /workspaces/Yat-Search-Engine /workspaces/Yat-Search-Engine/build /workspaces/Yat-Search-Engine/build /workspaces/Yat-Search-Engine/build/CMakeFiles/YatSearchEngine.dir/DependInfo.cmake --color=$(COLOR) 142 | .PHONY : CMakeFiles/YatSearchEngine.dir/depend 143 | 144 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o" 3 | "CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o" 4 | "CMakeFiles/YatSearchEngine.dir/src/main.cpp.o" 5 | "CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o" 6 | "YatSearchEngine" 7 | "YatSearchEngine.pdb" 8 | ) 9 | 10 | # Per-language clean rules from dependency scanning. 11 | foreach(lang CXX) 12 | include(CMakeFiles/YatSearchEngine.dir/cmake_clean_${lang}.cmake OPTIONAL) 13 | endforeach() 14 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o 5 | ../include/RegexSearch.h 6 | /workspaces/Yat-Search-Engine/src/RegexSearch.cpp 7 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o 8 | ../include/TextSearchEngine.h 9 | ../include/oyyphash.h 10 | /workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp 11 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o 12 | ../include/RegexSearch.h 13 | ../include/TextSearchEngine.h 14 | ../include/oyyphash.h 15 | /workspaces/Yat-Search-Engine/src/main.cpp 16 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o 17 | ../include/oyyphash.h 18 | /workspaces/Yat-Search-Engine/src/oyyphash.cpp 19 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o: ../include/RegexSearch.h 5 | CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o: ../src/RegexSearch.cpp 6 | 7 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o: ../include/TextSearchEngine.h 8 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o: ../include/oyyphash.h 9 | CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o: ../src/TextSearchEngine.cpp 10 | 11 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: ../include/RegexSearch.h 12 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: ../include/TextSearchEngine.h 13 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: ../include/oyyphash.h 14 | CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: ../src/main.cpp 15 | 16 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o: ../include/oyyphash.h 17 | CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o: ../src/oyyphash.cpp 18 | 19 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | # compile CXX with /usr/bin/g++ 5 | CXX_FLAGS = -g -std=gnu++17 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/workspaces/Yat-Search-Engine/include 10 | 11 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/g++ -g CMakeFiles/YatSearchEngine.dir/src/main.cpp.o CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o -o YatSearchEngine 2 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | CMAKE_PROGRESS_4 = 4 5 | CMAKE_PROGRESS_5 = 5 6 | 7 | -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/src/main.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/CMakeFiles/YatSearchEngine.dir/src/main.cpp.o -------------------------------------------------------------------------------- /build/CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o -------------------------------------------------------------------------------- /build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /build/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /build/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.16 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /usr/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /usr/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /workspaces/Yat-Search-Engine 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /workspaces/Yat-Search-Engine/build 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | $(CMAKE_COMMAND) -E cmake_progress_start /workspaces/Yat-Search-Engine/build/CMakeFiles /workspaces/Yat-Search-Engine/build/CMakeFiles/progress.marks 84 | $(MAKE) -f CMakeFiles/Makefile2 all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /workspaces/Yat-Search-Engine/build/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | $(MAKE) -f CMakeFiles/Makefile2 clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | #============================================================================= 114 | # Target rules for targets named YatSearchEngine 115 | 116 | # Build rule for target. 117 | YatSearchEngine: cmake_check_build_system 118 | $(MAKE) -f CMakeFiles/Makefile2 YatSearchEngine 119 | .PHONY : YatSearchEngine 120 | 121 | # fast build rule for target. 122 | YatSearchEngine/fast: 123 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/build 124 | .PHONY : YatSearchEngine/fast 125 | 126 | src/RegexSearch.o: src/RegexSearch.cpp.o 127 | 128 | .PHONY : src/RegexSearch.o 129 | 130 | # target to build an object file 131 | src/RegexSearch.cpp.o: 132 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o 133 | .PHONY : src/RegexSearch.cpp.o 134 | 135 | src/RegexSearch.i: src/RegexSearch.cpp.i 136 | 137 | .PHONY : src/RegexSearch.i 138 | 139 | # target to preprocess a source file 140 | src/RegexSearch.cpp.i: 141 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.i 142 | .PHONY : src/RegexSearch.cpp.i 143 | 144 | src/RegexSearch.s: src/RegexSearch.cpp.s 145 | 146 | .PHONY : src/RegexSearch.s 147 | 148 | # target to generate assembly for a file 149 | src/RegexSearch.cpp.s: 150 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.s 151 | .PHONY : src/RegexSearch.cpp.s 152 | 153 | src/TextSearchEngine.o: src/TextSearchEngine.cpp.o 154 | 155 | .PHONY : src/TextSearchEngine.o 156 | 157 | # target to build an object file 158 | src/TextSearchEngine.cpp.o: 159 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o 160 | .PHONY : src/TextSearchEngine.cpp.o 161 | 162 | src/TextSearchEngine.i: src/TextSearchEngine.cpp.i 163 | 164 | .PHONY : src/TextSearchEngine.i 165 | 166 | # target to preprocess a source file 167 | src/TextSearchEngine.cpp.i: 168 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.i 169 | .PHONY : src/TextSearchEngine.cpp.i 170 | 171 | src/TextSearchEngine.s: src/TextSearchEngine.cpp.s 172 | 173 | .PHONY : src/TextSearchEngine.s 174 | 175 | # target to generate assembly for a file 176 | src/TextSearchEngine.cpp.s: 177 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.s 178 | .PHONY : src/TextSearchEngine.cpp.s 179 | 180 | src/main.o: src/main.cpp.o 181 | 182 | .PHONY : src/main.o 183 | 184 | # target to build an object file 185 | src/main.cpp.o: 186 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/main.cpp.o 187 | .PHONY : src/main.cpp.o 188 | 189 | src/main.i: src/main.cpp.i 190 | 191 | .PHONY : src/main.i 192 | 193 | # target to preprocess a source file 194 | src/main.cpp.i: 195 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/main.cpp.i 196 | .PHONY : src/main.cpp.i 197 | 198 | src/main.s: src/main.cpp.s 199 | 200 | .PHONY : src/main.s 201 | 202 | # target to generate assembly for a file 203 | src/main.cpp.s: 204 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/main.cpp.s 205 | .PHONY : src/main.cpp.s 206 | 207 | src/oyyphash.o: src/oyyphash.cpp.o 208 | 209 | .PHONY : src/oyyphash.o 210 | 211 | # target to build an object file 212 | src/oyyphash.cpp.o: 213 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o 214 | .PHONY : src/oyyphash.cpp.o 215 | 216 | src/oyyphash.i: src/oyyphash.cpp.i 217 | 218 | .PHONY : src/oyyphash.i 219 | 220 | # target to preprocess a source file 221 | src/oyyphash.cpp.i: 222 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.i 223 | .PHONY : src/oyyphash.cpp.i 224 | 225 | src/oyyphash.s: src/oyyphash.cpp.s 226 | 227 | .PHONY : src/oyyphash.s 228 | 229 | # target to generate assembly for a file 230 | src/oyyphash.cpp.s: 231 | $(MAKE) -f CMakeFiles/YatSearchEngine.dir/build.make CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.s 232 | .PHONY : src/oyyphash.cpp.s 233 | 234 | # Help Target 235 | help: 236 | @echo "The following are some of the valid targets for this Makefile:" 237 | @echo "... all (the default if no target is provided)" 238 | @echo "... clean" 239 | @echo "... depend" 240 | @echo "... rebuild_cache" 241 | @echo "... edit_cache" 242 | @echo "... YatSearchEngine" 243 | @echo "... src/RegexSearch.o" 244 | @echo "... src/RegexSearch.i" 245 | @echo "... src/RegexSearch.s" 246 | @echo "... src/TextSearchEngine.o" 247 | @echo "... src/TextSearchEngine.i" 248 | @echo "... src/TextSearchEngine.s" 249 | @echo "... src/main.o" 250 | @echo "... src/main.i" 251 | @echo "... src/main.s" 252 | @echo "... src/oyyphash.o" 253 | @echo "... src/oyyphash.i" 254 | @echo "... src/oyyphash.s" 255 | .PHONY : help 256 | 257 | 258 | 259 | #============================================================================= 260 | # Special targets to cleanup operation of make. 261 | 262 | # Special rule to run CMake to check the build system integrity. 263 | # No rule that depends on this can have commands that come from listfiles 264 | # because they might be regenerated. 265 | cmake_check_build_system: 266 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 267 | .PHONY : cmake_check_build_system 268 | 269 | -------------------------------------------------------------------------------- /build/YatSearchEngine: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/build/YatSearchEngine -------------------------------------------------------------------------------- /build/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /workspaces/Yat-Search-Engine 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | if(CMAKE_INSTALL_COMPONENT) 41 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 42 | else() 43 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 44 | endif() 45 | 46 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 47 | "${CMAKE_INSTALL_MANIFEST_FILES}") 48 | file(WRITE "/workspaces/Yat-Search-Engine/build/${CMAKE_INSTALL_MANIFEST}" 49 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 50 | -------------------------------------------------------------------------------- /build/compile_commands.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "directory": "/workspaces/Yat-Search-Engine/build", 4 | "command": "/usr/bin/g++ -I/workspaces/Yat-Search-Engine/include -g -std=gnu++17 -o CMakeFiles/YatSearchEngine.dir/src/main.cpp.o -c /workspaces/Yat-Search-Engine/src/main.cpp", 5 | "file": "/workspaces/Yat-Search-Engine/src/main.cpp" 6 | }, 7 | { 8 | "directory": "/workspaces/Yat-Search-Engine/build", 9 | "command": "/usr/bin/g++ -I/workspaces/Yat-Search-Engine/include -g -std=gnu++17 -o CMakeFiles/YatSearchEngine.dir/src/TextSearchEngine.cpp.o -c /workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp", 10 | "file": "/workspaces/Yat-Search-Engine/src/TextSearchEngine.cpp" 11 | }, 12 | { 13 | "directory": "/workspaces/Yat-Search-Engine/build", 14 | "command": "/usr/bin/g++ -I/workspaces/Yat-Search-Engine/include -g -std=gnu++17 -o CMakeFiles/YatSearchEngine.dir/src/RegexSearch.cpp.o -c /workspaces/Yat-Search-Engine/src/RegexSearch.cpp", 15 | "file": "/workspaces/Yat-Search-Engine/src/RegexSearch.cpp" 16 | }, 17 | { 18 | "directory": "/workspaces/Yat-Search-Engine/build", 19 | "command": "/usr/bin/g++ -I/workspaces/Yat-Search-Engine/include -g -std=gnu++17 -o CMakeFiles/YatSearchEngine.dir/src/oyyphash.cpp.o -c /workspaces/Yat-Search-Engine/src/oyyphash.cpp", 20 | "file": "/workspaces/Yat-Search-Engine/src/oyyphash.cpp" 21 | } 22 | ] -------------------------------------------------------------------------------- /dat/index.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/dat/index.dat -------------------------------------------------------------------------------- /include/RegexSearch.h: -------------------------------------------------------------------------------- 1 | #ifndef REGEXSEARCH_H 2 | #define REGEXSEARCH_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | // 由于正则比较特殊,所以我把它分开来写,但在尝试写了之后发现比想象的简单些 12 | class RegexSearch 13 | { 14 | public: 15 | // 构造函数 16 | RegexSearch(){ 17 | try 18 | { 19 | std::locale::global(std::locale("zh_CN.UTF-8")); 20 | } 21 | catch (const std::runtime_error &e) 22 | { 23 | std::cerr << "无法设置区域设置 zh_CN.UTF-8: " << e.what() << std::endl; 24 | // 处理错误,例如设置为默认区域设置或退出程序 25 | std::locale::global(std::locale("")); 26 | } 27 | } 28 | // 正则查询 29 | static void regexQuery(const std::vector &sentences, const std::string &pattern); 30 | // 中文正则查询 31 | static void chineseRegexQuery(const std::vector &sentences, const std::string &pattern); 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/TextSearchEngine.h: -------------------------------------------------------------------------------- 1 | #ifndef TEXTSEARCHENGINE_H 2 | #define TEXTSEARCHENGINE_H 3 | 4 | #include 5 | #include 6 | // #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "oyyphash.h" 13 | 14 | // struct oyypHash 15 | // { 16 | // size_t operator()(const std::string &key) const 17 | // { 18 | // // 我在网上查到这个 FNV-1a 哈希算法分布均匀,冲突率低,并且计算速度快 19 | // const size_t fnv_prime = 0x100000001b3; 20 | // const size_t fnv_offset_basis = 0xcbf29ce484222325; 21 | // size_t hash = fnv_offset_basis; 22 | // for (char c : key) 23 | // { 24 | // hash ^= static_cast(c); 25 | // hash *= fnv_prime; 26 | // } 27 | // return hash; 28 | // } 29 | // }; 30 | 31 | class TextSearchEngine 32 | { 33 | public: 34 | TextSearchEngine(){ 35 | try 36 | { 37 | std::locale::global(std::locale("zh_CN.UTF-8")); 38 | } 39 | catch (const std::runtime_error &e) 40 | { 41 | std::cerr << "无法设置区域设置 zh_CN.UTF-8: " << e.what() << std::endl; 42 | // 处理错误,例如设置为默认区域设置或退出程序 43 | std::locale::global(std::locale("")); 44 | } 45 | } 46 | // 加载文本文件 47 | void loadTexts(const std::vector &files); 48 | // 精确查询 49 | void exactQuery(const std::string &keyword); 50 | // 模糊查询 51 | void fuzzyQuery(const std::string &keyword); 52 | // 正则表达式查询(现在已经单独开了一个文件) 53 | // void regexQuery(const std::string &pattern); 54 | // 中文查询 55 | void chineseQuery(const std::string &keyword); 56 | // 获取句子 57 | const std::vector &getSentences() const; 58 | // 持久化存储 59 | void saveIndex(const std::string &filename); 60 | void loadIndex(const std::string &filepath); 61 | 62 | private: 63 | // 句子集合 64 | std::vector sentences; 65 | // 使用自定义哈希函数 66 | // std::unordered_map, oyypHash> exactIndex; // 才知道这个哈希函数自定义是这样使用,放在第三个参数中 67 | 68 | // 自定义哈希表oyyphash 69 | HashTable exactIndex; 70 | 71 | 72 | // 索引句子 73 | // void indexSentence(const std::string &sentence); 74 | // 可视化匹配(但是有一部分现在直接挪到查找函数里面去了) 75 | // void visualizeMatch(const std::string &sentence, const std::string &keyword); 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /include/oyyphash.h: -------------------------------------------------------------------------------- 1 | #ifndef OYYPHASH_H 2 | #define OYYPHASH_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | struct oyypHash 9 | { 10 | size_t operator()(std::string &key) const 11 | { 12 | // 我在网上查到这个 FNV-1a 哈希算法分布均匀冲突率低,并且计算速度快 13 | const size_t fnv_prime = 0x100000001b3; 14 | const size_t fnv_offset_basis = 0xcbf29ce484222325; 15 | size_t hash = fnv_offset_basis; 16 | for (char c : key) 17 | { 18 | hash ^= static_cast(c); 19 | hash *= fnv_prime; 20 | } 21 | return hash; 22 | } 23 | }; 24 | 25 | class HashTable { 26 | public: 27 | HashTable(size_t size = 102400); // 默认大小102400 28 | // void insert(std::string &key, size_t value); 29 | // std::vector find(std::string &key) const; 30 | // void remove(std::string &key, size_t value); 31 | // 这几个函数是之前的,因为tse文件里面已经改啦,所以这里已经用不着了 32 | 33 | // 要把原先在unordered_map里面用到过的函数全都实现一遍 34 | size_t size() const; 35 | void clear(); 36 | std::vector& operator[](std::string &key); 37 | 38 | // 这个是全部里面最麻烦的部分 去网上查了很久才搞懂咋自定义 39 | // 迭代器在原本unordered_map里面被使用的情况比我想的还要多 40 | // 我甚至写tse文件的时候都没意识到for循环里面auto迭代就是用的迭代器 41 | // 并里面必须实现begin和end函数 不然没法自动然后 42 | class iterator { 43 | public: 44 | // 构造函数 45 | iterator(HashTable* table, size_t bucket, size_t index); 46 | 47 | // 解引用操作 这个在精确查询里面用到了 48 | std::pair>& operator*() const; 49 | std::pair>* operator->() const; 50 | 51 | // 递增操作 其实好像原本代码没有用到 我记得用到的是regex里面那个自增 52 | iterator& operator++(); 53 | iterator operator++(int); 54 | 55 | // 比较操作 56 | bool operator==(const iterator& other) const; 57 | bool operator!=(const iterator& other) const; 58 | 59 | private: 60 | HashTable* table; 61 | size_t current_bucket; 62 | size_t current_index; 63 | void advance(); 64 | }; 65 | 66 | // 这是自动for的时候用到的 67 | iterator begin(); 68 | iterator end(); 69 | 70 | private: 71 | std::vector>>> table; 72 | // 这里改了很多遍 因为它本身应该是一个pair从string映射到vector的 但是因为它每一个key对应的位置会有很多个 这时我本来就要把它给输出出来 所以不如直接变成一个vector再for迭代一次(参考tse) 73 | // 最外层的vector是用来处理哈希冲突的 74 | oyypHash hasher; // 自定义哈希函数 75 | size_t bucket_count; // 跟踪桶数量 76 | size_t element_count; // 跟踪元素数量 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /log/query_log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/log/query_log.txt -------------------------------------------------------------------------------- /logo_pic/Nobg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/logo_pic/Nobg.png -------------------------------------------------------------------------------- /logo_pic/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ouyangyipeng/Yat-Search-Engine/44c1f929c31338684e647db2dfc976e4abff8c83/logo_pic/logo.png -------------------------------------------------------------------------------- /logo_pic/logo.txt: -------------------------------------------------------------------------------- 1 | 2 | __ __ __ ______ __ 3 | / \ / | / | / \ / | 4 | $$ \ /$$/______ _$$ |_ /$$$$$$ | ______ ______ ______ _______ $$ |____ 5 | $$ \/$$// \ / $$ | $$ \__$$/ / \ / \ / \ / |$$ \ 6 | $$ $$/ $$$$$$ |$$$$$$/ $$ \ /$$$$$$ | $$$$$$ |/$$$$$$ |/$$$$$$$/ $$$$$$$ | 7 | $$$$/ / $$ | $$ | __ $$$$$$ |$$ $$ | / $$ |$$ | $$/ $$ | $$ | $$ | 8 | $$ | /$$$$$$$ | $$ |/ | / \__$$ |$$$$$$$$/ /$$$$$$$ |$$ | $$ \_____ $$ | $$ | 9 | $$ | $$ $$ | $$ $$/ $$ $$/ $$ |$$ $$ |$$ | $$ |$$ | $$ | 10 | $$/ $$$$$$$/ $$$$/ $$$$$$/ $$$$$$$/ $$$$$$$/ $$/ $$$$$$$/ $$/ $$/ 11 | 12 | 13 | 14 | ________ __ 15 | / | / | 16 | $$$$$$$$/ _______ ______ $$/ _______ ______ 17 | $$ |__ / \ / \ / |/ \ / \ 18 | $$ | $$$$$$$ |/$$$$$$ |$$ |$$$$$$$ |/$$$$$$ | 19 | $$$$$/ $$ | $$ |$$ | $$ |$$ |$$ | $$ |$$ $$ | 20 | $$ |_____ $$ | $$ |$$ \__$$ |$$ |$$ | $$ |$$$$$$$$/ 21 | $$ |$$ | $$ |$$ $$ |$$ |$$ | $$ |$$ | 22 | $$$$$$$$/ $$/ $$/ $$$$$$$ |$$/ $$/ $$/ $$$$$$$/ 23 | / \__$$ | 24 | $$ $$/ 25 | $$$$$$/ 26 | 27 | 28 | 29 | _ _ __ ____ ___ ____ __ ____ ___ _ _ 30 | ( \/ ) /__\ (_ _) / __)( ___) /__\ ( _ \ / __)( )_( ) 31 | \ / /(__)\ )( \__ \ )__) /(__)\ ) /( (__ ) _ ( 32 | (__)(__)(__)(__) (___/(____)(__)(__)(_)\_) \___)(_) (_) 33 | ____ _ _ ___ ____ _ _ ____ 34 | ( ___)( \( )/ __)(_ _)( \( )( ___) 35 | )__) ) (( (_-. _)(_ ) ( )__) 36 | (____)(_)\_)\___/(____)(_)\_)(____) 37 | 38 | 39 | 40 | .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. 41 | | .--------------. || .--------------. || .--------------. | | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | 42 | | | ____ ____ | || | __ | || | _________ | | | | _______ | || | _________ | || | __ | || | _______ | || | ______ | || | ____ ____ | | 43 | | | |_ _||_ _| | || | / \ | || | | _ _ | | | | | / ___ | | || | |_ ___ | | || | / \ | || | |_ __ \ | || | .' ___ | | || | |_ || _| | | 44 | | | \ \ / / | || | / /\ \ | || | |_/ | | \_| | | | | | (__ \_| | || | | |_ \_| | || | / /\ \ | || | | |__) | | || | / .' \_| | || | | |__| | | | 45 | | | \ \/ / | || | / ____ \ | || | | | | | | | '.___`-. | || | | _| _ | || | / ____ \ | || | | __ / | || | | | | || | | __ | | | 46 | | | _| |_ | || | _/ / \ \_ | || | _| |_ | | | | |`\____) | | || | _| |___/ | | || | _/ / \ \_ | || | _| | \ \_ | || | \ `.___.'\ | || | _| | | |_ | | 47 | | | |______| | || ||____| |____|| || | |_____| | | | | |_______.' | || | |_________| | || ||____| |____|| || | |____| |___| | || | `._____.' | || | |____||____| | | 48 | | | | || | | || | | | | | | || | | || | | || | | || | | || | | | 49 | | '--------------' || '--------------' || '--------------' | | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | 50 | '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' 51 | .----------------. .-----------------. .----------------. .----------------. .-----------------. .----------------. 52 | | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | 53 | | | _________ | || | ____ _____ | || | ______ | || | _____ | || | ____ _____ | || | _________ | | 54 | | | |_ ___ | | || ||_ \|_ _| | || | .' ___ | | || | |_ _| | || ||_ \|_ _| | || | |_ ___ | | | 55 | | | | |_ \_| | || | | \ | | | || | / .' \_| | || | | | | || | | \ | | | || | | |_ \_| | | 56 | | | | _| _ | || | | |\ \| | | || | | | ____ | || | | | | || | | |\ \| | | || | | _| _ | | 57 | | | _| |___/ | | || | _| |_\ |_ | || | \ `.___] _| | || | _| |_ | || | _| |_\ |_ | || | _| |___/ | | | 58 | | | |_________| | || ||_____|\____| | || | `._____.' | || | |_____| | || ||_____|\____| | || | |_________| | | 59 | | | | || | | || | | || | | || | | || | | | 60 | | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | 61 | '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' 62 | 63 | 64 | 65 | ____ __ ____ ,---------. .-'''-. .-''-. ____ .-------. _______ .---. .---. 66 | \ \ / /.' __ `.\ \ / _ \ .'_ _ \ .' __ `. | _ _ \ / __ \ | | |_ _| 67 | \ _. / '/ ' \ \`--. ,---' (`' )/`--' / ( ` ) '/ ' \ \| ( ' ) | | ,_/ \__) | | ( ' ) 68 | _( )_ .' |___| / | | \ (_ o _). . (_ o _) ||___| / ||(_ o _) / ,-./ ) | '-(_{;}_) 69 | ___(_ o _)' _.-` | :_ _: (_,_). '. | (_,_)___| _.-` || (_,_).' __ \ '_ '`) | (_,_) 70 | | |(_,_)' .' _ | (_I_) .---. \ :' \ .---..' _ || |\ \ | | > (_) ) __ | _ _--. | 71 | | `-' / | _( )_ | (_(=)_) \ `-' | \ `-' /| _( )_ || | \ `' /( . .-'_/ )|( ' ) | | 72 | \ / \ (_ o _) / (_I_) \ / \ / \ (_ o _) /| | \ / `-'`-' / (_{;}_)| | 73 | `-..-' '.(_,_).' '---' `-...-' `'-..-' '.(_,_).' ''-' `'-' `._____.' '(_,_) '---' 74 | .-''-. ,---. .--. .-_'''-. .-./`) ,---. .--. .-''-. 75 | .'_ _ \ | \ | | '_( )_ \ \ .-.')| \ | | .'_ _ \ 76 | / ( ` ) '| , \ | ||(_ o _)| '/ `-' \| , \ | | / ( ` ) ' 77 | . (_ o _) || |\_ \| |. (_,_)/___| `-'`"`| |\_ \| |. (_ o _) | 78 | | (_,_)___|| _( )_\ || | .-----..---. | _( )_\ || (_,_)___| 79 | ' \ .---.| (_ o _) |' \ '- .'| | | (_ o _) |' \ .---. 80 | \ `-' /| (_,_)\ | \ `-'` | | | | (_,_)\ | \ `-' / 81 | \ / | | | | \ / | | | | | | \ / 82 | `'-..-' '--' '--' `'-...-' '---' '--' '--' `'-..-' 83 | 84 | 85 | _____.___. __ _________ .__ 86 | \__ | |____ _/ |_ / _____/ ____ _____ _______ ____ | |__ 87 | / | \__ \\ __\ \_____ \_/ __ \\__ \\_ __ \_/ ___\| | \ 88 | \____ |/ __ \| | / \ ___/ / __ \| | \/\ \___| Y \ 89 | / ______(____ /__| /_______ /\___ >____ /__| \___ >___| / 90 | \/ \/ \/ \/ \/ \/ \/ 91 | ___________ .__ 92 | \_ _____/ ____ ____ |__| ____ ____ 93 | | __)_ / \ / ___\| |/ \_/ __ \ 94 | | \ | \/ /_/ > | | \ ___/ 95 | /_______ /___| /\___ /|__|___| /\___ > 96 | \/ \//_____/ \/ \/ 97 | 98 | 99 | 100 | ▓██ ██▓ ▄▄▄ ▄▄▄█████▓ ██████ ▓█████ ▄▄▄ ██▀███ ▄████▄ ██░ ██ 101 | ▒██ ██▒▒████▄ ▓ ██▒ ▓▒ ▒██ ▒ ▓█ ▀▒████▄ ▓██ ▒ ██▒▒██▀ ▀█ ▓██░ ██▒ 102 | ▒██ ██░▒██ ▀█▄ ▒ ▓██░ ▒░ ░ ▓██▄ ▒███ ▒██ ▀█▄ ▓██ ░▄█ ▒▒▓█ ▄ ▒██▀▀██░ 103 | ░ ▐██▓░░██▄▄▄▄██░ ▓██▓ ░ ▒ ██▒▒▓█ ▄░██▄▄▄▄██ ▒██▀▀█▄ ▒▓▓▄ ▄██▒░▓█ ░██ 104 | ░ ██▒▓░ ▓█ ▓██▒ ▒██▒ ░ ▒██████▒▒░▒████▒▓█ ▓██▒░██▓ ▒██▒▒ ▓███▀ ░░▓█▒░██▓ 105 | ██▒▒▒ ▒▒ ▓▒█░ ▒ ░░ ▒ ▒▓▒ ▒ ░░░ ▒░ ░▒▒ ▓▒█░░ ▒▓ ░▒▓░░ ░▒ ▒ ░ ▒ ░░▒░▒ 106 | ▓██ ░▒░ ▒ ▒▒ ░ ░ ░ ░▒ ░ ░ ░ ░ ░ ▒ ▒▒ ░ ░▒ ░ ▒░ ░ ▒ ▒ ░▒░ ░ 107 | ▒ ▒ ░░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░░ ░ 108 | ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ 109 | ░ ░ ░ 110 | ▓█████ ███▄ █ ▄████ ██▓ ███▄ █ ▓█████ 111 | ▓█ ▀ ██ ▀█ █ ██▒ ▀█▒▓██▒ ██ ▀█ █ ▓█ ▀ 112 | ▒███ ▓██ ▀█ ██▒▒██░▄▄▄░▒██▒▓██ ▀█ ██▒▒███ 113 | ▒▓█ ▄ ▓██▒ ▐▌██▒░▓█ ██▓░██░▓██▒ ▐▌██▒▒▓█ ▄ 114 | ░▒████▒▒██░ ▓██░░▒▓███▀▒░██░▒██░ ▓██░░▒████▒ 115 | ░░ ▒░ ░░ ▒░ ▒ ▒ ░▒ ▒ ░▓ ░ ▒░ ▒ ▒ ░░ ▒░ ░ 116 | ░ ░ ░░ ░░ ░ ▒░ ░ ░ ▒ ░░ ░░ ░ ▒░ ░ ░ ░ 117 | ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ 118 | ░ ░ ░ ░ ░ ░ ░ ░ 119 | 120 | 121 | __ _ ______ _______ ______ ______ ______ ______ ______ _ _ 122 | \ \ | | | | | | | | / | | | | | | | | | | \ | | | | | | 123 | \_\_| | | |__| | | | '------. | |---- | |__| | | |__| | | | | |--| | 124 | ____|_| |_| |_| |_| ____|_/ |_|____ |_| |_| |_| \_\ |_|____ |_| |_| 125 | 126 | ______ ______ ______ _____ ______ ______ 127 | | | | | \ \ | | ____ | | | | \ \ | | 128 | | |---- | | | | | | | | | | | | | | | |---- 129 | |_|____ |_| |_| |_|__|_| _|_|_ |_| |_| |_|____ 130 | 131 | -------------------------------------------------------------------------------- /logo_pic/logo_out.txt: -------------------------------------------------------------------------------- 1 | _____.___. __ _________ .__ 2 | \__ | |____ _/ |_ / _____/ ____ _____ _______ ____ | |__ 3 | / | \__ \\ __\ \_____ \_/ __ \\__ \\_ __ \_/ ___\| | \ 4 | \____ |/ __ \| | ______\ \ ___/ / __ \| | \/\ \___| Y \ 5 | / ______/\___ /__| /_______ /\___ \ \___ |__| \___ >___| / 6 | \/ \/ \/ \/ \/ \/ \/ 7 | ___________ .__ 8 | \_ _____/ ____ ____ |__| ____ ____ 9 | | __)_ / \ / ___\| |/ \_/ __ \ 10 | | ____\ | \/ /_/ > | | \ ___/ 11 | /_______ /\__| /\___ /|__|___| /\___ > 12 | \/ \//_____/ \/ \/ -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Logo 2 | 3 | # Yat-Search Engine 文本搜索引擎 4 | 5 | > *Searching Engine from Sun Yat-sen University* 6 | 7 | [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ouyangyipeng/Yat-Search-Engine/blob/main/LICENSE) 8 | ![Static Badge](https://img.shields.io/badge/Sun_Yat_sen-University-green) 9 | ![Static Badge](https://img.shields.io/badge/Ouyang-Yipeng-blue) 10 | [![Stars](https://img.shields.io/github/stars/ouyangyipeng/Yat-Search-Engine)](https://github.com/ouyangyipeng/Yat-Search-Engine/stargazers) 11 | [![Code Size](https://img.shields.io/github/languages/code-size/ouyangyipeng/Yat-Search-Engine)](https://github.com/ouyangyipeng/Yat-Search-Engine) 12 | [![Top Language](https://img.shields.io/github/languages/top/ouyangyipeng/Yat-Search-Engine)](https://github.com/ouyangyipeng/Yat-Search-Engine) 13 | [![Last Commit](https://img.shields.io/github/last-commit/ouyangyipeng/Yat-Search-Engine)](https://github.com/ouyangyipeng/Yat-Search-Engine/commits/main) 14 | 15 | ## 项目简介 16 | 17 | Yat-Search Engine 是一个高效的文本搜索引擎,支持多文件加载、精确查询、模糊查询和正则表达式查询等功能。该项目旨在提供快速、准确的文本搜索解决方案,并具备持久化存储和日志记录功能,支持中文界面、中文文档查询。 18 | 19 | 需要注意的是,由于c++本身对于中文的兼容性较差(尤其是**非**linux/unix环境),目前中文搜索通过两个单独的中文查询函数实现,并且需要在linux环境进行相关配置,下文会详细介绍。 20 | 21 | 本项目仅供学习交流使用,请勿用于其他用途。原作者对于使用本项目所产生的任何后果概不负责。 22 | 23 | 当前版本仍在开发中,部分功能可能尚未完全实现。欢迎贡献代码和提出建议! 24 | 25 | ## 项目背景 26 | 27 | 中山大学计算机学院2024年秋季学期《数据结构与算法》课程大作业。 28 | 29 | 当前版本:v1.6.1 最新 /12.15(文件重用与自定义哈希) 30 | 31 | ## 功能列表 32 | 33 | - **多文件支持**:可加载多个文本文件进行搜索。 34 | - **精确查询**:查找精确匹配的关键词。 35 | - **模糊查询**:查找包含关键词的单词。 36 | - **正则表达式查询**:基于正则表达式的高级搜索。 37 | - **可视化搜索结果**:以类似编译器报错的方式展示匹配位置。 38 | - **无限查询与退出功能**:支持持续查询,用户可随时退出。 39 | - **持久化存储**:保存和加载搜索索引。 40 | - **日志功能**:记录查询历史和操作日志。 41 | - **支持中文输出**:在linux环境下正确查找中文字符。 42 | - **编译方法由.vscode改为cmake**:方便跨平台编译。 43 | - **输入all添加全部文件**:输入all可以加载所有文件。 44 | - **支持中文(完整版)**:支持中文文档的模糊查询。 45 | - **支持中文(函数版)**:将中文搜索功能封装为函数。 46 | - **新的哈希函数**:优化哈希冲突处理效率。 47 | - **性能优化与预处理**:减少搜索时间,提高查询性能。 48 | - **用户界面**:设计简洁直观的命令行界面。 49 | - **可选择是否使用以前的索引**:在加载文件时,可以选择是否使用以前的索引,从而不需要重新构建索引。 50 | 51 | ## 项目结构 52 | 53 | ```plaintext 54 | 55 | └──Yat-Search-Engine 56 | ├── CMakeLists.txt 57 | ├── LICENSE 58 | ├── dat 59 | │ └── index.dat 60 | ├── include 61 | │ ├── RegexSearch.h 62 | │ ├── oyyphash.h **(new in current version)** 63 | │ └── TextSearchEngine.h 64 | ├── log 65 | │ └── query_log.txt 66 | ├── logo_pic 67 | │ ├── logo.txt 68 | │ ├── logo.png 69 | │ ├── Nobg.png 70 | │ └── logo_out.txt 71 | ├── readme.md 72 | ├── source-text 73 | │ ├── bible.txt 74 | │ ├── text1.txt 75 | │ ├── text2.txt 76 | │ └── otherfile... 77 | └── src 78 | ├── RegexSearch.cpp 79 | ├── TextSearchEngine.cpp 80 | ├── oyyphash.cpp **(new in current version)** 81 | └── main.cpp 82 | 余下.github .vscode和build文件夹等均为各个平台的工具文件,不在此列出 83 | ``` 84 | 85 | ## 功能改进过程(TODO) 86 | 87 | ### 基础功能 88 | 89 | 1. **哈希表包含查询** v1.0.0 90 | - **改进过程**:实现自定义哈希函数 `oyypHash`,并在 `TextSearchEngine` 中使用 `unordered_map` 结合该哈希函数,以优化查询性能。 91 | 92 | 2. **文件读取** v1.0.1 93 | - **改进过程**:完善文件读取机制,确保能够正确读取和解析多个文本文件,并将内容索引到搜索引擎中。 94 | 95 | ### 增添功能 96 | 97 | 1. **多文件支持** *(已完成)* v1.1.0 98 | - **改进过程**:修改 `main.cpp`,允许用户输入多个文件名,系统将逐一加载这些文件进行索引。 99 | 100 | 2. **支持正则表达** *(已完成)* v1.1.1 101 | - **改进过程**:新增 `RegexSearch` 类,使用 C++ `` 库实现基于正则表达式的查询功能,并在主菜单中添加相应选项。 102 | 103 | 3. **精确查询** *(已完成)* v1.1.2 104 | - **改进过程**:实现 `exactQuery` 方法,通过 `unordered_map` 高效查找精确匹配的关键词,并展示匹配结果。 105 | 106 | 4. **可视化搜索结果,如模仿编译器报错的方式** *(已完成)* v1.2.0 107 | - **改进过程**:在查询结果中,使用符号 `^` 标记关键词在句子中的位置,类似编译器的错误指示,增强可读性。 108 | - 但是目前只支持英文,中文会出现位置不准确的问题。 109 | 110 | 5. **无限查询,退出按钮** *(已完成)* v1.2.1 111 | - **改进过程**:在主循环中添加持续查询功能,用户可选择退出程序,确保用户体验的连贯性。 112 | 113 | 6. **新的哈希函数** *(已完成)* v1.3.1 114 | - **计划改进**:优化现有的 `CustomHash` 函数,提高哈希冲突的处理效率,以进一步提升查询性能。 115 | 116 | 7. **支持中文(简化版)** *(已完成)* v1.4.0 117 | - **计划改进**:扩展系统的本地化支持,添加多语言界面,提升中国用户的使用体验。但是由于正则表达式的限制,中文搜索仅可以通过“模糊搜索”选项完成,并且需要保证有"."符号于末尾。 118 | 119 | 8. **性能优化与预处理** *(已完成)* v1.3.1 120 | - **改进过程**:优化索引结构和查询算法,减少搜索时间,并在加载文本时进行预处理,如去除停用词和统一大小写。 121 | 122 | 9. **用户界面** *(已完成)* v1.2.2 123 | - **改进过程**:设计简洁直观的命令行界面,引导用户完成文件加载和查询操作。 124 | 125 | 10. **持久化存储** *(已完成)* v1.3.0 126 | - **改进过程**:实现索引的保存与加载功能,避免每次启动程序时重新构建索引,提升启动速度。 127 | 128 | 11. **日志功能,记录查询历史等** *(已完成)* v1.3.2 129 | - **改进过程**:在每次查询和重要操作后,将相关信息记录到 `query_log.txt`,便于用户查看历史记录和调试。 130 | 131 | 12. **支持中文输出** *(已完成)* v1.4.1 132 | - **改进过程**:设置本地化环境,确保程序能够正确处理和显示中文字符,提升中文用户的使用体验。 133 | 134 | 13. **编译方法由mingW改为cmake** *(已完成)* v1.4.0 135 | - **改进过程**:由于使用.vscode编译的限制性很大(例如我无法在codespace中编译),将编译方法由mingW改为cmake,方便跨平台编译。 136 | 137 | 14. **输入all添加全部文件** *(已完成)* v1.4.0 138 | - **改进过程**:在输入文件名时,输入all可以加载所有文件。 139 | 140 | 15. **支持中文(完整版)** *(已完成)* v1.5.0 12.11 141 | - **计划改进**:完善中文搜索功能,支持中文文档的模糊查询,提升中文用户的使用体验。 142 | 143 | 16. **支持中文(函数版)** *(已完成)* v1.5.1 12.12 144 | - **计划改进**:将中文搜索功能封装为函数,方便用户调用,提升代码的可读性和可维护性。 145 | 146 | 17. **新的哈希表** *(已完成)* v1.6.0 12.15 147 | - **计划改进**:去除对unordered map的依赖,自己写一个哈希表。优化哈希冲突处理效率,提高查询性能。 148 | 149 | 18. **可选择是否使用以前的索引** *(已完成)* v1.6.1 最新/12.15 150 | - **计划改进**:在加载文件时,可以选择是否使用以前的索引,从而不需要重新构建索引。 151 | 152 | ## 使用方法 153 | 154 | ### 克隆项目 155 | 156 | 请确保在linux环境下运行,windows环境下可能会出现中文乱码问题。进入工作目录并克隆项目到本地: 157 | 158 | ```bash 159 | git clone https://github.com/ouyangyipeng/Yat-Search-Engine.git 160 | cd Yat-Search-Engine 161 | ``` 162 | 163 | ### 设置中文环境 164 | 165 | 由于c++本身对于中文的兼容性较差,目前中文搜索在单独的中文搜索选项中,并且需要在linux环境进行相关配置。具体操作如下: 166 | 167 | 1. 检查系统是否支持中文环境: 168 | 169 | ```bash 170 | locale -a 171 | ``` 172 | 173 | 如果输出中包含 `zh_CN.UTF-8`,说明系统支持中文。否则,需要安装中文语言包。 174 | 175 | 2. 如果系统支持中文环境,可以直接运行程序。如果系统不支持,需要locale中文语言包: 176 | 177 | ```bash 178 | sudo locale-gen zh_CN.UTF-8 179 | sudo update-locale 180 | ``` 181 | 182 | 注意,当前本文默认使用utf8编码的中文,如果需要修改成gb2312或其他,请自行在源代码中的textsearchengine类的生成函数中改一下locale的设置。 183 | 184 | 3. 再次检查系统是否支持中文环境: 185 | 186 | ```bash 187 | locale -a 188 | ``` 189 | 190 | 如果输出中包含 `zh_CN.UTF-8`,说明生成中文环境成功。 191 | 192 | 如果前面已经进行过cmake,推荐先进行清理 193 | 194 | ```bash 195 | make clean 196 | ``` 197 | 198 | ### 推荐编译运行方法 - 使用Cmake编译 199 | 200 | 确保已安装 CMake 和支持 C++17 的编译器,如 `g++` 或 `clang++`。cmakelists.txt文件已经配置好了编译选项,只需执行以下命令即可编译项目。注意默认编译器位于`/usr/bin/g++`,如需使用其他编译器请修改CMakeLists.txt文件。 201 | 202 | ```bash 203 | mkdir build # 假如没有build文件夹 204 | cd build 205 | cmake .. 206 | cmake --build . 207 | ./YatSearchEngine 208 | ``` 209 | 210 | 如果需要重新编译,只需执行 `cmake --build .` 即可。 211 | 212 | ### 运行程序 213 | 214 | 将需要搜索的文本文件放入 source-text 文件夹中,确保文件以 .txt 格式保存。注意中文文件请以UTF8格式保存,或者如果你更改了源码,那就按你指定的中文编码格式进行保存。 215 | 216 | 在vscode环境下,在txt文件界面,右下角会有一个地方写着编码类型,点他然后按照指示改保存编码就行了。 217 | 218 | 在记事本环境下,点另存为,然后有个地方选编码格式的。 219 | 220 | ### 操作步骤 221 | 222 | 启动程序:运行可执行文件后,程序将显示欢迎界面并提示按回车继续。 223 | 224 | 选择是否使用以前的索引:输入 y 使用以前的索引,输入 n 重新构建索引。 225 | 226 | *加载文件:如果重新加载文件,可以根据提示输入要加载的文件,每次输入一个文件名(需以 .txt 结尾),输入 done 完成文件选择。 227 | 228 | 选择查询类型: 229 | 230 | 输入 1 进行精确查询。 231 | 232 | 输入 2 进行模糊查询。 233 | 234 | 输入 3 进行正则表达式查询。 235 | 236 | 输入 4 进行中文模糊查询。 237 | 238 | 输入 5 进行中文正则查询。 239 | 240 | 输入 6 退出程序。 241 | 242 | 输入查询内容:根据选择的查询类型,输入相应的关键词或正则表达式。 243 | 244 | 查看结果:查询结果将显示匹配的句子及其位置标记。 245 | 246 | 退出程序:选择退出选项,程序将保存索引并记录日志后退出。 247 | 248 | ### 日志查看 249 | 250 | 查询操作日志保存在 query_log.txt 文件中,用户可通过文本编辑器查看历史查询记录和操作日志。 251 | 252 | ## 贡献 253 | 254 | 欢迎贡献代码和提出建议!请提交 Pull Request 或在 Issues 中反馈您的想法。 255 | 256 | 257 | 258 | 259 | 260 | ## 许可证 261 | 262 | 本项目采用 MIT 许可证。详情请参阅 LICENSE 文件。 263 | -------------------------------------------------------------------------------- /source-text/text1.txt: -------------------------------------------------------------------------------- 1 | In the beginning God created the heaven and the earth. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. And God said, Let there be light: and there was light. 2 | -------------------------------------------------------------------------------- /source-text/text2.txt: -------------------------------------------------------------------------------- 1 | In the beginning God created the heaven and the earth. And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. And God said, Let there be light: and there was light. 2 | -------------------------------------------------------------------------------- /source-text/中国共产党章程.txt: -------------------------------------------------------------------------------- 1 | 《中国共产党章程》 2 | 中国共产党第二十次全国代表大会部分修改,2022年10月22日通过 3 | 来源:共产党员网 4 | 总 纲 5 |   中国共产党是中国工人阶级的先锋队,同时是中国人民和中华民族的先锋队,是中国特色社会主义事业的领导核心,代表中国先进生产力的发展要求,代表中国先进文化的前进方向,代表中国最广大人民的根本利益。党的最高理想和最终目标是实现共产主义。 6 |   中国共产党以马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想、科学发展观、习近平新时代中国特色社会主义思想作为自己的行动指南。 7 |   马克思列宁主义揭示了人类社会历史发展的规律,它的基本原理是正确的,具有强大的生命力。中国共产党人追求的共产主义最高理想,只有在社会主义社会充分发展和高度发达的基础上才能实现。社会主义制度的发展和完善是一个长期的历史过程。坚持马克思列宁主义的基本原理,走中国人民自愿选择的适合中国国情的道路,中国的社会主义事业必将取得最终的胜利。 8 |   以毛泽东同志为主要代表的中国共产党人,把马克思列宁主义的基本原理同中国革命的具体实践结合起来,创立了毛泽东思想。毛泽东思想是马克思列宁主义在中国的运用和发展,是被实践证明了的关于中国革命和建设的正确的理论原则和经验总结,是中国共产党集体智慧的结晶。在毛泽东思想指引下,中国共产党领导全国各族人民,经过长期的反对帝国主义、封建主义、官僚资本主义的革命斗争,取得了新民主主义革命的胜利,建立了人民民主专政的中华人民共和国;新中国成立以后,顺利地进行了社会主义改造,完成了从新民主主义到社会主义的过渡,确立了社会主义基本制度,发展了社会主义的经济、政治和文化。 9 |   十一届三中全会以来,以邓小平同志为主要代表的中国共产党人,总结新中国成立以来正反两方面的经验,解放思想,实事求是,实现全党工作中心向经济建设的转移,实行改革开放,开辟了社会主义事业发展的新时期,逐步形成了建设中国特色社会主义的路线、方针、政策,阐明了在中国建设社会主义、巩固和发展社会主义的基本问题,创立了邓小平理论。邓小平理论是马克思列宁主义的基本原理同当代中国实践和时代特征相结合的产物,是毛泽东思想在新的历史条件下的继承和发展,是马克思主义在中国发展的新阶段,是当代中国的马克思主义,是中国共产党集体智慧的结晶,引导着我国社会主义现代化事业不断前进。 10 |   十三届四中全会以来,以江泽民同志为主要代表的中国共产党人,在建设中国特色社会主义的实践中,加深了对什么是社会主义、怎样建设社会主义和建设什么样的党、怎样建设党的认识,积累了治党治国新的宝贵经验,形成了“三个代表”重要思想。“三个代表”重要思想是对马克思列宁主义、毛泽东思想、邓小平理论的继承和发展,反映了当代世界和中国的发展变化对党和国家工作的新要求,是加强和改进党的建设、推进我国社会主义自我完善和发展的强大理论武器,是中国共产党集体智慧的结晶,是党必须长期坚持的指导思想。始终做到“三个代表”,是我们党的立党之本、执政之基、力量之源。 11 |   十六大以来,以胡锦涛同志为主要代表的中国共产党人,坚持以邓小平理论和“三个代表”重要思想为指导,根据新的发展要求,深刻认识和回答了新形势下实现什么样的发展、怎样发展等重大问题,形成了以人为本、全面协调可持续发展的科学发展观。科学发展观是同马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想既一脉相承又与时俱进的科学理论,是马克思主义关于发展的世界观和方法论的集中体现,是马克思主义中国化重大成果,是中国共产党集体智慧的结晶,是发展中国特色社会主义必须长期坚持的指导思想。 12 |   十八大以来,以习近平同志为主要代表的中国共产党人,坚持把马克思主义基本原理同中国具体实际相结合、同中华优秀传统文化相结合,科学回答了新时代坚持和发展什么样的中国特色社会主义、怎样坚持和发展中国特色社会主义等重大时代课题,创立了习近平新时代中国特色社会主义思想。习近平新时代中国特色社会主义思想是对马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想、科学发展观的继承和发展,是当代中国马克思主义、二十一世纪马克思主义,是中华文化和中国精神的时代精华,是党和人民实践经验和集体智慧的结晶,是中国特色社会主义理论体系的重要组成部分,是全党全国人民为实现中华民族伟大复兴而奋斗的行动指南,必须长期坚持并不断发展。在习近平新时代中国特色社会主义思想指导下,中国共产党领导全国各族人民,统揽伟大斗争、伟大工程、伟大事业、伟大梦想,推动中国特色社会主义进入了新时代,实现第一个百年奋斗目标,开启了实现第二个百年奋斗目标新征程。 13 |   改革开放以来我们取得一切成绩和进步的根本原因,归结起来就是:开辟了中国特色社会主义道路,形成了中国特色社会主义理论体系,确立了中国特色社会主义制度,发展了中国特色社会主义文化。全党同志要倍加珍惜、长期坚持和不断发展党历经艰辛开创的这条道路、这个理论体系、这个制度、这个文化,高举中国特色社会主义伟大旗帜,坚定道路自信、理论自信、制度自信、文化自信,发扬斗争精神,增强斗争本领,贯彻党的基本理论、基本路线、基本方略,为实现推进现代化建设、完成祖国统一、维护世界和平与促进共同发展这三大历史任务,实现第二个百年奋斗目标、实现中华民族伟大复兴的中国梦而奋斗。 14 |   中国共产党自成立以来,始终把为中国人民谋幸福、为中华民族谋复兴作为自己的初心使命,历经百年奋斗,从根本上改变了中国人民的前途命运,开辟了实现中华民族伟大复兴的正确道路,展示了马克思主义的强大生命力,深刻影响了世界历史进程,锻造了走在时代前列的中国共产党。经过长期实践,积累了坚持党的领导、坚持人民至上、坚持理论创新、坚持独立自主、坚持中国道路、坚持胸怀天下、坚持开拓创新、坚持敢于斗争、坚持统一战线、坚持自我革命的宝贵历史经验,这是党和人民共同创造的精神财富,必须倍加珍惜、长期坚持,并在实践中不断丰富和发展。 15 |   我国正处于并将长期处于社会主义初级阶段。这是在原本经济文化落后的中国建设社会主义现代化不可逾越的历史阶段,需要上百年的时间。我国的社会主义建设,必须从我国的国情出发,走中国特色社会主义道路,以中国式现代化全面推进中华民族伟大复兴。在现阶段,我国社会的主要矛盾是人民日益增长的美好生活需要和不平衡不充分的发展之间的矛盾。由于国内的因素和国际的影响,阶级斗争还在一定范围内长期存在,在某种条件下还有可能激化,但已经不是主要矛盾。我国社会主义建设的根本任务,是进一步解放生产力,发展生产力,逐步实现社会主义现代化,并且为此而改革生产关系和上层建筑中不适应生产力发展的方面和环节。必须坚持和完善公有制为主体、多种所有制经济共同发展,按劳分配为主体、多种分配方式并存,社会主义市场经济体制等基本经济制度,鼓励一部分地区和一部分人先富起来,逐步实现全体人民共同富裕,在生产发展和社会财富增长的基础上不断满足人民日益增长的美好生活需要,促进人的全面发展。发展是我们党执政兴国的第一要务。必须坚持以人民为中心的发展思想,把握新发展阶段,贯彻创新、协调、绿色、开放、共享的新发展理念,加快构建以国内大循环为主体、国内国际双循环相互促进的新发展格局,推动高质量发展。各项工作都要把有利于发展社会主义社会的生产力,有利于增强社会主义国家的综合国力,有利于提高人民的生活水平,作为总的出发点和检验标准,尊重劳动、尊重知识、尊重人才、尊重创造,做到发展为了人民、发展依靠人民、发展成果由人民共享。必须按照中国特色社会主义事业“五位一体”总体布局和“四个全面”战略布局,统筹推进经济建设、政治建设、文化建设、社会建设、生态文明建设,协调推进全面建设社会主义现代化国家、全面深化改革、全面依法治国、全面从严治党。新时代新征程,经济和社会发展的战略目标是,到二〇三五年基本实现社会主义现代化,到本世纪中叶把我国建成社会主义现代化强国。 16 |   中国共产党在社会主义初级阶段的基本路线是:领导和团结全国各族人民,以经济建设为中心,坚持四项基本原则,坚持改革开放,自力更生,艰苦创业,为把我国建设成为富强民主文明和谐美丽的社会主义现代化强国而奋斗。 17 |   中国共产党在领导社会主义事业中,必须坚持以经济建设为中心,其他各项工作都服从和服务于这个中心。要实施科教兴国战略、人才强国战略、创新驱动发展战略、乡村振兴战略、区域协调发展战略、可持续发展战略、军民融合发展战略,充分发挥科学技术作为第一生产力的作用,充分发挥人才作为第一资源的作用,充分发挥创新作为引领发展第一动力的作用,依靠科技进步,提高劳动者素质,促进国民经济更高质量、更有效率、更加公平、更可持续、更为安全发展。 18 |   坚持社会主义道路、坚持人民民主专政、坚持中国共产党的领导、坚持马克思列宁主义毛泽东思想这四项基本原则,是我们的立国之本。在社会主义现代化建设的整个过程中,必须坚持四项基本原则,反对资产阶级自由化。 19 |   坚持改革开放,是我们的强国之路。只有改革开放,才能发展中国、发展社会主义、发展马克思主义。要全面深化改革,完善和发展中国特色社会主义制度,推进国家治理体系和治理能力现代化。要从根本上改革束缚生产力发展的经济体制,坚持和完善社会主义市场经济体制;与此相适应,要进行政治体制改革和其他领域的改革。要坚持对外开放的基本国策,吸收和借鉴人类社会创造的一切文明成果。改革开放应当大胆探索,勇于开拓,提高改革决策的科学性,更加注重改革的系统性、整体性、协同性,在实践中开创新路。 20 |   中国共产党领导人民发展社会主义市场经济。毫不动摇地巩固和发展公有制经济,毫不动摇地鼓励、支持、引导非公有制经济发展。发挥市场在资源配置中的决定性作用,更好发挥政府作用,建立完善的宏观调控体系。统筹城乡发展、区域发展、经济社会发展、人与自然和谐发展、国内发展和对外开放,调整经济结构,转变经济发展方式,推进供给侧结构性改革。促进新型工业化、信息化、城镇化、农业现代化同步发展,建设社会主义新农村,走中国特色新型工业化道路,建设创新型国家和世界科技强国。 21 |   中国共产党领导人民发展社会主义民主政治。坚持党的领导、人民当家作主、依法治国有机统一,走中国特色社会主义政治发展道路、中国特色社会主义法治道路,扩大社会主义民主,建设中国特色社会主义法治体系,建设社会主义法治国家,巩固人民民主专政,建设社会主义政治文明。坚持和完善人民代表大会制度、中国共产党领导的多党合作和政治协商制度、民族区域自治制度以及基层群众自治制度。发展更加广泛、更加充分、更加健全的全过程人民民主,推进协商民主广泛多层制度化发展,切实保障人民管理国家事务和社会事务、管理经济和文化事业的权利。尊重和保障人权。广开言路,建立健全民主选举、民主协商、民主决策、民主管理、民主监督的制度和程序。完善中国特色社会主义法律体系,加强法律实施工作,实现国家各项工作法治化。 22 |   中国共产党领导人民发展社会主义先进文化。建设社会主义精神文明,实行依法治国和以德治国相结合,提高全民族的思想道德素质和科学文化素质,为改革开放和社会主义现代化建设提供强大的思想保证、精神动力和智力支持,建设社会主义文化强国。加强社会主义核心价值体系建设,坚持马克思主义指导思想,树立中国特色社会主义共同理想,弘扬以爱国主义为核心的民族精神和以改革创新为核心的时代精神,培育和践行社会主义核心价值观,倡导社会主义荣辱观,增强民族自尊、自信和自强精神,抵御资本主义和封建主义腐朽思想的侵蚀,扫除各种社会丑恶现象,努力使我国人民成为有理想、有道德、有文化、有纪律的人民。对党员要进行共产主义远大理想教育。大力发展教育、科学、文化事业,推动中华优秀传统文化创造性转化、创新性发展,继承革命文化,发展社会主义先进文化,提高国家文化软实力。牢牢掌握意识形态工作领导权,不断巩固马克思主义在意识形态领域的指导地位,巩固全党全国人民团结奋斗的共同思想基础。 23 |   中国共产党领导人民构建社会主义和谐社会。按照民主法治、公平正义、诚信友爱、充满活力、安定有序、人与自然和谐相处的总要求和共同建设、共同享有的原则,以保障和改善民生为重点,解决好人民最关心、最直接、最现实的利益问题,使发展成果更多更公平惠及全体人民,不断增强人民群众获得感,努力形成全体人民各尽其能、各得其所而又和谐相处的局面。加强和创新社会治理。严格区分和正确处理敌我矛盾和人民内部矛盾这两类不同性质的矛盾。加强社会治安综合治理,依法坚决打击各种危害国家安全和利益、危害社会稳定和经济发展的犯罪活动和犯罪分子,保持社会长期稳定。坚持总体国家安全观,统筹发展和安全,坚决维护国家主权、安全、发展利益。 24 |   中国共产党领导人民建设社会主义生态文明。树立尊重自然、顺应自然、保护自然的生态文明理念,增强绿水青山就是金山银山的意识,坚持节约资源和保护环境的基本国策,坚持节约优先、保护优先、自然恢复为主的方针,坚持生产发展、生活富裕、生态良好的文明发展道路。着力建设资源节约型、环境友好型社会,实行最严格的生态环境保护制度,形成节约资源和保护环境的空间格局、产业结构、生产方式、生活方式,为人民创造良好生产生活环境,实现中华民族永续发展。 25 |   中国共产党坚持对人民解放军和其他人民武装力量的绝对领导,贯彻习近平强军思想,加强人民解放军的建设,坚持政治建军、改革强军、科技强军、人才强军、依法治军,建设一支听党指挥、能打胜仗、作风优良的人民军队,把人民军队建设成为世界一流军队,切实保证人民解放军有效履行新时代军队使命任务,充分发挥人民解放军在巩固国防、保卫祖国和参加社会主义现代化建设中的作用。 26 |   中国共产党维护和发展平等团结互助和谐的社会主义民族关系,积极培养、选拔少数民族干部,帮助少数民族和民族地区发展经济、文化和社会事业,铸牢中华民族共同体意识,实现各民族共同团结奋斗、共同繁荣发展。全面贯彻党的宗教工作基本方针,团结信教群众为经济社会发展作贡献。 27 |   中国共产党同全国各民族工人、农民、知识分子团结在一起,同各民主党派、无党派人士、各民族的爱国力量团结在一起,进一步发展和壮大由全体社会主义劳动者、社会主义事业的建设者、拥护社会主义的爱国者、拥护祖国统一和致力于中华民族伟大复兴的爱国者组成的最广泛的爱国统一战线。不断加强全国人民包括香港特别行政区同胞、澳门特别行政区同胞、台湾同胞和海外侨胞的团结。全面准确、坚定不移贯彻“一个国家、两种制度”的方针,促进香港、澳门长期繁荣稳定,坚决反对和遏制“台独”,完成祖国统一大业。 28 |   中国共产党坚持独立自主的和平外交政策,坚持和平发展道路,坚持互利共赢的开放战略,统筹国内国际两个大局,积极发展对外关系,努力为我国的改革开放和现代化建设争取有利的国际环境。在国际事务中,弘扬和平、发展、公平、正义、民主、自由的全人类共同价值,坚持正确义利观,维护我国的独立和主权,反对霸权主义和强权政治,维护世界和平,促进人类进步,推动构建人类命运共同体,推动建设持久和平、普遍安全、共同繁荣、开放包容、清洁美丽的世界。在互相尊重主权和领土完整、互不侵犯、互不干涉内政、平等互利、和平共处五项原则的基础上,发展我国同世界各国的关系。不断发展我国同周边国家的睦邻友好关系,加强同发展中国家的团结与合作。遵循共商共建共享原则,推进“一带一路”建设。按照独立自主、完全平等、互相尊重、互不干涉内部事务的原则,发展我党同各国共产党和其他政党的关系。 29 |   中国共产党要领导全国各族人民实现第二个百年奋斗目标、实现中华民族伟大复兴的中国梦,必须紧密围绕党的基本路线,坚持和加强党的全面领导,坚持党要管党、全面从严治党,弘扬坚持真理、坚守理想,践行初心、担当使命,不怕牺牲、英勇斗争,对党忠诚、不负人民的伟大建党精神,加强党的长期执政能力建设、先进性和纯洁性建设,以改革创新精神全面推进党的建设新的伟大工程,以党的政治建设为统领,全面推进党的政治建设、思想建设、组织建设、作风建设、纪律建设,把制度建设贯穿其中,深入推进反腐败斗争,全面提高党的建设科学化水平,以伟大自我革命引领伟大社会革命。坚持立党为公、执政为民,发扬党的优良传统和作风,不断提高党的领导水平和执政水平,提高拒腐防变和抵御风险的能力,不断增强自我净化、自我完善、自我革新、自我提高能力,不断增强党的阶级基础和扩大党的群众基础,不断提高党的创造力、凝聚力、战斗力,建设学习型、服务型、创新型的马克思主义执政党,使我们党始终走在时代前列,成为领导全国人民沿着中国特色社会主义道路不断前进的坚强核心。党的建设必须坚决实现以下六项基本要求: 30 |   第一,坚持党的基本路线。全党要用邓小平理论、“三个代表”重要思想、科学发展观、习近平新时代中国特色社会主义思想和党的基本路线统一思想,统一行动,并且毫不动摇地长期坚持下去。必须把改革开放同四项基本原则统一起来,全面落实党的基本路线,反对一切“左”的和右的错误倾向,要警惕右,但主要是防止“左”。必须提高政治判断力、政治领悟力、政治执行力,增强贯彻落实党的理论和路线方针政策的自觉性和坚定性。 31 |   第二,坚持解放思想,实事求是,与时俱进,求真务实。党的思想路线是一切从实际出发,理论联系实际,实事求是,在实践中检验真理和发展真理。全党必须坚持这条思想路线,积极探索,大胆试验,开拓创新,创造性地开展工作,不断研究新情况,总结新经验,解决新问题,在实践中丰富和发展马克思主义,推进马克思主义中国化时代化。 32 |   第三,坚持新时代党的组织路线。全面贯彻习近平新时代中国特色社会主义思想,以组织体系建设为重点,着力培养忠诚干净担当的高素质干部,着力集聚爱国奉献的各方面优秀人才,坚持德才兼备、以德为先、任人唯贤,为坚持和加强党的全面领导、坚持和发展中国特色社会主义提供坚强组织保证。全党必须增强党组织的政治功能和组织功能,培养选拔党和人民需要的好干部,培养和造就大批堪当时代重任的社会主义事业接班人,聚天下英才而用之,从组织上保证党的基本理论、基本路线、基本方略的贯彻落实。 33 |   第四,坚持全心全意为人民服务。党除了工人阶级和最广大人民群众的利益,没有自己特殊的利益。党在任何时候都把群众利益放在第一位,同群众同甘共苦,保持最密切的联系,坚持权为民所用、情为民所系、利为民所谋,不允许任何党员脱离群众,凌驾于群众之上。我们党的最大政治优势是密切联系群众,党执政后的最大危险是脱离群众。党风问题、党同人民群众联系问题是关系党生死存亡的问题。党在自己的工作中实行群众路线,一切为了群众,一切依靠群众,从群众中来,到群众中去,把党的正确主张变为群众的自觉行动。 34 |   第五,坚持民主集中制。民主集中制是民主基础上的集中和集中指导下的民主相结合。它既是党的根本组织原则,也是群众路线在党的生活中的运用。必须充分发扬党内民主,尊重党员主体地位,保障党员民主权利,发挥各级党组织和广大党员的积极性创造性。必须实行正确的集中,牢固树立政治意识、大局意识、核心意识、看齐意识,坚定维护以习近平同志为核心的党中央权威和集中统一领导,保证全党的团结统一和行动一致,保证党的决定得到迅速有效的贯彻执行。加强和规范党内政治生活,增强党内政治生活的政治性、时代性、原则性、战斗性,发展积极健康的党内政治文化,营造风清气正的良好政治生态。党在自己的政治生活中正确地开展批评和自我批评,在原则问题上进行思想斗争,坚持真理,修正错误。努力造成又有集中又有民主,又有纪律又有自由,又有统一意志又有个人心情舒畅生动活泼的政治局面。 35 |   第六,坚持从严管党治党。全面从严治党永远在路上,党的自我革命永远在路上。新形势下,党面临的执政考验、改革开放考验、市场经济考验、外部环境考验是长期的、复杂的、严峻的,精神懈怠危险、能力不足危险、脱离群众危险、消极腐败危险更加尖锐地摆在全党面前。要把严的标准、严的措施贯穿于管党治党全过程和各方面。坚持依规治党、标本兼治,不断健全党内法规体系,坚持把纪律挺在前面,加强组织性纪律性,在党的纪律面前人人平等。强化全面从严治党主体责任和监督责任,加强对党的领导机关和党员领导干部特别是主要领导干部的监督,不断完善党内监督体系。深入推进党风廉政建设和反腐败斗争,以零容忍态度惩治腐败,一体推进不敢腐、不能腐、不想腐。 36 |   中国共产党的领导是中国特色社会主义最本质的特征,是中国特色社会主义制度的最大优势,党是最高政治领导力量。党政军民学,东西南北中,党是领导一切的。党要适应改革开放和社会主义现代化建设的要求,坚持科学执政、民主执政、依法执政,加强和改善党的领导。党必须按照总揽全局、协调各方的原则,在同级各种组织中发挥领导核心作用。党必须集中精力领导经济建设,组织、协调各方面的力量,同心协力,围绕经济建设开展工作,促进经济社会全面发展。党必须实行民主的科学的决策,制定和执行正确的路线、方针、政策,做好党的组织工作和宣传教育工作,发挥全体党员的先锋模范作用。党必须在宪法和法律的范围内活动。党必须保证国家的立法、司法、行政、监察机关,经济、文化组织和人民团体积极主动地、独立负责地、协调一致地工作。党必须加强对工会、共产主义青年团、妇女联合会等群团组织的领导,使它们保持和增强政治性、先进性、群众性,充分发挥作用。党必须适应形势的发展和情况的变化,完善领导体制,改进领导方式,增强执政能力。共产党员必须同党外群众亲密合作,共同为建设中国特色社会主义而奋斗。 37 | 第一章 党 员 38 |   第一条 年满十八岁的中国工人、农民、军人、知识分子和其他社会阶层的先进分子,承认党的纲领和章程,愿意参加党的一个组织并在其中积极工作、执行党的决议和按期交纳党费的,可以申请加入中国共产党。 39 |   第二条 中国共产党党员是中国工人阶级的有共产主义觉悟的先锋战士。 40 |   中国共产党党员必须全心全意为人民服务,不惜牺牲个人的一切,为实现共产主义奋斗终身。 41 |   中国共产党党员永远是劳动人民的普通一员。除了法律和政策规定范围内的个人利益和工作职权以外,所有共产党员都不得谋求任何私利和特权。 42 |   第三条 党员必须履行下列义务: 43 |   (一)认真学习马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想、科学发展观、习近平新时代中国特色社会主义思想,学习党的路线、方针、政策和决议,学习党的基本知识和党的历史,学习科学、文化、法律和业务知识,努力提高为人民服务的本领。 44 |   (二)增强“四个意识”、坚定“四个自信”、做到“两个维护”,贯彻执行党的基本路线和各项方针、政策,带头参加改革开放和社会主义现代化建设,带动群众为经济发展和社会进步艰苦奋斗,在生产、工作、学习和社会生活中起先锋模范作用。 45 |   (三)坚持党和人民的利益高于一切,个人利益服从党和人民的利益,吃苦在前,享受在后,克己奉公,多做贡献。 46 |   (四)自觉遵守党的纪律,首先是党的政治纪律和政治规矩,模范遵守国家的法律法规,严格保守党和国家的秘密,执行党的决定,服从组织分配,积极完成党的任务。 47 |   (五)维护党的团结和统一,对党忠诚老实,言行一致,坚决反对一切派别组织和小集团活动,反对阳奉阴违的两面派行为和一切阴谋诡计。 48 |   (六)切实开展批评和自我批评,勇于揭露和纠正违反党的原则的言行和工作中的缺点、错误,坚决同消极腐败现象作斗争。 49 |   (七)密切联系群众,向群众宣传党的主张,遇事同群众商量,及时向党反映群众的意见和要求,维护群众的正当利益。 50 |   (八)发扬社会主义新风尚,带头实践社会主义核心价值观和社会主义荣辱观,提倡共产主义道德,弘扬中华民族传统美德,为了保护国家和人民的利益,在一切困难和危险的时刻挺身而出,英勇斗争,不怕牺牲。 51 |   第四条 党员享有下列权利: 52 |   (一)参加党的有关会议,阅读党的有关文件,接受党的教育和培训。 53 |   (二)在党的会议上和党报党刊上,参加关于党的政策问题的讨论。 54 |   (三)对党的工作提出建议和倡议。 55 |   (四)在党的会议上有根据地批评党的任何组织和任何党员,向党负责地揭发、检举党的任何组织和任何党员违法乱纪的事实,要求处分违法乱纪的党员,要求罢免或撤换不称职的干部。 56 |   (五)行使表决权、选举权,有被选举权。 57 |   (六)在党组织讨论决定对党员的党纪处分或作出鉴定时,本人有权参加和进行申辩,其他党员可以为他作证和辩护。 58 |   (七)对党的决议和政策如有不同意见,在坚决执行的前提下,可以声明保留,并且可以把自己的意见向党的上级组织直至中央提出。 59 |   (八)向党的上级组织直至中央提出请求、申诉和控告,并要求有关组织给以负责的答复。 60 |   党的任何一级组织直至中央都无权剥夺党员的上述权利。 61 |   第五条 发展党员,必须把政治标准放在首位,经过党的支部,坚持个别吸收的原则。 62 |   申请入党的人,要填写入党志愿书,要有两名正式党员作介绍人,要经过支部大会通过和上级党组织批准,并且经过预备期的考察,才能成为正式党员。 63 |   介绍人要认真了解申请人的思想、品质、经历和工作表现,向他解释党的纲领和党的章程,说明党员的条件、义务和权利,并向党组织作出负责的报告。 64 |   党的支部委员会对申请入党的人,要注意征求党内外有关群众的意见,进行严格的审查,认为合格后再提交支部大会讨论。 65 |   上级党组织在批准申请人入党以前,要派人同他谈话,作进一步的了解,并帮助他提高对党的认识。 66 |   在特殊情况下,党的中央和省、自治区、直辖市委员会可以直接接收党员。 67 |   第六条 预备党员必须面向党旗进行入党宣誓。誓词如下:我志愿加入中国共产党,拥护党的纲领,遵守党的章程,履行党员义务,执行党的决定,严守党的纪律,保守党的秘密,对党忠诚,积极工作,为共产主义奋斗终身,随时准备为党和人民牺牲一切,永不叛党。 68 |   第七条 预备党员的预备期为一年。党组织对预备党员应当认真教育和考察。 69 |   预备党员的义务同正式党员一样。预备党员的权利,除了没有表决权、选举权和被选举权以外,也同正式党员一样。 70 |   预备党员预备期满,党的支部应当及时讨论他能否转为正式党员。认真履行党员义务,具备党员条件的,应当按期转为正式党员;需要继续考察和教育的,可以延长预备期,但不能超过一年;不履行党员义务,不具备党员条件的,应当取消预备党员资格。预备党员转为正式党员,或延长预备期,或取消预备党员资格,都应当经支部大会讨论通过和上级党组织批准。 71 |   预备党员的预备期,从支部大会通过他为预备党员之日算起。党员的党龄,从预备期满转为正式党员之日算起。 72 |   第八条 每个党员,不论职务高低,都必须编入党的一个支部、小组或其他特定组织,参加党的组织生活,接受党内外群众的监督。党员领导干部还必须参加党委、党组的民主生活会。不允许有任何不参加党的组织生活、不接受党内外群众监督的特殊党员。 73 |   第九条 党员有退党的自由。党员要求退党,应当经支部大会讨论后宣布除名,并报上级党组织备案。 74 |   党员缺乏革命意志,不履行党员义务,不符合党员条件,党的支部应当对他进行教育,要求他限期改正;经教育仍无转变的,应当劝他退党。劝党员退党,应当经支部大会讨论决定,并报上级党组织批准。如被劝告退党的党员坚持不退,应当提交支部大会讨论,决定把他除名,并报上级党组织批准。 75 |   党员如果没有正当理由,连续六个月不参加党的组织生活,或不交纳党费,或不做党所分配的工作,就被认为是自行脱党。支部大会应当决定把这样的党员除名,并报上级党组织批准。 76 | 第二章 党的组织制度 77 |   第十条 党是根据自己的纲领和章程,按照民主集中制组织起来的统一整体。党的民主集中制的基本原则是: 78 |   (一)党员个人服从党的组织,少数服从多数,下级组织服从上级组织,全党各个组织和全体党员服从党的全国代表大会和中央委员会。 79 |   (二)党的各级领导机关,除它们派出的代表机关和在非党组织中的党组外,都由选举产生。 80 |   (三)党的最高领导机关,是党的全国代表大会和它所产生的中央委员会。党的地方各级领导机关,是党的地方各级代表大会和它们所产生的委员会。党的各级委员会向同级的代表大会负责并报告工作。 81 |   (四)党的上级组织要经常听取下级组织和党员群众的意见,及时解决他们提出的问题。党的下级组织既要向上级组织请示和报告工作,又要独立负责地解决自己职责范围内的问题。上下级组织之间要互通情报、互相支持和互相监督。党的各级组织要按规定实行党务公开,使党员对党内事务有更多的了解和参与。 82 |   (五)党的各级委员会实行集体领导和个人分工负责相结合的制度。凡属重大问题都要按照集体领导、民主集中、个别酝酿、会议决定的原则,由党的委员会集体讨论,作出决定;委员会成员要根据集体的决定和分工,切实履行自己的职责。 83 |   (六)党禁止任何形式的个人崇拜。要保证党的领导人的活动处于党和人民的监督之下,同时维护一切代表党和人民利益的领导人的威信。 84 |   第十一条 党的各级代表大会的代表和委员会的产生,要体现选举人的意志。选举采用无记名投票的方式。候选人名单要由党组织和选举人充分酝酿讨论。可以直接采用候选人数多于应选人数的差额选举办法进行正式选举。也可以先采用差额选举办法进行预选,产生候选人名单,然后进行正式选举。选举人有了解候选人情况、要求改变候选人、不选任何一个候选人和另选他人的权利。任何组织和个人不得以任何方式强迫选举人选举或不选举某个人。 85 |   党的地方各级代表大会和基层代表大会的选举,如果发生违反党章的情况,上一级党的委员会在调查核实后,应作出选举无效和采取相应措施的决定,并报再上一级党的委员会审查批准,正式宣布执行。 86 |   党的各级代表大会代表实行任期制。 87 |   第十二条 党的中央和地方各级委员会在必要时召集代表会议,讨论和决定需要及时解决的重大问题。代表会议代表的名额和产生办法,由召集代表会议的委员会决定。 88 |   第十三条 凡是成立党的新组织,或是撤销党的原有组织,必须由上级党组织决定。 89 |   在党的地方各级代表大会和基层代表大会闭会期间,上级党的组织认为有必要时,可以调动或者指派下级党组织的负责人。 90 |   党的中央和地方各级委员会可以派出代表机关。 91 |   第十四条 党的中央和省、自治区、直辖市委员会实行巡视制度,在一届任期内,对所管理的地方、部门、企事业单位党组织实现巡视全覆盖。 92 |   中央有关部委和国家机关部门党组(党委)根据工作需要,开展巡视工作。 93 |   党的市(地、州、盟)和县(市、区、旗)委员会建立巡察制度。 94 |   第十五条 党的各级领导机关,对同下级组织有关的重要问题作出决定时,在通常情况下,要征求下级组织的意见。要保证下级组织能够正常行使他们的职权。凡属应由下级组织处理的问题,如无特殊情况,上级领导机关不要干预。 95 |   第十六条 有关全国性的重大政策问题,只有党中央有权作出决定,各部门、各地方的党组织可以向中央提出建议,但不得擅自作出决定和对外发表主张。 96 |   党的下级组织必须坚决执行上级组织的决定。下级组织如果认为上级组织的决定不符合本地区、本部门的实际情况,可以请求改变;如果上级组织坚持原决定,下级组织必须执行,并不得公开发表不同意见,但有权向再上一级组织报告。 97 |   党的各级组织的报刊和其他宣传工具,必须宣传党的路线、方针、政策和决议。 98 |   第十七条 党组织讨论决定问题,必须执行少数服从多数的原则。决定重要问题,要进行表决。对于少数人的不同意见,应当认真考虑。如对重要问题发生争论,双方人数接近,除了在紧急情况下必须按多数意见执行外,应当暂缓作出决定,进一步调查研究,交换意见,下次再表决;在特殊情况下,也可将争论情况向上级组织报告,请求裁决。 99 |   党员个人代表党组织发表重要主张,如果超出党组织已有决定的范围,必须提交所在的党组织讨论决定,或向上级党组织请示。任何党员不论职务高低,都不能个人决定重大问题;如遇紧急情况,必须由个人作出决定时,事后要迅速向党组织报告。不允许任何领导人实行个人专断和把个人凌驾于组织之上。 100 |   第十八条 党的中央、地方和基层组织,都必须重视党的建设,经常讨论和检查党的宣传工作、教育工作、组织工作、纪律检查工作、群众工作、统一战线工作等,注意研究党内外的思想政治状况。 101 | 第三章 党的中央组织 102 |   第十九条 党的全国代表大会每五年举行一次,由中央委员会召集。中央委员会认为有必要,或者有三分之一以上的省一级组织提出要求,全国代表大会可以提前举行;如无非常情况,不得延期举行。 103 |   全国代表大会代表的名额和选举办法,由中央委员会决定。 104 |   第二十条 党的全国代表大会的职权是: 105 |   (一)听取和审查中央委员会的报告; 106 |   (二)审查中央纪律检查委员会的报告; 107 |   (三)讨论并决定党的重大问题; 108 |   (四)修改党的章程; 109 |   (五)选举中央委员会; 110 |   (六)选举中央纪律检查委员会。 111 |   第二十一条 党的全国代表会议的职权是:讨论和决定重大问题;调整和增选中央委员会、中央纪律检查委员会的部分成员。调整和增选中央委员及候补中央委员的数额,不得超过党的全国代表大会选出的中央委员及候补中央委员各自总数的五分之一。 112 |   第二十二条 党的中央委员会每届任期五年。全国代表大会如提前或延期举行,它的任期相应地改变。中央委员会委员和候补委员必须有五年以上的党龄。中央委员会委员和候补委员的名额,由全国代表大会决定。中央委员会委员出缺,由中央委员会候补委员按照得票多少依次递补。 113 |   中央委员会全体会议由中央政治局召集,每年至少举行一次。中央政治局向中央委员会全体会议报告工作,接受监督。 114 |   在全国代表大会闭会期间,中央委员会执行全国代表大会的决议,领导党的全部工作,对外代表中国共产党。 115 |   第二十三条 党的中央政治局、中央政治局常务委员会和中央委员会总书记,由中央委员会全体会议选举。中央委员会总书记必须从中央政治局常务委员会委员中产生。 116 |   中央政治局和它的常务委员会在中央委员会全体会议闭会期间,行使中央委员会的职权。 117 |   中央书记处是中央政治局和它的常务委员会的办事机构;成员由中央政治局常务委员会提名,中央委员会全体会议通过。 118 |   中央委员会总书记负责召集中央政治局会议和中央政治局常务委员会会议,并主持中央书记处的工作。 119 |   党的中央军事委员会组成人员由中央委员会决定,中央军事委员会实行主席负责制。 120 |   每届中央委员会产生的中央领导机构和中央领导人,在下届全国代表大会开会期间,继续主持党的经常工作,直到下届中央委员会产生新的中央领导机构和中央领导人为止。 121 |   第二十四条 中国人民解放军的党组织,根据中央委员会的指示进行工作。中央军事委员会负责军队中党的工作和政治工作,对军队中党的组织体制和机构作出规定。 122 | 第四章 党的地方组织 123 |   第二十五条 党的省、自治区、直辖市的代表大会,设区的市和自治州的代表大会,县(旗)、自治县、不设区的市和市辖区的代表大会,每五年举行一次。 124 |   党的地方各级代表大会由同级党的委员会召集。在特殊情况下,经上一级委员会批准,可以提前或延期举行。 125 |   党的地方各级代表大会代表的名额和选举办法,由同级党的委员会决定,并报上一级党的委员会批准。 126 |   第二十六条 党的地方各级代表大会的职权是: 127 |   (一)听取和审查同级委员会的报告; 128 |   (二)审查同级纪律检查委员会的报告; 129 |   (三)讨论本地区范围内的重大问题并作出决议; 130 |   (四)选举同级党的委员会,选举同级党的纪律检查委员会。 131 |   第二十七条 党的省、自治区、直辖市、设区的市和自治州的委员会,每届任期五年。这些委员会的委员和候补委员必须有五年以上的党龄。 132 |   党的县(旗)、自治县、不设区的市和市辖区的委员会,每届任期五年。这些委员会的委员和候补委员必须有三年以上的党龄。 133 |   党的地方各级代表大会如提前或延期举行,由它选举的委员会的任期相应地改变。 134 |   党的地方各级委员会的委员和候补委员的名额,分别由上一级委员会决定。党的地方各级委员会委员出缺,由候补委员按照得票多少依次递补。 135 |   党的地方各级委员会全体会议,每年至少召开两次。 136 |   党的地方各级委员会在代表大会闭会期间,执行上级党组织的指示和同级党代表大会的决议,领导本地方的工作,定期向上级党的委员会报告工作。 137 |   第二十八条 党的地方各级委员会全体会议,选举常务委员会和书记、副书记,并报上级党的委员会批准。党的地方各级委员会的常务委员会,在委员会全体会议闭会期间,行使委员会职权;在下届代表大会开会期间,继续主持经常工作,直到新的常务委员会产生为止。 138 |   党的地方各级委员会的常务委员会定期向委员会全体会议报告工作,接受监督。 139 |   第二十九条 党的地区委员会和相当于地区委员会的组织,是党的省、自治区委员会在几个县、自治县、市范围内派出的代表机关。它根据省、自治区委员会的授权,领导本地区的工作。 140 | 第五章 党的基层组织 141 |   第三十条 企业、农村、机关、学校、医院、科研院所、街道社区、社会组织、人民解放军连队和其他基层单位,凡是有正式党员三人以上的,都应当成立党的基层组织。 142 |   党的基层组织,根据工作需要和党员人数,经上级党组织批准,分别设立党的基层委员会、总支部委员会、支部委员会。基层委员会由党员大会或代表大会选举产生,总支部委员会和支部委员会由党员大会选举产生,提出委员候选人要广泛征求党员和群众的意见。 143 |   第三十一条 党的基层委员会、总支部委员会、支部委员会每届任期三年至五年。基层委员会、总支部委员会、支部委员会的书记、副书记选举产生后,应报上级党组织批准。 144 |   第三十二条 党的基层组织是党在社会基层组织中的战斗堡垒,是党的全部工作和战斗力的基础。它的基本任务是: 145 |   (一)宣传和执行党的路线、方针、政策,宣传和执行党中央、上级组织和本组织的决议,充分发挥党员的先锋模范作用,积极创先争优,团结、组织党内外的干部和群众,努力完成本单位所担负的任务。 146 |   (二)组织党员认真学习马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想、科学发展观、习近平新时代中国特色社会主义思想,推进“两学一做”学习教育、党史学习教育常态化制度化,学习党的路线、方针、政策和决议,学习党的基本知识,学习科学、文化、法律和业务知识。 147 |   (三)对党员进行教育、管理、监督和服务,提高党员素质,坚定理想信念,增强党性,严格党的组织生活,开展批评和自我批评,维护和执行党的纪律,监督党员切实履行义务,保障党员的权利不受侵犯。加强和改进流动党员管理。 148 |   (四)密切联系群众,经常了解群众对党员、党的工作的批评和意见,维护群众的正当权利和利益,做好群众的思想政治工作。 149 |   (五)充分发挥党员和群众的积极性创造性,发现、培养和推荐他们中间的优秀人才,鼓励和支持他们在改革开放和社会主义现代化建设中贡献自己的聪明才智。 150 |   (六)对要求入党的积极分子进行教育和培养,做好经常性的发展党员工作,重视在生产、工作第一线和青年中发展党员。 151 |   (七)监督党员干部和其他任何工作人员严格遵守国家法律法规,严格遵守国家的财政经济法规和人事制度,不得侵占国家、集体和群众的利益。 152 |   (八)教育党员和群众自觉抵制不良倾向,坚决同各种违纪违法行为作斗争。 153 |   第三十三条 街道、乡、镇党的基层委员会和村、社区党组织,统一领导本地区基层各类组织和各项工作,加强基层社会治理,支持和保证行政组织、经济组织和群众性自治组织充分行使职权。 154 |   国有企业党委(党组)发挥领导作用,把方向、管大局、保落实,依照规定讨论和决定企业重大事项。国有企业和集体企业中党的基层组织,围绕企业生产经营开展工作。保证监督党和国家的方针、政策在本企业的贯彻执行;支持股东会、董事会、监事会和经理(厂长)依法行使职权;全心全意依靠职工群众,支持职工代表大会开展工作;参与企业重大问题的决策;加强党组织的自身建设,领导思想政治工作、精神文明建设、统一战线工作和工会、共青团、妇女组织等群团组织。 155 |   非公有制经济组织中党的基层组织,贯彻党的方针政策,引导和监督企业遵守国家的法律法规,领导工会、共青团等群团组织,团结凝聚职工群众,维护各方的合法权益,促进企业健康发展。 156 |   社会组织中党的基层组织,宣传和执行党的路线、方针、政策,领导工会、共青团等群团组织,教育管理党员,引领服务群众,推动事业发展。 157 |   实行行政领导人负责制的事业单位中党的基层组织,发挥战斗堡垒作用。实行党委领导下的行政领导人负责制的事业单位中党的基层组织,对重大问题进行讨论和作出决定,同时保证行政领导人充分行使自己的职权。 158 |   各级党和国家机关中党的基层组织,协助行政负责人完成任务,改进工作,对包括行政负责人在内的每个党员进行教育、管理、监督,不领导本单位的业务工作。 159 |   第三十四条 党支部是党的基础组织,担负直接教育党员、管理党员、监督党员和组织群众、宣传群众、凝聚群众、服务群众的职责。 160 | 第六章 党的干部 161 |   第三十五条 党的干部是党的事业的骨干,是人民的公仆,要做到忠诚干净担当。党按照德才兼备、以德为先的原则选拔干部,坚持五湖四海、任人唯贤,坚持事业为上、公道正派,反对任人唯亲,努力实现干部队伍的革命化、年轻化、知识化、专业化。 162 |   党重视教育、培训、选拔、考核和监督干部,特别是培养、选拔优秀年轻干部。积极推进干部制度改革。 163 |   党重视培养、选拔女干部和少数民族干部。 164 |   第三十六条 党的各级领导干部必须信念坚定、为民服务、勤政务实、敢于担当、清正廉洁,模范地履行本章程第三条所规定的党员的各项义务,并且必须具备以下的基本条件: 165 |   (一)具有履行职责所需要的马克思列宁主义、毛泽东思想、邓小平理论、“三个代表”重要思想、科学发展观的水平,带头贯彻落实习近平新时代中国特色社会主义思想,努力用马克思主义的立场、观点、方法分析和解决实际问题,坚持讲学习、讲政治、讲正气,经得起各种风浪的考验。 166 |   (二)具有共产主义远大理想和中国特色社会主义坚定信念,坚决执行党的基本路线和各项方针、政策,立志改革开放,献身现代化事业,在社会主义建设中艰苦创业,树立正确政绩观,做出经得起实践、人民、历史检验的实绩。 167 |   (三)坚持解放思想,实事求是,与时俱进,开拓创新,认真调查研究,能够把党的方针、政策同本地区、本部门的实际相结合,卓有成效地开展工作,讲实话,办实事,求实效。 168 |   (四)有强烈的革命事业心和政治责任感,有实践经验,有胜任领导工作的组织能力、文化水平和专业知识。 169 |   (五)正确行使人民赋予的权力,坚持原则,依法办事,清正廉洁,勤政为民,以身作则,艰苦朴素,密切联系群众,坚持党的群众路线,自觉地接受党和群众的批评和监督,加强道德修养,讲党性、重品行、作表率,做到自重、自省、自警、自励,反对形式主义、官僚主义、享乐主义和奢靡之风,反对特权思想和特权现象,反对任何滥用职权、谋求私利的行为。 170 |   (六)坚持和维护党的民主集中制,有民主作风,有全局观念,善于团结同志,包括团结同自己有不同意见的同志一道工作。 171 |   第三十七条 党员干部要善于同党外干部合作共事,尊重他们,虚心学习他们的长处。 172 |   党的各级组织要善于发现和推荐有真才实学的党外干部担任领导工作,保证他们有职有权,充分发挥他们的作用。 173 |   第三十八条 党的各级领导干部,无论是由民主选举产生的,或是由领导机关任命的,他们的职务都不是终身的,都可以变动或解除。 174 |   年龄和健康状况不适宜于继续担任工作的干部,应当按照国家的规定退、离休。 175 | 第七章 党的纪律 176 |   第三十九条 党的纪律是党的各级组织和全体党员必须遵守的行为规则,是维护党的团结统一、完成党的任务的保证。党组织必须严格执行和维护党的纪律,共产党员必须自觉接受党的纪律的约束。 177 |   第四十条 党的纪律主要包括政治纪律、组织纪律、廉洁纪律、群众纪律、工作纪律、生活纪律。 178 |   坚持惩前毖后、治病救人,执纪必严、违纪必究,抓早抓小、防微杜渐,按照错误性质和情节轻重,给以批评教育、责令检查、诫勉直至纪律处分。运用监督执纪“四种形态”,让“红红脸、出出汗”成为常态,党纪处分、组织调整成为管党治党的重要手段,严重违纪、严重触犯刑律的党员必须开除党籍。 179 |   党内严格禁止用违反党章和国家法律的手段对待党员,严格禁止打击报复和诬告陷害。违反这些规定的组织或个人必须受到党的纪律和国家法律的追究。 180 |   第四十一条 对党员的纪律处分有五种:警告、严重警告、撤销党内职务、留党察看、开除党籍。 181 |   留党察看最长不超过两年。党员在留党察看期间没有表决权、选举权和被选举权。党员经过留党察看,确已改正错误的,应当恢复其党员的权利;坚持错误不改的,应当开除党籍。 182 |   开除党籍是党内的最高处分。各级党组织在决定或批准开除党员党籍的时候,应当全面研究有关的材料和意见,采取十分慎重的态度。 183 |   第四十二条 对党员的纪律处分,必须经过支部大会讨论决定,报党的基层委员会批准;如果涉及的问题比较重要或复杂,或给党员以开除党籍的处分,应分别不同情况,报县级或县级以上党的纪律检查委员会审查批准。在特殊情况下,县级和县级以上各级党的委员会和纪律检查委员会有权直接决定给党员以纪律处分。 184 |   对党的中央委员会委员、候补委员,给以警告、严重警告处分,由中央纪律检查委员会常务委员会审议后,报党中央批准。对地方各级党的委员会委员、候补委员,给以警告、严重警告处分,应由上一级纪律检查委员会批准,并报它的同级党的委员会备案。 185 |   对党的中央委员会和地方各级委员会的委员、候补委员,给以撤销党内职务、留党察看或开除党籍的处分,必须由本人所在的委员会全体会议三分之二以上的多数决定。在全体会议闭会期间,可以先由中央政治局和地方各级委员会常务委员会作出处理决定,待召开委员会全体会议时予以追认。对地方各级委员会委员和候补委员的上述处分,必须经过上级纪律检查委员会常务委员会审议,由这一级纪律检查委员会报同级党的委员会批准。 186 |   严重触犯刑律的中央委员会委员、候补委员,由中央政治局决定开除其党籍;严重触犯刑律的地方各级委员会委员、候补委员,由同级委员会常务委员会决定开除其党籍。 187 |   第四十三条 党组织对党员作出处分决定,应当实事求是地查清事实。处分决定所依据的事实材料和处分决定必须同本人见面,听取本人说明情况和申辩。如果本人对处分决定不服,可以提出申诉,有关党组织必须负责处理或者迅速转递,不得扣压。对于确属坚持错误意见和无理要求的人,要给以批评教育。 188 |   第四十四条 党组织如果在维护党的纪律方面失职,必须问责。 189 |   对于严重违犯党的纪律、本身又不能纠正的党组织,上一级党的委员会在查明核实后,应根据情节严重的程度,作出进行改组或予以解散的决定,并报再上一级党的委员会审查批准,正式宣布执行。 190 | 第八章 党的纪律检查机关 191 |   第四十五条 党的中央纪律检查委员会在党的中央委员会领导下进行工作。党的地方各级纪律检查委员会和基层纪律检查委员会在同级党的委员会和上级纪律检查委员会双重领导下进行工作。上级党的纪律检查委员会加强对下级纪律检查委员会的领导。 192 |   党的各级纪律检查委员会每届任期和同级党的委员会相同。 193 |   党的中央纪律检查委员会全体会议,选举常务委员会和书记、副书记,并报党的中央委员会批准。党的地方各级纪律检查委员会全体会议,选举常务委员会和书记、副书记,并由同级党的委员会通过,报上级党的委员会批准。党的基层委员会是设立纪律检查委员会,还是设立纪律检查委员,由它的上一级党组织根据具体情况决定。党的总支部委员会和支部委员会设纪律检查委员。 194 |   党的中央和地方纪律检查委员会向同级党和国家机关全面派驻党的纪律检查组,按照规定向有关国有企业、事业单位派驻党的纪律检查组。纪律检查组组长参加驻在单位党的领导组织的有关会议。他们的工作必须受到该单位党的领导组织的支持。 195 |   第四十六条 党的各级纪律检查委员会是党内监督专责机关,主要任务是:维护党的章程和其他党内法规,检查党的路线、方针、政策和决议的执行情况,协助党的委员会推进全面从严治党、加强党风建设和组织协调反腐败工作,推动完善党和国家监督体系。 196 |   党的各级纪律检查委员会的职责是监督、执纪、问责,要经常对党员进行遵守纪律的教育,作出关于维护党纪的决定;对党的组织和党员领导干部履行职责、行使权力进行监督,受理处置党员群众检举举报,开展谈话提醒、约谈函询;检查和处理党的组织和党员违反党的章程和其他党内法规的比较重要或复杂的案件,决定或取消对这些案件中的党员的处分;进行问责或提出责任追究的建议;受理党员的控告和申诉;保障党员的权利。 197 |   各级纪律检查委员会要把处理特别重要或复杂的案件中的问题和处理的结果,向同级党的委员会报告。党的地方各级纪律检查委员会和基层纪律检查委员会要同时向上级纪律检查委员会报告。 198 |   各级纪律检查委员会发现同级党的委员会委员有违犯党的纪律的行为,可以先进行初步核实,如果需要立案检查的,应当在向同级党的委员会报告的同时向上一级纪律检查委员会报告;涉及常务委员的,报告上一级纪律检查委员会,由上一级纪律检查委员会进行初步核实,需要审查的,由上一级纪律检查委员会报它的同级党的委员会批准。 199 |   第四十七条 上级纪律检查委员会有权检查下级纪律检查委员会的工作,并且有权批准和改变下级纪律检查委员会对于案件所作的决定。如果所要改变的该下级纪律检查委员会的决定,已经得到它的同级党的委员会的批准,这种改变必须经过它的上一级党的委员会批准。 200 |   党的地方各级纪律检查委员会和基层纪律检查委员会如果对同级党的委员会处理案件的决定有不同意见,可以请求上一级纪律检查委员会予以复查;如果发现同级党的委员会或它的成员有违犯党的纪律的情况,在同级党的委员会不给予解决或不给予正确解决的时候,有权向上级纪律检查委员会提出申诉,请求协助处理。 201 | 第九章 党 组 202 |   第四十八条 在中央和地方国家机关、人民团体、经济组织、文化组织和其他非党组织的领导机关中,可以成立党组。党组发挥领导作用。党组的任务,主要是负责贯彻执行党的路线、方针、政策;加强对本单位党的建设的领导,履行全面从严治党责任;讨论和决定本单位的重大问题;做好干部管理工作;讨论和决定基层党组织设置调整和发展党员、处分党员等重要事项;团结党外干部和群众,完成党和国家交给的任务;领导机关和直属单位党组织的工作。 203 |   第四十九条 党组的成员,由批准成立党组的党组织决定。党组设书记,必要时还可以设副书记。 204 |   党组必须服从批准它成立的党组织领导。 205 |   第五十条 在对下属单位实行集中统一领导的国家工作部门和有关单位的领导机关中,可以建立党委,党委的产生办法、职权和工作任务,由中央另行规定。 206 | 第十章 党和共产主义青年团的关系 207 |   第五十一条 中国共产主义青年团是中国共产党领导的先进青年的群团组织,是广大青年在实践中学习中国特色社会主义和共产主义的学校,是党的助手和后备军。共青团中央委员会受党中央委员会领导。共青团的地方各级组织受同级党的委员会领导,同时受共青团上级组织领导。 208 |   第五十二条 党的各级委员会要加强对共青团的领导,注意团的干部的选拔和培训。党要坚决支持共青团根据广大青年的特点和需要,生动活泼地、富于创造性地进行工作,充分发挥团的突击队作用和联系广大青年的桥梁作用。 209 |   团的县级和县级以下各级委员会书记,企业事业单位的团委员会书记,是党员的,可以列席同级党的委员会和常务委员会的会议。 210 | 第十一章 党徽党旗 211 |   第五十三条 中国共产党党徽为镰刀和锤头组成的图案。 212 |   第五十四条 中国共产党党旗为旗面缀有金黄色党徽图案的红旗。 213 |   第五十五条 中国共产党的党徽党旗是中国共产党的象征和标志。党的各级组织和每一个党员都要维护党徽党旗的尊严。要按照规定制作和使用党徽党旗。 214 | 215 | -------------------------------------------------------------------------------- /src/RegexSearch.cpp: -------------------------------------------------------------------------------- 1 | #include "RegexSearch.h" 2 | #include 3 | #include 4 | 5 | // 之前研究编译的时候学过这个regex头文件,挺方便可以直接用 6 | // https://en.cppreference.com/w/cpp/regex/regex_search,扔个网址在这里,查起来方便 7 | void RegexSearch::regexQuery(const std::vector &sentences, const std::string &pattern) 8 | { 9 | try 10 | { 11 | std::regex regexPattern(pattern); 12 | std::cout << "正则查询结果 \"" << pattern << "\":" << std::endl; 13 | bool found = false; 14 | 15 | for (const auto &sentence : sentences) 16 | { 17 | std::smatch match; // regex头文件下有两种匹配类型,这个其实是和match results一样的 18 | if (std::regex_search(sentence, match, regexPattern)) // 这个函数返回的是bool值,所以可以直接用来判断 19 | { 20 | std::cout << "\t" << sentence << "." << std::endl; 21 | found = true; 22 | size_t startPos = match.position(); 23 | size_t length = match.length(); 24 | std::string marker(sentence.size(), ' '); // 又到了标准的可视化环节咯 25 | std::fill(marker.begin() + startPos, marker.begin() + startPos + length, '^'); 26 | std::string a = "\t"; 27 | marker.insert(0, a); 28 | std::cout << marker << std::endl; 29 | } 30 | } 31 | 32 | if (!found) 33 | { 34 | std::cout << "未找到正则匹配 \"" << pattern << "\" 的结果." << std::endl; 35 | } 36 | } 37 | catch (const std::regex_error &e) 38 | { 39 | std::cerr << "正则表达式错误: " << e.what() << std::endl; // 学到了,原来正则搜索的try catch格式是标准的 40 | } 41 | } 42 | 43 | void RegexSearch::chineseRegexQuery(const std::vector &sentences, const std::string &pattern) 44 | { 45 | try 46 | { 47 | std::regex regexPattern(pattern); 48 | std::cout << "中文正则查询结果 \"" << pattern << "\":" << std::endl; 49 | bool found = false; 50 | 51 | for (const auto &sentence : sentences) 52 | { 53 | std::smatch match; 54 | if (std::regex_search(sentence, match, regexPattern)) 55 | { 56 | std::cout << "\t" << sentence << "。" << std::endl; 57 | found = true; 58 | // size_t startPos = match.position(); 59 | // size_t length = match.length(); 60 | // std::string marker(sentence.size(), ' '); // 又到了标准的可视化环节咯 61 | // std::fill(marker.begin() + startPos, marker.begin() + startPos + length, '^'); 62 | // std::string a = "\t"; 63 | // marker.insert(0, a); 64 | // std::cout << marker << std::endl; 65 | } 66 | } 67 | 68 | if (!found) 69 | { 70 | std::cout << "未找到中文正则匹配 \"" << pattern << "\" 的结果." << std::endl; 71 | } 72 | } 73 | catch (const std::regex_error &e) 74 | { 75 | std::cerr << "正则表达式错误: " << e.what() << std::endl; 76 | } 77 | } -------------------------------------------------------------------------------- /src/TextSearchEngine.cpp: -------------------------------------------------------------------------------- 1 | #include "TextSearchEngine.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | // 保存已经查询过的句子到index.dat文件里,和下面的load对应 12 | // 主要是想提升加载速度设置的dat文件 13 | void TextSearchEngine::saveIndex(const std::string &filepath) 14 | { 15 | std::ofstream out(filepath, std::ios::binary); 16 | out.imbue(std::locale()); 17 | if (!out.is_open()) 18 | { 19 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 20 | logFile << "无法打开文件以保存索引: " << filepath << std::endl; 21 | logFile.close(); 22 | return; 23 | } 24 | // 保存句子数量 25 | size_t sentenceCount = sentences.size(); 26 | out.write(reinterpret_cast(&sentenceCount), sizeof(sentenceCount)); // 使用reinterpret_cast主要是为了解决指针类型转换的问题 27 | // 保存每个句子 28 | for (const auto &sentence : sentences) 29 | { 30 | size_t length = sentence.size(); 31 | out.write(reinterpret_cast(&length), sizeof(length)); 32 | out.write(sentence.c_str(), length); 33 | } 34 | // 保存索引大小 35 | size_t indexSize = exactIndex.size(); 36 | out.write(reinterpret_cast(&indexSize), sizeof(indexSize)); 37 | // 保存每个索引项 38 | for (const auto &pair : exactIndex) 39 | { 40 | size_t keyLen = pair.first.size(); 41 | out.write(reinterpret_cast(&keyLen), sizeof(keyLen)); 42 | out.write(pair.first.c_str(), keyLen); 43 | size_t vecSize = pair.second.size(); 44 | out.write(reinterpret_cast(&vecSize), sizeof(vecSize)); 45 | for (auto idx : pair.second) 46 | { 47 | out.write(reinterpret_cast(&idx), sizeof(idx)); 48 | } 49 | } 50 | out.close(); 51 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 52 | logFile << "索引已保存到 " << filepath << std::endl; 53 | logFile.close(); 54 | } 55 | 56 | // 加载索引,也是从dat文件里加载 57 | void TextSearchEngine::loadIndex(const std::string &filepath) 58 | { 59 | 60 | std::ifstream in(filepath, std::ios::binary);// 二进制打开 61 | in.imbue(std::locale()); 62 | if (!in.is_open()) // 如果没打开就在log报个错 63 | { 64 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 65 | logFile << "无法打开索引文件: " << filepath << std::endl; 66 | logFile.close(); 67 | return; 68 | } 69 | // 清空当前数据 70 | sentences.clear(); 71 | exactIndex.clear(); 72 | // 读取句子数量 73 | size_t sentenceCount; 74 | in.read(reinterpret_cast(&sentenceCount), sizeof(sentenceCount)); 75 | // 读取每个句子 76 | for (size_t i = 0; i < sentenceCount; ++i) 77 | { 78 | size_t length; 79 | in.read(reinterpret_cast(&length), sizeof(length)); 80 | std::string sentence(length, ' '); 81 | in.read(&sentence[0], length); 82 | sentences.push_back(sentence); 83 | } 84 | // 读取索引大小 85 | size_t indexSize; 86 | in.read(reinterpret_cast(&indexSize), sizeof(indexSize)); 87 | 88 | 89 | // 读取每个索引项(核心步骤 !!!!) 90 | for (size_t i = 0; i < indexSize; ++i) 91 | { 92 | size_t wordLength; 93 | in.read(reinterpret_cast(&wordLength), sizeof(wordLength)); 94 | std::string word(wordLength, ' '); 95 | in.read(&word[0], wordLength); 96 | size_t vecSize; 97 | in.read(reinterpret_cast(&vecSize), sizeof(vecSize)); 98 | std::vector sentVec; // 将 std::vector 修改为 std::vector 99 | for (size_t j = 0; j < vecSize; ++j) 100 | { 101 | size_t sentIdx; 102 | in.read(reinterpret_cast(&sentIdx), sizeof(sentIdx)); 103 | sentVec.push_back(sentIdx); // 将 sentVec.push_back(sent) 修改为 sentVec.push_back(sentIdx) 104 | } 105 | exactIndex[word] = sentVec; // 每一个要索引的单词都放进哈希表 106 | } 107 | in.close(); 108 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 109 | logFile << "索引已从 " << filepath << " 加载" << std::endl; 110 | logFile.close(); 111 | } 112 | 113 | // 这个预处理各个文件的核心要义就是分隔,多文件→单文件→段落(行)→句子→词,这里四层循环导致加载文件这步时间复杂度最高 114 | // (后面实测也确实是最久的,不过发现即使加载许多百万字小说也没有耗时特别久,不超过0.5s,已经是很满意的速度了) 115 | // 其中要注意全变小写(之前因为这个漏掉了很多) 116 | void TextSearchEngine::loadTexts(const std::vector &files) 117 | { 118 | 119 | for (const auto &file : files) // 支持打开多个文件了 120 | { 121 | std::ifstream infile(file); 122 | infile.imbue(std::locale()); 123 | if (!infile) 124 | { 125 | std::cout << "无法打开目标文件: " << file << std::endl; // 输出错误信息 126 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 127 | logFile << "无法打开目标文件: " << file << std::endl; // 同时在log里面也记上 128 | logFile.close(); 129 | continue; // 如果打不开就跳过 130 | } 131 | 132 | std::string line;// 每次读一行,或叫一段 133 | while (std::getline(infile, line)) 134 | { 135 | std::stringstream ss(line); 136 | std::string sentence; 137 | // 使用正则表达式分割句子,分隔符为 '.' 或 '。'(在中文版里新增了这个分隔符) 138 | std::regex re(u8"[。.]");// 定义分隔(中途发现不显示规定u8会有时候乱码) 139 | std::sregex_token_iterator iter(line.begin(), line.end(), re, -1);// 查regex类的时候才发现这玩意这么好使 140 | std::sregex_token_iterator end; 141 | while (iter != end) 142 | { 143 | sentence = *iter; // 一句一句的读,最后面要自增 144 | if (!sentence.empty()) 145 | { 146 | sentences.push_back(sentence); // 句子放进句子列表 147 | // 索引精确查询 148 | std::string word; 149 | for (auto &c : sentence) // 最开始把分隔字母想复杂了,后面发现其实就是sentence里面空格隔开,用auto遍历都行 150 | { 151 | if (std::isalnum(c)) // 检查是字母or数字(中文and符号就不用变了) 152 | word += std::tolower(c); 153 | else if (!word.empty()) 154 | { 155 | exactIndex[word].push_back(sentences.size() - 1); 156 | word.clear(); 157 | } 158 | } 159 | if (!word.empty()) // 处理最后没搞完的 160 | exactIndex[word].push_back(sentences.size() - 1); 161 | } 162 | ++iter; // 这个迭代器的自增比我想的方便点 163 | } 164 | } 165 | } 166 | } 167 | 168 | 169 | void TextSearchEngine::exactQuery(const std::string &keyword) 170 | { 171 | std::string key = keyword; 172 | std::transform(key.begin(), key.end(), key.begin(), ::tolower);// 转小写 和上面对应 173 | auto it = exactIndex[key]; // 核心功能 查找哈希表 174 | if (!it.empty())// 原本这里使用了find和end 但是发现不方便改自定义哈希 175 | { 176 | std::cout << "精确查询结果 \"" << keyword << "\":" << std::endl; 177 | for (auto idx : it) 178 | { 179 | const std::string &sentence = sentences[idx];// 当前单词在哪里 180 | std::cout << "\t" << sentence << std::endl; 181 | 182 | // 标出关键字的位置 183 | // std::string::size_type pos = sentence.find(keyword); 184 | // if (pos != std::string::npos) 185 | // { 186 | // std::cout << "\t" << std::string(pos, ' ') << std::string(keyword.length(), '^') << std::endl; 187 | // } 188 | size_t pos = sentence.find(keyword); 189 | if (pos != std::string::npos) 190 | { 191 | std::string marker(sentence.size(), ' '); 192 | std::fill(marker.begin() + pos, marker.begin() + pos + keyword.length(), '^'); 193 | std::cout << "\t" << marker << std::endl; 194 | } 195 | } 196 | } 197 | else 198 | { 199 | std::cout << "未找到关键字 \"" << keyword << "\" 的结果。" << std::endl; 200 | } 201 | } 202 | 203 | 204 | // 用单词的一部分来查找 在大规模文件中很能体现时间上的速度 205 | // 但是这里就不方便用哈希表了,所以这里就直接遍历句子列表了 206 | void TextSearchEngine::fuzzyQuery(const std::string &keyword) 207 | { 208 | std::cout << "模糊查询结果 \"" << keyword << "\":" << std::endl; 209 | bool found = false; 210 | for (size_t i = 0; i < sentences.size(); ++i) 211 | { 212 | if (sentences[i].find(keyword) != std::string::npos) 213 | { 214 | std::cout << "\t" << sentences[i] << "." << std::endl; 215 | found = true; 216 | size_t pos = sentences[i].find(keyword); 217 | if (pos != std::string::npos) 218 | { 219 | std::string marker(sentences[i].size(), ' '); 220 | std::fill(marker.begin() + pos, marker.begin() + pos + keyword.length(), '^'); 221 | std::cout << "\t" << marker << std::endl; 222 | } 223 | } 224 | } 225 | if (!found) 226 | { 227 | std::cout << "未找到模糊匹配 \"" << keyword << "\" 的结果." << std::endl; 228 | } 229 | // 记录日志 230 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 231 | logFile << "模糊查询: " << keyword << " 执行完成" << std::endl; 232 | logFile.close(); 233 | } 234 | 235 | // 实质上就是把中文的分隔符加上去了,其他的和上面的fuzzyQuery一样 236 | void TextSearchEngine::chineseQuery(const std::string &keyword) 237 | { 238 | std::cout << "中文查询结果 \"" << keyword << "\":" << std::endl; 239 | bool found = false; 240 | for (size_t i = 0; i < sentences.size(); ++i) 241 | { 242 | if (sentences[i].find(keyword) != std::string::npos) 243 | { 244 | std::cout << "\t" << sentences[i] << "。" << std::endl; 245 | found = true; 246 | size_t pos = sentences[i].find(keyword); 247 | // if (pos != std::string::npos) 248 | // { 249 | // std::string marker(sentences[i].size(), ' '); 250 | // std::string::iterator ch1 = (marker.begin() + pos); 251 | // std::string::iterator ch2 = (marker.begin() + pos + keyword.length()); 252 | // std::fill(marker.begin() + pos, marker.begin() + pos + keyword.length(), '^'); 253 | // std::cout << "\t" << marker << std::endl; 254 | // } 255 | } 256 | } 257 | if (!found) 258 | { 259 | std::cout << "未找到中文匹配 \"" << keyword << "\" 的结果." << std::endl; 260 | } 261 | // 记录日志 262 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 263 | logFile << "中文查询: " << keyword << " 执行完成" << std::endl; 264 | logFile.close(); 265 | } 266 | 267 | const std::vector &TextSearchEngine::getSentences() const 268 | { 269 | return sentences; // 返回回句子列表 270 | } 271 | 272 | // void TextSearchEngine::visualizeMatch(const std::string &sentence, const std::string &keyword) 273 | // { 274 | // size_t pos = sentence.find(keyword); 275 | // // 如果句子中包含关键字 276 | // if (pos != std::string::npos) 277 | // { 278 | // // 创建一个与句子等长的标记字符串 279 | // std::string marker(sentence.size(), ' '); 280 | // // 将标记字符串中关键字的位置替换为'^' 281 | // std::fill(marker.begin() + pos, marker.begin() + pos + keyword.size(), '^'); 282 | // std::string a = "\t"; 283 | // marker.insert(0, a); 284 | // std::cout << marker << std::endl; 285 | // } 286 | // } 287 | 288 | 289 | // void TextSearchEngine::indexSentence(const std::string &sentence) 290 | // { 291 | // std::istringstream ss(sentence); 292 | // std::string word; 293 | // // 逐词读取句子内容 294 | // while (ss >> word) 295 | // { 296 | // // 将单词转为小写 297 | // std::transform(word.begin(), word.end(), word.begin(), ::tolower); 298 | // exactIndex[word].push_back(sentences.size() - 1); 299 | // } 300 | // } 301 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "TextSearchEngine.h" 2 | #include "RegexSearch.h" 3 | #include "oyyphash.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | /* 15 | ! 基础功能: 16 | (done)TODO:哈希表包含查询 17 | (done)TODO:文件读取 18 | 19 | ? 增添功能: 20 | (done)TODO:多文件支持 21 | (done)TODO:支持正则表达 22 | (done)TODO:精确查询 23 | (done)TODO:可视化搜索结果,如模仿编译器报错的方式 24 | (done)TODO:无限查询,退出按钮 25 | (done)TODO:新的哈希函数 26 | (done)TODO:支持中文文件 27 | (done)TODO:性能优化与预处理 28 | (done)TODO:用户界面 29 | (done)TODO:持久化存储 30 | (done)TODO:日志功能,记录查询历史等 31 | (done)TODO:支持中文输出 32 | (done)TODO:完整版中文 33 | TODO:支持其他文件格式,例如PDF 34 | (done)TODO:查询耗时输出 35 | (done)TODO:支持中文正则 36 | (done)TODO:不使用unordered map,自己实现一个哈希 37 | */ 38 | 39 | int main() 40 | { 41 | // 设置全局区域设置 42 | std::locale::global(std::locale("zh_CN.UTF-8")); 43 | 44 | // 为标准输出流设置区域设置 45 | std::cout.imbue(std::locale()); 46 | std::cin.imbue(std::locale()); 47 | 48 | std::cout << "Current working directory: " 49 | << std::filesystem::current_path() << std::endl; 50 | auto root_path = std::filesystem::current_path().parent_path(); // 因为 build/ 是工作目录 51 | auto file_path = root_path / "logo_pic/logo_out.txt"; 52 | std::ifstream infile(file_path); 53 | infile.imbue(std::locale()); 54 | if (infile.is_open()) 55 | { 56 | std::string line; 57 | while (std::getline(infile, line)) 58 | { 59 | std::cout << line << std::endl; 60 | } 61 | infile.close(); 62 | } 63 | else 64 | { 65 | std::cerr << "无法打开logo文件。" << std::endl; 66 | } 67 | std::cout << std::endl; 68 | std::cout << "欢迎使用Yat-Search Engine文本搜索引擎!" << std::endl; 69 | std::cout << "作者:Fernandez Owen 版本:v1.6.0" << std::endl; 70 | std::cout << "-----------------------------重要说明-------------------------------" << std::endl; 71 | std::cout << "1. 请确保您的源文件夹中的文件名不包含空格,否则可能在某些环境下会导致程序" << std::endl; 72 | std::cout << " 无法正常运行。" << std::endl; 73 | std::cout << "2. 请将需要查询的源文件放入source-text文件夹中,以txt形式存放。请保证文" << std::endl; 74 | std::cout << " 件以UTF-8格式存放,否则可能导致乱码。" << std::endl; 75 | std::cout << "3. 如果需要查询中文,请使用中文查询的两个模式。中文查询暂不支持可视化输出。" << std::endl; 76 | std::cout << "--------------------------请按回车以继续-----------------------------" << std::endl; 77 | std::cin.get(); 78 | 79 | std::ofstream logFile("../log/query_log.txt", std::ios::app); 80 | 81 | logFile.imbue(std::locale()); 82 | TextSearchEngine engine; 83 | 84 | std::cout << "请问是否沿用曾经的查询文件?[Y/N]" << std::endl; 85 | char choice; 86 | std::cin >> choice; 87 | // 加载 source-text 文件夹中的多个文件 88 | if(choice == 'N' || choice == 'n'){ 89 | std::vector files; 90 | std::string filename; 91 | while (true) 92 | { 93 | std::cout << "请问您要查找哪些文件?" << std::endl; 94 | std::cout << "输入文件名(.txt),每次输入一个并回车;" << std::endl; 95 | std::cout << "输入 'all' 加载全部文件" << std::endl; 96 | std::cout << "输入 'done' 完成输入:"; 97 | std::cin >> filename; 98 | 99 | if (filename == "all") 100 | { 101 | for (const auto &entry : std::filesystem::directory_iterator("../source-text/")) // 这个遍历文件夹的迭代器也挺好使 102 | { 103 | files.push_back(entry.path().string()); 104 | } 105 | std::cout << "已添加全部文件。\n"; 106 | break; 107 | } 108 | 109 | if (filename == "done") 110 | { 111 | break; 112 | } 113 | 114 | // 检查文件扩展名是否为 .txt 115 | if (filename.size() < 4 || filename.substr(filename.size() - 4) != ".txt") 116 | { 117 | std::cout << "无效的文件扩展名,请确保文件以 .txt 结尾。\n"; 118 | continue; 119 | } 120 | 121 | std::string filepath = "../source-text/" + filename; 122 | std::cout << "已添加文件: " << filepath << "\n"; 123 | 124 | std::ifstream file(filepath); 125 | file.imbue(std::locale()); 126 | if (!file.is_open()) 127 | { 128 | std::cout << "无法打开文件: " << filepath << "。请检查是否放入目标文件夹。\n"; 129 | continue; 130 | } 131 | files.push_back(filepath); 132 | } 133 | 134 | if (files.empty()) 135 | { 136 | std::cout << "未选择任何文件,程序即将退出。\n"; 137 | return 0; 138 | } 139 | std::cout << std::endl; 140 | 141 | engine.loadTexts(files); 142 | }else if(choice == 'Y' || choice == 'y'){ 143 | engine.loadIndex("../dat/index.dat"); 144 | }else{ 145 | std::cout << "无效输入,程序即将退出。\n"; 146 | return 0; 147 | } 148 | 149 | std::cout << "文件加载完毕,欢迎使用Yat Search Engine进行查询!\n"; 150 | std::cout << std::endl; 151 | std::cout << "功能说明:" << std::endl; 152 | std::cout << "1. 精确查询:输入一个单词,查询在什么位置出现了这个单词" << std::endl; 153 | std::cout << "2. 模糊查询:输入为一个单词中的一个部分,输出该词组所在的句子和位置" << std::endl; 154 | std::cout << "3. 正则查询:按照正则表达式规则进行匹配" << std::endl; 155 | std::cout << "4. 中文查询:查询任意中文字符或词组" << std::endl; 156 | std::cout << "5. 中文正则:按照正则表达式来查询中文" << std::endl; 157 | std::cout << "6. 退出查询:退出程序" << std::endl; 158 | 159 | bool running = true; 160 | 161 | while (running) 162 | { 163 | int choice; 164 | bool validInput; 165 | 166 | do 167 | { 168 | std::cout << "请选择查询类型(1-6):"; 169 | std::cin >> choice; 170 | 171 | if (std::cin.fail()) 172 | { 173 | std::cin.clear(); 174 | std::cin.ignore(std::numeric_limits::max(), '\n'); 175 | validInput = false; 176 | } 177 | else 178 | { 179 | validInput = (choice >= 1 && choice <= 6); 180 | } 181 | 182 | if (!validInput) 183 | { 184 | std::cout << "无效选项,请重试。\n"; 185 | } 186 | } while (!validInput); 187 | 188 | std::string input; 189 | switch (choice) 190 | { 191 | case 1: 192 | { 193 | std::cout << "输入关键词: "; 194 | std::cin.ignore(std::numeric_limits::max(), '\n'); 195 | std::getline(std::cin, input); 196 | auto start = std::chrono::high_resolution_clock::now(); 197 | engine.exactQuery(input); 198 | auto end = std::chrono::high_resolution_clock::now(); 199 | std::chrono::duration elapsed = end - start; 200 | std::cout << "查询耗时: " << elapsed.count() << " 秒" << std::endl; 201 | logFile << "精确查询: " << input << std::endl; 202 | break; 203 | } 204 | case 2: 205 | { 206 | std::cout << "输入关键词: "; 207 | std::cin.ignore(std::numeric_limits::max(), '\n'); 208 | std::getline(std::cin, input); 209 | auto start = std::chrono::high_resolution_clock::now(); 210 | engine.fuzzyQuery(input); 211 | auto end = std::chrono::high_resolution_clock::now(); 212 | std::chrono::duration elapsed = end - start; 213 | std::cout << "查询耗时: " << elapsed.count() << " 秒" << std::endl; 214 | logFile << "模糊查询: " << input << std::endl; 215 | break; 216 | } 217 | case 3: 218 | { 219 | std::cout << "输入正则表达式: "; 220 | std::cin.ignore(); 221 | std::getline(std::cin, input); 222 | auto start = std::chrono::high_resolution_clock::now(); 223 | RegexSearch::regexQuery(engine.getSentences(), input); 224 | auto end = std::chrono::high_resolution_clock::now(); 225 | std::chrono::duration elapsed = end - start; 226 | std::cout << "查询耗时: " << elapsed.count() << " 秒" << std::endl; 227 | logFile << "正则查询: " << input << std::endl; 228 | break; 229 | } 230 | case 4: 231 | { 232 | std::cout << "输入中文关键词: "; 233 | std::cin.ignore(std::numeric_limits::max(), '\n'); 234 | std::getline(std::cin, input); 235 | auto start = std::chrono::high_resolution_clock::now(); 236 | engine.chineseQuery(input); 237 | auto end = std::chrono::high_resolution_clock::now(); 238 | std::chrono::duration elapsed = end - start; 239 | std::cout << "查询耗时: " << elapsed.count() << " 秒" << std::endl; 240 | logFile << "中文查询: " << input << std::endl; 241 | break; 242 | } 243 | case 5: 244 | { 245 | std::cout << "输入中文正则表达式: "; 246 | std::cin.ignore(std::numeric_limits::max(), '\n'); 247 | std::getline(std::cin, input); 248 | auto start = std::chrono::high_resolution_clock::now(); 249 | RegexSearch::chineseRegexQuery(engine.getSentences(), input); 250 | auto end = std::chrono::high_resolution_clock::now(); 251 | std::chrono::duration elapsed = end - start; 252 | std::cout << "查询耗时: " << elapsed.count() << " 秒" << std::endl; 253 | logFile << "中文正则: " << input << std::endl; 254 | break; 255 | } 256 | case 6: 257 | { 258 | running = false; 259 | engine.saveIndex("../dat/index.dat"); 260 | logFile << "退出程序" << std::endl; 261 | break; 262 | } 263 | default: 264 | { 265 | std::cout << "无效选项,请重试。\n"; 266 | } 267 | } 268 | } 269 | std::cout << "感谢使用Yat-Search Engine!\n"; 270 | logFile.close(); 271 | return 0; 272 | } -------------------------------------------------------------------------------- /src/oyyphash.cpp: -------------------------------------------------------------------------------- 1 | #include "oyyphash.h" 2 | #include 3 | 4 | // 发现其实不需要怎么样初始化 5 | HashTable::HashTable(size_t size) : bucket_count(size), table(size), element_count(0) {} 6 | 7 | 8 | // void HashTable::insert(std::string &key, size_t value) { 9 | // size_t hash = hasher(key); 10 | // size_t index = hash % bucket_count; 11 | // for (auto &pair : table[index]) { 12 | // if (pair.first == key) { 13 | // pair.second.push_back(value); 14 | // return; 15 | // } 16 | // } 17 | // table[index].emplace_back(key, std::vector{value}); 18 | // element_count++; 19 | // } 20 | 21 | // std::vector HashTable::find(std::string &key) const { 22 | // size_t hash = hasher(key); 23 | // size_t index = hash % bucket_count; 24 | // for (const auto &pair : table[index]) { 25 | // if (pair.first == key) { 26 | // return pair.second; 27 | // } 28 | // } 29 | // return {}; 30 | // } 31 | 32 | // void HashTable::remove(std::string &key, size_t value) { 33 | // size_t hash = hasher(key); 34 | // size_t index = hash % bucket_count; 35 | // for (auto &pair : table[index]) { 36 | // if (pair.first == key) { 37 | // auto it = std::find(pair.second.begin(), pair.second.end(), value); 38 | // if (it != pair.second.end()) { 39 | // pair.second.erase(it); 40 | // // 如果该键下没有值了,可以选择移除键 41 | // if (pair.second.empty()) { 42 | // table[index].erase(std::remove_if(table[index].begin(), table[index].end(), 43 | // [&](const std::pair>& p) { return p.first == key; }), 44 | // table[index].end()); 45 | // element_count--; 46 | // } 47 | // } 48 | // return; 49 | // } 50 | // } 51 | // } 52 | 53 | size_t HashTable::size() const { 54 | return element_count; 55 | } 56 | 57 | void HashTable::clear() { 58 | for(auto &bucket : table) { 59 | bucket.clear(); 60 | } 61 | element_count = 0; 62 | } 63 | 64 | std::vector& HashTable::operator[](std::string &key) { 65 | size_t hash = hasher(key); 66 | size_t index = hash % bucket_count; 67 | for (auto &pair : table[index]) { 68 | if (pair.first == key) { 69 | return pair.second; 70 | } 71 | } 72 | table[index].emplace_back(key, std::vector()); 73 | element_count++; 74 | return table[index].back().second; 75 | } 76 | 77 | // iterator 构造函数 78 | HashTable::iterator::iterator(HashTable* table, size_t bucket, size_t index) 79 | : table(table), current_bucket(bucket), current_index(index) {} 80 | 81 | // 解引用操作 82 | std::pair>& HashTable::iterator::operator*() const { 83 | return table->table[current_bucket][current_index]; 84 | } 85 | 86 | std::pair>* HashTable::iterator::operator->() const { 87 | return &table->table[current_bucket][current_index]; 88 | } 89 | 90 | // 递增操作 91 | HashTable::iterator& HashTable::iterator::operator++() { 92 | advance(); 93 | return *this; 94 | } 95 | 96 | HashTable::iterator HashTable::iterator::operator++(int) { 97 | iterator temp = *this; 98 | advance(); 99 | return temp; 100 | } 101 | 102 | void HashTable::iterator::advance() { 103 | if (current_bucket >= table->table.size()) return; 104 | current_index++; 105 | while (current_bucket < table->table.size()) { 106 | if (current_index < table->table[current_bucket].size()) { 107 | return; 108 | } 109 | current_bucket++; 110 | current_index = 0; 111 | } 112 | } 113 | 114 | // 比较操作 115 | bool HashTable::iterator::operator==(const iterator& other) const { 116 | return table == other.table && 117 | current_bucket == other.current_bucket && 118 | current_index == other.current_index; 119 | } 120 | 121 | bool HashTable::iterator::operator!=(const iterator& other) const { 122 | return !(*this == other); 123 | } 124 | 125 | HashTable::iterator HashTable::begin() { 126 | for (size_t i = 0; i < table.size(); ++i) { 127 | if (!table[i].empty()) { 128 | return iterator(this, i, 0); 129 | } 130 | } 131 | return end(); 132 | } 133 | 134 | HashTable::iterator HashTable::end() { 135 | return iterator(this, table.size(), 0); 136 | } 137 | --------------------------------------------------------------------------------