From f9e730cfe37a4d4e12d70d3202020b28f60f81ae Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 14 Jun 2024 02:44:14 -0400 Subject: [PATCH] Automatically identify and fix spelling errors using `codespell`. (#1368) Add a GitHub action and a locally installable pre-commit hook that runs the spell checker `codespell` on the codebase and fails if codespell identifies possible spelling errors. Also fix all the errors that the initial run of codespell detected. Should the tool have too many false positives in the future, we can stell deactivate it and run it manually every now and then, but after a review of the initial suggestions I (@joka921) don't consider that to be likely. --- .codespellrc | 8 ++++ .github/workflows/codespell.yml | 25 +++++++++++ .pre-commit-config-local.yaml | 6 +++ .pre-commit-config.yaml | 6 +++ CMakeLists.txt | 2 +- Dockerfile | 2 +- Dockerfiles/Dockerfile.Ubuntu18.04 | 2 +- Dockerfiles/Dockerfile.Ubuntu20.04 | 2 +- benchmark/BenchmarkExamples.cpp | 4 +- benchmark/JoinAlgorithmBenchmark.cpp | 45 ++++++++++--------- benchmark/Usage.md | 2 +- benchmark/infrastructure/Benchmark.h | 14 +++--- benchmark/infrastructure/BenchmarkMain.cpp | 12 ++--- .../BenchmarkMeasurementContainer.cpp | 14 +++--- .../BenchmarkMeasurementContainer.h | 2 +- benchmark/infrastructure/BenchmarkMetadata.h | 2 +- benchmark/infrastructure/BenchmarkToJson.h | 6 +-- .../infrastructure/BenchmarkToString.cpp | 4 +- benchmark/infrastructure/BenchmarkToString.h | 2 +- benchmark/util/ResultTableColumnOperations.h | 4 +- docs/quickstart.md.DEPRECATED | 2 +- docs/sparql_plus_text.md | 2 +- e2e/e2e.sh | 2 +- master.Makefile | 8 ++-- misc/multiplicity-problem.txt | 2 +- misc/query_planning_and_text.txt | 2 +- misc/reduce_ram_and_startup_time.txt | 8 ++-- src/engine/CartesianProductJoin.h | 4 +- src/engine/CountAvailablePredicates.cpp | 2 +- src/engine/GroupBy.cpp | 2 +- src/engine/GroupBy.h | 2 +- src/engine/Join.h | 6 +-- src/engine/LocalVocab.h | 6 +-- src/engine/Minus.cpp | 2 +- src/engine/Operation.cpp | 6 +-- src/engine/Operation.h | 2 +- src/engine/QueryPlanner.cpp | 8 ++-- src/engine/QueryPlanner.h | 2 +- src/engine/Result.h | 2 +- src/engine/Server.cpp | 4 +- src/engine/SortPerformanceEstimator.h | 4 +- src/engine/TransitivePathBase.h | 6 +-- src/engine/TransitivePathImpl.h | 3 +- .../idTable/CompressedExternalIdTable.h | 4 +- src/engine/idTable/IdTable.h | 2 +- src/engine/raw_thoughts.txt | 6 +-- src/engine/sparqlExpressions/LangExpression.h | 4 +- .../sparqlExpressions/RegexExpression.h | 4 +- src/global/ValueId.h | 2 +- src/index/CompressedRelation.h | 2 +- src/index/ConstantsIndexBuilding.h | 4 +- src/index/Index.h | 4 +- src/index/IndexImpl.Text.cpp | 6 +-- src/index/IndexImpl.cpp | 12 ++--- src/index/IndexImpl.h | 6 +-- src/index/IndexMetaData.h | 6 +-- src/index/MetaDataHandler.h | 2 +- src/index/PatternCreator.h | 4 +- src/index/PrefixHeuristic.cpp | 4 +- src/index/PrefixHeuristic.h | 2 +- src/index/vocabulary/CombinedVocabulary.h | 2 +- src/parser/ParallelBuffer.h | 2 +- src/parser/ParsedQuery.cpp | 2 +- src/parser/SelectClause.cpp | 2 +- src/parser/Tokenizer.h | 2 +- src/parser/TokenizerCtre.h | 4 +- src/parser/TurtleParser.cpp | 6 +-- .../sparqlParser/SparqlQleverVisitor.cpp | 2 +- src/util/AsyncStream.h | 4 +- src/util/Cache.h | 2 +- src/util/CancellationHandle.h | 2 +- src/util/ConfigManager/ConfigManager.cpp | 4 +- src/util/ConfigManager/ConfigManager.h | 10 ++--- src/util/ConfigManager/ConfigOption.cpp | 2 +- src/util/ConfigManager/ConfigOption.h | 2 +- src/util/ConfigManager/Validator.h | 4 +- src/util/ConstexprUtils.h | 2 +- src/util/CopyableUniquePtr.h | 4 +- src/util/CryptographicHashUtils.h | 10 ++--- src/util/Date.h | 4 +- src/util/Exception.h | 2 +- src/util/File.h | 2 +- src/util/JoinAlgorithms/JoinAlgorithms.h | 4 +- src/util/MemorySize/MemorySize.h | 10 ++--- src/util/MmapVector.h | 12 ++--- src/util/MmapVectorImpl.h | 2 +- src/util/PriorityQueue.h | 6 +-- src/util/Serializer/Serializer.h | 2 +- src/util/Simple8bCode.h | 2 +- src/util/StringUtils.cpp | 2 +- src/util/StringUtils.h | 6 +-- src/util/SuppressWarnings.h | 2 +- src/util/Synchronized.h | 4 +- src/util/TaskQueue.h | 2 +- src/util/TupleForEach.h | 2 +- src/util/TupleHelpers.h | 2 +- src/util/TypeTraits.h | 2 +- src/util/http/HttpClient.cpp | 2 +- src/util/http/HttpClient.h | 2 +- src/util/http/HttpUtils.cpp | 2 +- src/util/http/MediaTypes.h | 2 +- src/util/http/websocket/WebSocketSession.cpp | 2 +- test/AlgorithmTest.cpp | 6 ++- test/CMakeLists.txt | 2 +- test/CacheTest.cpp | 4 +- test/ConfigManagerTest.cpp | 44 +++++++++--------- test/CopyableUniquePtrTest.cpp | 2 +- test/GroupByTest.cpp | 6 +-- test/IdTableHelpersTest.cpp | 4 +- test/IdTableTest.cpp | 6 +-- test/JsonCustomConverterForThirdPartyTest.cpp | 6 +-- test/NBitIntegerTest.cpp | 2 +- test/PriorityQueueTest.cpp | 4 +- test/RandomTest.cpp | 4 +- test/ResultTableColumnOperationsTest.cpp | 4 +- test/SelectClauseTest.cpp | 2 +- test/SerializerTest.cpp | 4 +- test/SparqlAntlrParserTestHelpers.h | 2 +- test/SparqlExpressionTest.cpp | 2 +- test/StringSortComparatorTest.cpp | 6 +-- test/StringUtilsTest.cpp | 2 +- test/SynchronizedTest.cpp | 10 +++-- test/TransitivePathTest.cpp | 6 +-- test/VocabularyGeneratorTest.cpp | 4 +- test/VocabularyTestHelpers.h | 8 ++-- test/engine/CartesianProductJoinTest.cpp | 2 +- test/engine/TextIndexScanForEntityTest.cpp | 2 +- test/util/AsyncTestHelpers.h | 2 +- test/util/IdTableHelpers.cpp | 6 +-- test/util/IdTableHelpers.h | 8 ++-- test/util/JoinHelpers.h | 2 +- test/util/ValidatorHelpers.h | 2 +- 132 files changed, 343 insertions(+), 292 deletions(-) create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..a1e8aa7c0f --- /dev/null +++ b/.codespellrc @@ -0,0 +1,8 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,.codespellrc,*.pdf,generated +check-hidden = true +# Ignore mixedCase variables, lines with latin, lines with codespell-ignore pragma, etc +ignore-regex = \b([A-Z]*[a-z]+[A-Z][a-zA-Z]*)\b|.*(Lorem ipsum|eleifend|feugait|codespell-ignore).* +# alph - is used frequently in tests, just ignore altogether +ignore-words-list = ser,alph,inbetween,interm diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..b026c855dd --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/.pre-commit-config-local.yaml b/.pre-commit-config-local.yaml index 8b0cedfa8e..1b2c1c90f2 100644 --- a/.pre-commit-config-local.yaml +++ b/.pre-commit-config-local.yaml @@ -14,3 +14,9 @@ repos: args: [ "-style=file" ] require_serial: false + + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .codespellrc + rev: v2.2.6 + hooks: + - id: codespell diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec0bea02ed..29ee828fa8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,3 +14,9 @@ repos: hooks: - id: clang-format 'types_or': [ c++, c ] + + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .codespellrc + rev: v2.2.6 + hooks: + - id: codespell diff --git a/CMakeLists.txt b/CMakeLists.txt index 046d01ccb3..b3fad60c81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,7 +348,7 @@ message(STATUS ---) include_directories(src) # Run the script `CompilationInfo.cmake` that creates the file `CompilationInfo.cpp` -# with the current git hash and the curent time and date. When specifying +# with the current git hash and the current time and date. When specifying # `-DDONT_UPDATE_COMPILATION_INFO=true` as an argument to `cmake`, the compilation info is # never updated. This is useful during development to avoid a relinking of the binaries for # every compilation. diff --git a/Dockerfile b/Dockerfile index b2d2945de8..46ae129e3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ ENV MEMORY_FOR_QUERIES 70 ENV CACHE_MAX_SIZE_GB 30 ENV CACHE_MAX_SIZE_GB_SINGLE_ENTRY 5 ENV CACHE_MAX_NUM_ENTRIES 1000 -# Need the shell to get the INDEX_PREFIX envirionment variable +# Need the shell to get the INDEX_PREFIX environment variable ENTRYPOINT ["/bin/sh", "-c", "exec ServerMain -i \"/index/${INDEX_PREFIX}\" -j 8 -m ${MEMORY_FOR_QUERIES} -c ${CACHE_MAX_SIZE_GB} -e ${CACHE_MAX_SIZE_GB_SINGLE_ENTRY} -k ${CACHE_MAX_NUM_ENTRIES} -p 7001 \"$@\"", "--"] # Build image: docker build -t qlever.master . diff --git a/Dockerfiles/Dockerfile.Ubuntu18.04 b/Dockerfiles/Dockerfile.Ubuntu18.04 index 7af32c5a35..1bf75191c5 100644 --- a/Dockerfiles/Dockerfile.Ubuntu18.04 +++ b/Dockerfiles/Dockerfile.Ubuntu18.04 @@ -49,7 +49,7 @@ ENV MEMORY_FOR_QUERIES 70 ENV CACHE_MAX_SIZE_GB 30 ENV CACHE_MAX_SIZE_GB_SINGLE_ENTRY 5 ENV CACHE_MAX_NUM_ENTRIES 1000 -# Need the shell to get the INDEX_PREFIX envirionment variable +# Need the shell to get the INDEX_PREFIX environment variable ENTRYPOINT ["/bin/sh", "-c", "exec ServerMain -i \"/index/${INDEX_PREFIX}\" -j 8 -m ${MEMORY_FOR_QUERIES} -c ${CACHE_MAX_SIZE_GB} -e ${CACHE_MAX_SIZE_GB_SINGLE_ENTRY} -k ${CACHE_MAX_NUM_ENTRIES} -p 7001 \"$@\"", "--"] # Build image: docker build -t qlever.master . diff --git a/Dockerfiles/Dockerfile.Ubuntu20.04 b/Dockerfiles/Dockerfile.Ubuntu20.04 index 11a319a358..3d9da94d24 100644 --- a/Dockerfiles/Dockerfile.Ubuntu20.04 +++ b/Dockerfiles/Dockerfile.Ubuntu20.04 @@ -45,7 +45,7 @@ ENV MEMORY_FOR_QUERIES 70 ENV CACHE_MAX_SIZE_GB 30 ENV CACHE_MAX_SIZE_GB_SINGLE_ENTRY 5 ENV CACHE_MAX_NUM_ENTRIES 1000 -# Need the shell to get the INDEX_PREFIX envirionment variable +# Need the shell to get the INDEX_PREFIX environment variable ENTRYPOINT ["/bin/sh", "-c", "exec ServerMain -i \"/index/${INDEX_PREFIX}\" -j 8 -m ${MEMORY_FOR_QUERIES} -c ${CACHE_MAX_SIZE_GB} -e ${CACHE_MAX_SIZE_GB_SINGLE_ENTRY} -k ${CACHE_MAX_NUM_ENTRIES} -p 7001 \"$@\"", "--"] # Build image: docker build -t qlever.master . diff --git a/benchmark/BenchmarkExamples.cpp b/benchmark/BenchmarkExamples.cpp index 9ac38180aa..e419b96feb 100644 --- a/benchmark/BenchmarkExamples.cpp +++ b/benchmark/BenchmarkExamples.cpp @@ -62,7 +62,7 @@ class ConfigOptions : public BenchmarkInterface { "allowed for the configuration option \"num-signs\".", numSigns); - manager.addOption("coin-flip-try", "The number of succesful coin flips.", + manager.addOption("coin-flip-try", "The number of successful coin flips.", &wonOnTryX_, {false, false, false, false, false}); // Sub manager can be used to organize things better. They are basically @@ -94,7 +94,7 @@ class BMSingleMeasurements : public ConfigOptions { exponentiate(number); }); auto& multipleTimes = results.addMeasurement( - "Recursivly exponentiate multiple times", [&number, &exponentiate]() { + "Recursively exponentiate multiple times", [&number, &exponentiate]() { size_t toExponentiate = number; for (size_t i = 0; i < 10'000'000'000; i++) { toExponentiate = exponentiate(toExponentiate); diff --git a/benchmark/JoinAlgorithmBenchmark.cpp b/benchmark/JoinAlgorithmBenchmark.cpp index e89d60df1a..18945aa41c 100644 --- a/benchmark/JoinAlgorithmBenchmark.cpp +++ b/benchmark/JoinAlgorithmBenchmark.cpp @@ -130,7 +130,7 @@ struct SetOfIdTableColumnElements { /* @brief Create an overlap between the join columns of the IdTables, by randomly choosing distinct elements from the join column of the smaller table and -overiding all their occurrences in the join column with randomly choosen +overriding all their occurrences in the join column with randomly chosen distinct elements from the join column of the bigger table. @param smallerTable The table, where distinct join column elements will be @@ -167,7 +167,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable, // Collect and count the table elements. SetOfIdTableColumnElements biggerTableJoinColumnSet(biggerTableJoinColumnRef); - // Seeds for the random generators, so that things are less similiar. + // Seeds for the random generators, so that things are less similar. const std::array seeds = createArrayOfRandomSeeds<2>(std::move(randomSeed)); @@ -229,7 +229,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable, Assign the value to itself. This is needed, because so we can indirectly track the first 'encounter' with an distinct element in the smaller table and save - ressources. + resources. */ smallerTableElementToNewElement.emplace(id, id); } @@ -275,7 +275,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable, SetOfIdTableColumnElements smallerTableJoinColumnSet( smallerTableJoinColumnRef); - // Seeds for the random generators, so that things are less similiar. + // Seeds for the random generators, so that things are less similar. const std::array seeds = createArrayOfRandomSeeds<2>(std::move(randomSeed)); @@ -304,7 +304,7 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable, const auto& biggerTableId{biggerTableJoinColumnSet.uniqueElements_.at( randomBiggerTableElement())}; - // Skip this possibilty, if we have an overflow. + // Skip this possibility, if we have an overflow. size_t newMatches{ smallerTableJoinColumnSet.numOccurrences_.at(smallerTableId)}; if (const size_t numOccurencesBiggerTable{ @@ -338,12 +338,12 @@ static size_t createOverlapRandomly(IdTableAndJoinColumn* const smallerTable, } /* -The columns of the automaticly generated benchmark tables contain the following -informations: +The columns of the automatically generated benchmark tables contain the +following information: - The parameter, that changes with every row. - Time needed for sorting `IdTable`s. - Time needed for merge/galloping join. -- Time needed for sorting and merge/galloping added togehter. +- Time needed for sorting and merge/galloping added together. - Time needed for the hash join. - How many rows the result of joining the tables has. - How much faster the hash join is. For example: Two times faster. @@ -390,7 +390,7 @@ concept exactlyOneGrowthFunction = ((growthFunction || growthFunction)+...) == 1; /* -@brief Calculates the smalles whole exponent $n$, so that $base^n$ is equal, or +@brief Calculates the smallest whole exponent $n$, so that $base^n$ is equal, or bigger, than the `startingPoint`. */ template T> @@ -530,7 +530,7 @@ struct ConfigVariables { `IdTables` gets bigger with every row, while the other attributes stay the same. For the attributes, that don't stay the same, inclusive boundaries are - defined. Sometimes implicitely via other configuration option. (With the + defined. Sometimes implicitly via other configuration option. (With the exception of the sample size ratios for the special benchmarking class `BmSampleSizeRatio`.) @@ -759,7 +759,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface { @brief The generated lambda returns true, iff if it is called with a value, that is bigger than the given minimum value - @param canBeEqual If true, the generated lamba also returns true, if the + @param canBeEqual If true, the generated lambda also returns true, if the values are equal. */ auto generateBiggerEqualLambda = [](const T& minimumValue, @@ -1107,7 +1107,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface { - Return values of the parameter, you gave a function for. - Time needed for sorting `IdTable`s. - Time needed for merge/galloping join. - - Time needed for sorting and merge/galloping added togehter. + - Time needed for sorting and merge/galloping added together. - Time needed for the hash join. - How many rows the result of joining the tables has. - How much faster the hash join is. For example: Two times faster. @@ -1145,7 +1145,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface { to be exactly the same. @param randomSeed Seed for the random generators. @param smallerTableSorted, biggerTableSorted Should the bigger/smaller table - be sorted by his join column before being joined? More specificly, some + be sorted by his join column before being joined? More specifically, some join algorithm require one, or both, of the IdTables to be sorted. If this argument is false, the time needed for sorting the required table will added to the time of the join algorithm. @@ -1200,7 +1200,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface { // Returns the first argument, that is a growth function. auto returnFirstGrowthFunction = [&isGrowthFunction](Ts&... args) -> auto& { - // Put them into a tuple, so that we can easly look them up. + // Put them into a tuple, so that we can easily look them up. auto tup = std::tuple{AD_FWD(args)...}; // Get the index of the first growth function. @@ -1479,7 +1479,7 @@ class GeneralInterfaceImplementation : public BenchmarkInterface { biggerTableJoinColumnSampleSizeRatio)) - 1; - // Seeds for the random generators, so that things are less similiar + // Seeds for the random generators, so that things are less similar // between the tables. const std::array seeds = createArrayOfRandomSeeds<5>(std::move(randomSeed)); @@ -1891,7 +1891,7 @@ class BmSampleSizeRatio final : public GeneralInterfaceImplementation { "'max-memory' and 'bigger-table-num-columns'"; } else { smallerTableNumRowsDescription = - "divison of 'max-bigger-table-rows' with 'min-ratio-rows'"; + "division of 'max-bigger-table-rows' with 'min-ratio-rows'"; smallerTableNumRowsConfigurationOptions = "'max-bigger-table-rows'"; } @@ -1918,7 +1918,7 @@ class BmSampleSizeRatio final : public GeneralInterfaceImplementation { }; /* - Calculate the expexcted number of rows in the result for the simplified + Calculate the expected number of rows in the result for the simplified creation model of input tables join columns and overlaps, with the biggest sample size ratio used for both input tables. The simplified creation model assumes, that: @@ -1927,12 +1927,13 @@ class BmSampleSizeRatio final : public GeneralInterfaceImplementation { overlaps are inserted later. - The join column entries of the smaller table have a uniform distribution, are made up out of the join column elements of both tables (smaller and - bigger) and the generation of one row entry is independet from the + bigger) and the generation of one row entry is independent from the generation of all other row entries. - The join column entries of the bigger table have a uniform distribution, are made up out of only the elements of the bigger tables and the generation - of one row entry is independet from the generation of all other row entries. - - The generation of join column entries in the smaller table is independet + of one row entry is independent from the generation of all other row + entries. + - The generation of join column entries in the smaller table is independent from the generation in the bigger table. Note: In reality, the set of possible join column entries for the smaller @@ -2155,7 +2156,7 @@ class BmSmallerTableGrowsBiggerTableRemainsSameSize final - Number of rows in the smaller table. - Time needed for sorting `IdTable`s. - Time needed for merge/galloping join. - - Time needed for sorting and merge/galloping added togehter. + - Time needed for sorting and merge/galloping added together. - Time needed for the hash join. - How many rows the result of joining the tables has. - How much faster the hash join is. For example: Two times faster. @@ -2165,7 +2166,7 @@ class BmSmallerTableGrowsBiggerTableRemainsSameSize final @param tableDescriptor A identifier for the to be created benchmark table, so that it can be easier identified later. @param smallerTableSorted, biggerTableSorted Should the bigger/smaller table - be sorted by his join column before being joined? More specificly, some + be sorted by his join column before being joined? More specifically, some join algorithm require one, or both, of the IdTables to be sorted. If this argument is false, the time needed for sorting the required table will added to the time of the join algorithm. diff --git a/benchmark/Usage.md b/benchmark/Usage.md index 5e621b776c..29c09bcb4f 100644 --- a/benchmark/Usage.md +++ b/benchmark/Usage.md @@ -68,7 +68,7 @@ BenchmarkResults runAllBenchmarks(){ /* Create an empty table with a number of rows and columns. Doesn't measure anything. The number of columns can not be changed after creation, but the number of rows can. - Important: The row names aren't saved in a seperate container, but INSIDE the + Important: The row names aren't saved in a separate container, but INSIDE the first column of the table. */ auto& table = results.addTable(identifier, {"rowName1", "rowName2", "etc."}, diff --git a/benchmark/infrastructure/Benchmark.h b/benchmark/infrastructure/Benchmark.h index ebe32f3a19..ae5b93d410 100644 --- a/benchmark/infrastructure/Benchmark.h +++ b/benchmark/infrastructure/Benchmark.h @@ -98,7 +98,7 @@ class BenchmarkResults { } /* - * @brief Returns a vector of all the singe measurements. + * @brief Returns a vector of all the single measurements. */ std::vector getSingleMeasurements() const; @@ -185,7 +185,7 @@ class BenchmarkInterface { const ad_utility::ConfigManager& getConfigManager() const; /* - @brief Only used for manipulaton via the infrastructure. Is called directly + @brief Only used for manipulation via the infrastructure. Is called directly before `runAllBenchmarks`. Add/update the default metadata of the benchmark class. Currently @@ -205,7 +205,7 @@ class BenchmarkRegister { using BenchmarkPointer = std::unique_ptr; /* - Static vector of all registered benchmark classe instances. + Static vector of all registered benchmark class instances. */ inline static std::vector registeredBenchmarks{}; @@ -216,7 +216,7 @@ class BenchmarkRegister { * implemented the `BenchmarkInterface`. Shouldn't take up much space * and I couldn't find a better way of doing it. * - * @param benchmarkClasseInstance The memory managment of the passed + * @param benchmarkClasseInstance The memory management of the passed * instances will be taken over by `BenchmarkRegister`. */ explicit BenchmarkRegister(BenchmarkPointer&& benchmarkClasseInstance); @@ -230,9 +230,9 @@ class BenchmarkRegister { /* @brief For each registered benchmark: - Update the default class metadata. - - Run the measurments. + - Run the measurements. - @return Every benchmark class get's measured with their own + @return Every benchmark class gets measured with their own `BenchmarkResults`. They should be in the same order as the registrations. */ static std::vector runAllRegisteredBenchmarks(); @@ -247,7 +247,7 @@ class BenchmarkRegister { Macros for easier registering of benchmark classes. `declareRegisterVariable` and `declareRegisterVariableHidden` are needed for the implementation. Only `registerBenchmark` needs to be 'called', when one -want's to register a benchmark class. +wants to register a benchmark class. */ #define AD_DECLARE_REGISTER_VARIABLE_HIDDEN(line, benchmarkClass, ...) \ static BenchmarkRegister gRegisterVariable##benchmarkClass##line{ \ diff --git a/benchmark/infrastructure/BenchmarkMain.cpp b/benchmark/infrastructure/BenchmarkMain.cpp index 6c96503e62..b605ed7ac0 100644 --- a/benchmark/infrastructure/BenchmarkMain.cpp +++ b/benchmark/infrastructure/BenchmarkMain.cpp @@ -33,7 +33,7 @@ using namespace ad_benchmark; @brief Transform the given benchmark classes and corresponding results to json, and write them to the specified json file. -@param benchmarkClassAndResults The benchmark classes togehter with their +@param benchmarkClassAndResults The benchmark classes together with their results of running `runAllBenchmarks`. @param jsonFileName The name of the json file, where the json informationen should be written in. @@ -55,7 +55,7 @@ static void writeBenchmarkClassAndBenchmarkResultsToJsonFile( AD_CORRECTNESS_CHECK(benchmarkClassAndBenchmarkResultsAsJson.is_array()); /* - Add the old json arry entries to the new json array entries, if a non empty + Add the old json array entries to the new json array entries, if a non empty file exists. Otherwise, we create/fill the file. */ if (appendToJsonInFile && std::filesystem::exists(jsonFileName) && @@ -107,7 +107,7 @@ static __attribute__((noreturn)) void printConfigurationOptionsAndExit() { * and prints their measured time in a fitting format. */ int main(int argc, char** argv) { - // The filename, should the write option be choosen. + // The filename, should the write option be chosen. std::string writeFileName = ""; // The short hand, for the benchmark configuration. std::string shortHandConfigurationString = ""; @@ -126,7 +126,7 @@ int main(int argc, char** argv) { "Writes the benchmarks as json to a json file, overriding the previous" " content of the file.")( "append,a", - "Causes the json option to append to the end of the json arry in the " + "Causes the json option to append to the end of the json array in the " "json file, if there is one, instead of overriding the previous content " "of " "the file.")( @@ -158,7 +158,7 @@ int main(int argc, char** argv) { po::store(po::parse_command_line(argc, argv, options), vm); po::notify(vm); - // If write was choosen, then the given file must be a json file. + // If write was chosen, then the given file must be a json file. if (vm.count("write") && !writeFileName.ends_with(".json")) { std::cerr << "The file defined via `--write` must be a `.json` file.\n"; printUsageAndExit(); @@ -202,7 +202,7 @@ int main(int argc, char** argv) { Pairing the measured times up together with the the benchmark classes, that created them. Note: All the classes registered in `BenchmarkRegister` are always ran in the same order. So the benchmark class and benchmark - results are always at the same index position, and are grouped togehter + results are always at the same index position, and are grouped together correctly. */ const auto& benchmarkClassAndResults{ad_utility::zipVectors( diff --git a/benchmark/infrastructure/BenchmarkMeasurementContainer.cpp b/benchmark/infrastructure/BenchmarkMeasurementContainer.cpp index 5d784baa07..c7736e2e59 100644 --- a/benchmark/infrastructure/BenchmarkMeasurementContainer.cpp +++ b/benchmark/infrastructure/BenchmarkMeasurementContainer.cpp @@ -163,11 +163,11 @@ void ResultTable::setEntry(const size_t& row, const size_t& column, // ____________________________________________________________________________ ResultTable::operator std::string() const { - // Used for the formating of floats in the table. They will always be - // formated as having 4 values after the decimal point. + // Used for the formatting of floats in the table. They will always be + // formatted as having 4 values after the decimal point. static constexpr absl::string_view floatFormatSpecifier = "%.4f"; - // What should be printed between columns. Used for nicer formating. + // What should be printed between columns. Used for nicer formatting. const std::string columnSeperator = " | "; // Convert an `EntryType` of `ResultTable` to a screen friendly @@ -175,7 +175,7 @@ ResultTable::operator std::string() const { auto entryToStringVisitor = [](const T& entry) { /* `EntryType` has multiple distinct possible types, that all need different - handeling. Fortunaly, we can decide the handeling at compile time and + handling. Fortunately, we can decide the handling at compile time and throw the others away, using `if constexpr(std::is_same<...,...>::value)`. */ if constexpr (std::is_same_v) { @@ -276,11 +276,11 @@ ResultTable::operator std::string() const { ad_utility::addIndentation(stream.str(), " ")); } - // For formating: What is the maximum string width of a column, if you + // For formatting: What is the maximum string width of a column, if you // compare all it's entries? std::vector columnMaxStringWidth(numColumns(), 0); for (size_t column = 0; column < numColumns(); column++) { - // How long is the string representation of a colum entry in a wanted row? + // How long is the string representation of a column entry in a wanted row? auto stringWidthOfRow = std::views::transform( entries_, [&column, &entryToString](const std::vector& row) { return entryToString(row.at(column)).length(); @@ -317,7 +317,7 @@ ResultTable::operator std::string() const { // ____________________________________________________________________________ void ResultTable::addRow() { - // Create an emptry row of the same size as every other row. + // Create an empty row of the same size as every other row. entries_.emplace_back(numColumns()); } diff --git a/benchmark/infrastructure/BenchmarkMeasurementContainer.h b/benchmark/infrastructure/BenchmarkMeasurementContainer.h index bb4e40490d..6703bb3224 100644 --- a/benchmark/infrastructure/BenchmarkMeasurementContainer.h +++ b/benchmark/infrastructure/BenchmarkMeasurementContainer.h @@ -271,7 +271,7 @@ class ResultTable : public BenchmarkMetadataGetter { private: /* - @brief Sets the member variables for the constructure functions. + @brief Sets the member variables for the constructor functions. @param descriptor A string to identify this instance in json format later. @param descriptorForLog A string to identify this instance in the log. diff --git a/benchmark/infrastructure/BenchmarkMetadata.h b/benchmark/infrastructure/BenchmarkMetadata.h index 4fb6372e0e..ac7fce4750 100644 --- a/benchmark/infrastructure/BenchmarkMetadata.h +++ b/benchmark/infrastructure/BenchmarkMetadata.h @@ -13,7 +13,7 @@ namespace ad_benchmark { */ class BenchmarkMetadata { // No real reason, to really build everything ourselves, when the - // nlohmann::ordered_json object already containes everything, that we could + // nlohmann::ordered_json object already contains everything, that we could // need. nlohmann::ordered_json data_; diff --git a/benchmark/infrastructure/BenchmarkToJson.h b/benchmark/infrastructure/BenchmarkToJson.h index aa0fb79cd7..792ca8ca83 100644 --- a/benchmark/infrastructure/BenchmarkToJson.h +++ b/benchmark/infrastructure/BenchmarkToJson.h @@ -13,14 +13,14 @@ namespace ad_benchmark { /* - * @brief Create a nlohmann::ordered_json array with all relevant informations - * about the measurments taken by all the `BenchmarkResults`. + * @brief Create a nlohmann::ordered_json array with all relevant information + * about the measurements taken by all the `BenchmarkResults`. */ nlohmann::ordered_json benchmarkResultsToJson( const std::vector& results); /* -@brief Create a nlohmann::ordered_json array with all relevant informations +@brief Create a nlohmann::ordered_json array with all relevant information given by the pairs. */ nlohmann::ordered_json zipBenchmarkClassAndBenchmarkResultsToJson( diff --git a/benchmark/infrastructure/BenchmarkToString.cpp b/benchmark/infrastructure/BenchmarkToString.cpp index 4d323fb8a3..6f87024051 100644 --- a/benchmark/infrastructure/BenchmarkToString.cpp +++ b/benchmark/infrastructure/BenchmarkToString.cpp @@ -42,7 +42,7 @@ std::string getMetadataPrettyString(const BenchmarkMetadata& meta, } /* -@brief Return a string containing a titel version of `categoryName` and a string +@brief Return a string containing a title version of `categoryName` and a string list representation of all the given category entries. Note: This function converts `CategoryType` objects by trying to cast them as `std::string`. @@ -97,7 +97,7 @@ std::string benchmarkResultsToString( } }; - // Visualization for single measurments, if there are any. + // Visualization for single measurements, if there are any. addNonEmptyCategoryToStringSteam("Single measurement benchmarks", results.getSingleMeasurements()); diff --git a/benchmark/infrastructure/BenchmarkToString.h b/benchmark/infrastructure/BenchmarkToString.h index f3ea1fbfef..fe85b62c1a 100644 --- a/benchmark/infrastructure/BenchmarkToString.h +++ b/benchmark/infrastructure/BenchmarkToString.h @@ -36,7 +36,7 @@ std::string getMetadataPrettyString(const BenchmarkMetadata& meta, std::string_view suffix); /* - * @brief Returns a formated string containing all the benchmark information. + * @brief Returns a formatted string containing all the benchmark information. */ std::string benchmarkResultsToString( const BenchmarkInterface* const benchmarkClass, diff --git a/benchmark/util/ResultTableColumnOperations.h b/benchmark/util/ResultTableColumnOperations.h index 175812679d..bf0ea96f6d 100644 --- a/benchmark/util/ResultTableColumnOperations.h +++ b/benchmark/util/ResultTableColumnOperations.h @@ -69,12 +69,12 @@ requires(sizeof...(ColumnInputTypes) > 1) void sumUpColumns( } /* -@brief Reads two floating point columns, calculates the relativ speedup between +@brief Reads two floating point columns, calculates the relative speedup between their entries and writes it in a third column. @param columnToCalculateFor, columnToCompareAgainst The columns, with which the question "How much faster than the entries of `columnToCompareAgainst` -are the entires of `columnToCalculateFor`?". +are the entries of `columnToCalculateFor`?". @param columnToPlaceResultIn This is where the speedup calculation results will be placed in. */ diff --git a/docs/quickstart.md.DEPRECATED b/docs/quickstart.md.DEPRECATED index 70aad6e13f..789b5ae4f8 100644 --- a/docs/quickstart.md.DEPRECATED +++ b/docs/quickstart.md.DEPRECATED @@ -37,7 +37,7 @@ for known issues such as problems with Docker on Mac. Then open [http://localhost:7001/](http://localhost:7001/) in your browser. -For example, all female scientists occuring in the text corpus with the regex +For example, all female scientists occurring in the text corpus with the regex "algo.*" can be obtained with the following query SELECT ?x TEXT(?t) SCORE(?t) WHERE { diff --git a/docs/sparql_plus_text.md b/docs/sparql_plus_text.md index 303bc16d7a..b7384cd704 100644 --- a/docs/sparql_plus_text.md +++ b/docs/sparql_plus_text.md @@ -1,7 +1,7 @@ # SPARQL+Text support in QLever QLever allows the combination of SPARQL and full-text search. The text input -consists of text records, where passages of the text are annotated by entitites +consists of text records, where passages of the text are annotated by entities from the RDF data. The format of the required input files is described below. In SPARQL+Text queries you can then specify co-occurrence of words from the text with entities from the RDF data. This is a very powerful concept: it contains diff --git a/e2e/e2e.sh b/e2e/e2e.sh index 665fd9c8e7..15ce50f44c 100755 --- a/e2e/e2e.sh +++ b/e2e/e2e.sh @@ -129,6 +129,6 @@ if [ $i -ge 60 ]; then exit 1 fi -echo "ServerMain was succesfully started, running queries ..." +echo "ServerMain was successfully started, running queries ..." $PYTHON_BINARY "$PROJECT_DIR/e2e/queryit.py" "$PROJECT_DIR/e2e/scientists_queries.yaml" "http://localhost:9099" | tee "$BINARY_DIR/query_log.txt" || bail "Querying Server failed" popd diff --git a/master.Makefile b/master.Makefile index f374d56f7d..d86950e313 100644 --- a/master.Makefile +++ b/master.Makefile @@ -8,7 +8,7 @@ SHELL = /bin/bash # This Makefile provides the following targets: # # pin: Pin queries to cache, so that all autocompletion queries are fast, even -# when "Clear cache" is clicked in the QLever UI (ther results for pinned +# when "Clear cache" is clicked in the QLever UI (the results for pinned # queries will never be removed, unless ... see target clear). # # clear: Clear the cache completely (including pinned results). Note that this @@ -17,7 +17,7 @@ SHELL = /bin/bash # clear-unpinned: Clear all unpinned results from the cache. This is exactly # what happens when clicking "Clear cache" in the QLever UI. # -# show-all-ac-queries: Show the AC queries for subject, predicat, object for +# show-all-ac-queries: Show the AC queries for subject, predicate, object for # copy&paste in the QLever UI backend settings. # This Makefile should be used as follows: @@ -57,7 +57,7 @@ CACHE_MAX_NUM_ENTRIES = 1000 # The URL of the QLever backend. QLEVER_API = https://qlever.cs.uni-freiburg.de/api/$(SLUG) -# The URL of the QLever UI istance ... TODO: it's confusing that this also has +# The URL of the QLever UI instance ... TODO: it's confusing that this also has # /api/ in the name, it actually has nothing to do with the URLs from the QLever # backends (which are defined in the Apache configuration of QLever). WARMUP_API = $(subst /api/,/api/warmup/,$(QLEVER_API)) @@ -112,7 +112,7 @@ show-config-default: CAT_TTL = cat $(DB).ttl index: - @if ls $(DB).index.* 1> /dev/null 2>&1; then echo -e "\033[31mIndex exists, delete it first with make remove_index, which would exeucte the following:\033[0m"; echo; make -sn remove_index; echo; else \ + @if ls $(DB).index.* 1> /dev/null 2>&1; then echo -e "\033[31mIndex exists, delete it first with make remove_index, which would execute the following:\033[0m"; echo; make -sn remove_index; echo; else \ time ( docker run -it --rm -v $(shell pwd):/index --entrypoint bash --name qlever.$(DB)-index $(DOCKER_IMAGE) -c "cd /index && $(CAT_TTL) | IndexBuilderMain -F ttl -f - -l -i $(DB) -K $(DB) $(TEXT_OPTIONS_INDEX) -s $(DB_BASE).settings.json | tee $(DB).index-log.txt"; rm -f $(DB)*tmp* ) \ fi diff --git a/misc/multiplicity-problem.txt b/misc/multiplicity-problem.txt index 26697a5d49..4473032524 100644 --- a/misc/multiplicity-problem.txt +++ b/misc/multiplicity-problem.txt @@ -38,7 +38,7 @@ this changes multiplicities from the join column is does not change in multiplicity, size and #distinct change equally: 2/2=1 the next column will also have the size lowered to 2, but the #distincts may or may not be lowered -in the last column, the size is lowered ot 2 and the #distincts HAS to be lowered, either to 2 or possibly even to 1 +in the last column, the size is lowered to 2 and the #distincts HAS to be lowered, either to 2 or possibly even to 1 what happen's in B: We keep every 500th row. diff --git a/misc/query_planning_and_text.txt b/misc/query_planning_and_text.txt index 39a03edd90..c4bb031534 100644 --- a/misc/query_planning_and_text.txt +++ b/misc/query_planning_and_text.txt @@ -4,7 +4,7 @@ IN-CONTEXT: The query planner creates a node for each triple and a scan for each node. This is not necessary for each in-context relation because several triples are worded in one operation. -The only pyhsical scan for a relation is the scan of the wordlists. +The only physical scan for a relation is the scan of the wordlists. Thus, only triples of the form in-context need a SCAN. Where WORDS can be literals, prefixes and also concrete entities. TODO: This will change when there is support for text without words. diff --git a/misc/reduce_ram_and_startup_time.txt b/misc/reduce_ram_and_startup_time.txt index 84c21dab7b..dc94b32936 100644 --- a/misc/reduce_ram_and_startup_time.txt +++ b/misc/reduce_ram_and_startup_time.txt @@ -1,21 +1,21 @@ 1. We can reduce RAM and startup time by not keeping all meta data in RAM. In general, but especially for OXX and also SXX permutation. Downside: -noticeable overhead for queries that are otherwise very fast (e.g. 1-5ms). We might end up with abotu as much overhead as well. +noticeable overhead for queries that are otherwise very fast (e.g. 1-5ms). We might end up with about as much overhead as well. higher overhead for joins with ?s ?p ?o triples, because there a larger number metadata objects many have to be read. HOWTO: The meta-data structure has to change: BlockMetaData has to be moved to its own area on disk to make RelationMetaData objects fixed-size. This should not have much downsides but requires significant rewriting effort. -From there, it should be rather striaghtforward and IndexMetaData->getRmd(...) -will now do the reading and construction of meta data objects too. Since we use them throughout hte query planning a LRU cache may be useful once again. +From there, it should be rather straightforward and IndexMetaData->getRmd(...) +will now do the reading and construction of meta data objects too. Since we use them throughout the query planning a LRU cache may be useful once again. IS THERE AN EASIER WAY TO SAVE RAM?: What happens if i just skip all literals in OXX permutations? --> not possible because I still want to do ?x ?p "Albert Einstein" -I could reduce usage of blocks even more, but there are already very few blocks in OXX permutations, the #obejct is simply so high. +I could reduce usage of blocks even more, but there are already very few blocks in OXX permutations, the #object is simply so high. --> not useful I could try to decrease the ID size diff --git a/src/engine/CartesianProductJoin.h b/src/engine/CartesianProductJoin.h index 872698f733..45338e1a6f 100644 --- a/src/engine/CartesianProductJoin.h +++ b/src/engine/CartesianProductJoin.h @@ -72,7 +72,7 @@ class CartesianProductJoin : public Operation { protected: // Don't promise any sorting of the result. // TODO Depending on the implementation we could propagate sorted - // columsn from either the first or the last input, but it is questionable if + // columns from either the first or the last input, but it is questionable if // there would be any real benefit from this and it would only increase the // complexity of the query planning and required testing. vector resultSortedOn() const override { return {}; } @@ -82,7 +82,7 @@ class CartesianProductJoin : public Operation { Result computeResult([[maybe_unused]] bool requestLaziness) override; // Copy each element from the `inputColumn` `groupSize` times to the - // `targetColumn`. Repeat until the `targetColumn` is copletely filled. Skip + // `targetColumn`. Repeat until the `targetColumn` is completely filled. Skip // the first `offset` write operations to the `targetColumn`. Call // `checkCancellation` after each write. If `StaticGroupSize != 0`, then the // group size is known at compile time which allows for more efficient loop diff --git a/src/engine/CountAvailablePredicates.cpp b/src/engine/CountAvailablePredicates.cpp index 052a9f9396..eaa4ffcbac 100644 --- a/src/engine/CountAvailablePredicates.cpp +++ b/src/engine/CountAvailablePredicates.cpp @@ -90,7 +90,7 @@ uint64_t CountAvailablePredicates::getSizeEstimateBeforeLimit() { size_t CountAvailablePredicates::getCostEstimate() { if (subtree_.get() != nullptr) { // Without knowing the ratio of elements that will have a pattern assuming - // constant cost per entry should be reasonable (altough non distinct + // constant cost per entry should be reasonable (although non distinct // entries are of course actually cheaper). return subtree_->getCostEstimate() + subtree_->getSizeEstimate(); } else { diff --git a/src/engine/GroupBy.cpp b/src/engine/GroupBy.cpp index 7067b9788e..9b7ca63e2a 100644 --- a/src/engine/GroupBy.cpp +++ b/src/engine/GroupBy.cpp @@ -125,7 +125,7 @@ vector GroupBy::computeSortColumns( // ____________________________________________________________________ VariableToColumnMap GroupBy::computeVariableToColumnMap() const { VariableToColumnMap result; - // The returned columns are all groupByVariables followed by aggregrates. + // The returned columns are all groupByVariables followed by aggregates. const auto& subtreeVars = _subtree->getVariableColumns(); size_t colIndex = 0; for (const auto& var : _groupByVariables) { diff --git a/src/engine/GroupBy.h b/src/engine/GroupBy.h index eb417a9d2d..6ec1886969 100644 --- a/src/engine/GroupBy.h +++ b/src/engine/GroupBy.h @@ -142,7 +142,7 @@ class GroupBy : public Operation { // } GROUP BY ?y // // NOTE: This is exactly what we need for a context-sensitive object AC query - // without connected triples. The GROUP BY variable can also be ommitted in + // without connected triples. The GROUP BY variable can also be omitted in // the SELECT clause. bool computeGroupByObjectWithCount(IdTable* result); diff --git a/src/engine/Join.h b/src/engine/Join.h index 716bb4c5c3..13f8d5cf8c 100644 --- a/src/engine/Join.h +++ b/src/engine/Join.h @@ -81,7 +81,7 @@ class Join : public Operation { * @brief Joins IdTables a and b on join column jc2, returning * the result in dynRes. Creates a cross product for matching rows. * - * This should be a switch, which shoud decide which algorithm to use for + * This should be a switch, which should decide which algorithm to use for * joining two IdTables. * The possible algorithms should be: * - The normal merge join. @@ -100,8 +100,8 @@ class Join : public Operation { * the result in dynRes. Creates a cross product for matching rows by putting * the smaller IdTable in a hash map and using that, to faster find the * matching rows. - * Needed to be a seperate function from the actual implementation, because - * compiler optimization keept inlining it, which make testing impossible, + * Needed to be a separate function from the actual implementation, because + * compiler optimization kept inlining it, which make testing impossible, * because you couldn't call the function after linking and just got * 'undefined reference' errors. * diff --git a/src/engine/LocalVocab.h b/src/engine/LocalVocab.h index 52ebf39f25..b8d167def4 100644 --- a/src/engine/LocalVocab.h +++ b/src/engine/LocalVocab.h @@ -14,9 +14,9 @@ #include "global/Id.h" #include "parser/LiteralOrIri.h" -// A class for maintaing a local vocabulary with contiguous (local) IDs. This is -// meant for words that are not part of the normal vocabulary (constructed from -// the input data at indexing time). +// A class for maintaining a local vocabulary with contiguous (local) IDs. This +// is meant for words that are not part of the normal vocabulary (constructed +// from the input data at indexing time). // class LocalVocab { private: diff --git a/src/engine/Minus.cpp b/src/engine/Minus.cpp index 529e685184..f3a3fd301b 100644 --- a/src/engine/Minus.cpp +++ b/src/engine/Minus.cpp @@ -99,7 +99,7 @@ void Minus::computeMinus( const IdTable& dynA, const IdTable& dynB, const std::vector>& joinColumns, IdTable* dynResult) const { - // Substract dynB from dynA. The result should be all result mappings mu + // Subtract dynB from dynA. The result should be all result mappings mu // for which all result mappings mu' in dynB are not compatible (one value // for a variable defined in both differs) or the domain of mu and mu' are // disjoint (mu' defines no solution for any variables for which mu defines a diff --git a/src/engine/Operation.cpp b/src/engine/Operation.cpp index 01b4f38461..3fc3ed925d 100644 --- a/src/engine/Operation.cpp +++ b/src/engine/Operation.cpp @@ -75,7 +75,7 @@ std::shared_ptr Operation::getResult( ad_utility::Timer timer{ad_utility::Timer::Started}; if (isRoot) { - // Reset runtime info, tests may re-use Operation objects. + // Reset runtime info, tests may reuse Operation objects. _runtimeInfo = std::make_shared(); // Start with an estimated runtime info which will be updated as we go. createRuntimeInfoFromEstimates(getRuntimeInfoPointer()); @@ -150,7 +150,7 @@ std::shared_ptr Operation::getResult( // `QueryPlanner` does currently only set the limit for operations that // support it natively, except for operations in subqueries. This means // that a lot of the time the limit is only artificially applied during - // export, allowing the cache to re-use the same operation for different + // export, allowing the cache to reuse the same operation for different // limits and offsets. if (!supportsLimit()) { ad_utility::timer::Timer limitTimer{ad_utility::timer::Timer::Started}; @@ -216,7 +216,7 @@ std::shared_ptr Operation::getResult( // Rethrow as QUERY_ABORTED allowing us to print the Operation // only at innermost failure of a recursive call throw ad_utility::AbortException( - "Unexpected expection that is not a subclass of std::exception"); + "Unexpected exception that is not a subclass of std::exception"); } } diff --git a/src/engine/Operation.h b/src/engine/Operation.h index 02f94dc155..ef43ee36af 100644 --- a/src/engine/Operation.h +++ b/src/engine/Operation.h @@ -259,7 +259,7 @@ class Operation { virtual Result computeResult(bool requestLaziness) = 0; // Create and store the complete runtime information for this operation after - // it has either been succesfully computed or read from the cache. + // it has either been successfully computed or read from the cache. virtual void updateRuntimeInformationOnSuccess( const ConcurrentLruCache::ResultAndCacheStatus& resultAndCacheStatus, Milliseconds duration) final; diff --git a/src/engine/QueryPlanner.cpp b/src/engine/QueryPlanner.cpp index ae69961573..a1978b3bd1 100644 --- a/src/engine/QueryPlanner.cpp +++ b/src/engine/QueryPlanner.cpp @@ -893,7 +893,7 @@ QueryPlanner::SubtreePlan QueryPlanner::getTextLeafPlan( if (node.triple_.p_._iri == CONTAINS_ENTITY_PREDICATE) { if (node._variables.size() == 2) { // TODO: This is not nice, refactor the whole TripleGraph class - // to make these checks more explicity. + // to make these checks more explicitly. Variable evar = *(node._variables.begin()) == cvar ? *(++node._variables.begin()) : *(node._variables.begin()); @@ -1161,8 +1161,8 @@ void QueryPlanner::applyTextLimitsIfPossible( if (((plan._idsOfIncludedNodes & textLimit.idsOfMustBeFinishedOperations_) ^ textLimit.idsOfMustBeFinishedOperations_) != 0) { - // Ther is still an operation that needs to be finished before this text - // limit can be applied + // There is still an operation that needs to be finished before this + // text limit can be applied i++; continue; } @@ -1532,7 +1532,7 @@ bool QueryPlanner::TripleGraph::isSimilar( LOG(INFO) << asString() << std::endl; LOG(INFO) << other.asString() << std::endl; LOG(INFO) << "Two nodes in this graph were matches to the same node in " - "the other grap" + "the other graph" << std::endl; return false; } diff --git a/src/engine/QueryPlanner.h b/src/engine/QueryPlanner.h index cff1059e64..2070eb885f 100644 --- a/src/engine/QueryPlanner.h +++ b/src/engine/QueryPlanner.h @@ -144,7 +144,7 @@ class QueryPlanner { size_t getSizeEstimate() const; }; - // A helper class to find connected componenents of an RDF query using DFS. + // A helper class to find connected components of an RDF query using DFS. class QueryGraph { private: // A simple class to represent a graph node as well as some data for a DFS. diff --git a/src/engine/Result.h b/src/engine/Result.h index 0ccc57ca61..5e66a998eb 100644 --- a/src/engine/Result.h +++ b/src/engine/Result.h @@ -163,6 +163,6 @@ class Result { // Check that if the `varColMap` guarantees that a column is always defined // (i.e. that is contains no single undefined value) that there are indeed no // undefined values in the `_idTable` of this result. Return `true` iff the - // check is succesful. + // check is successful. bool checkDefinedness(const VariableToColumnMap& varColMap); }; diff --git a/src/engine/Server.cpp b/src/engine/Server.cpp index 6be568d418..6b872a6255 100644 --- a/src/engine/Server.cpp +++ b/src/engine/Server.cpp @@ -330,7 +330,7 @@ Awaitable Server::process( response = createJsonResponse(json, request); } - // Ping with or without messsage. + // Ping with or without message. if (urlPathAndParameters._path == "/ping") { if (auto msg = checkParameter("msg", std::nullopt)) { LOG(INFO) << "Alive check with message \"" << msg.value() << "\"" @@ -568,7 +568,7 @@ Awaitable Server::sendStreamableResponse( // propagate it, and log it directly, so the code doesn't try to send // an HTTP response containing the error message onto a HTTP stream // that is already partially written. The only way to pass metadata - // after the beginning is by using the trailer mechanism as decribed + // after the beginning is by using the trailer mechanism as described // here: // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer#chunked_transfer_encoding_using_a_trailing_header // This won't be treated as an error by any regular HTTP client, so diff --git a/src/engine/SortPerformanceEstimator.h b/src/engine/SortPerformanceEstimator.h index ad5aad93c9..c643ea9c92 100644 --- a/src/engine/SortPerformanceEstimator.h +++ b/src/engine/SortPerformanceEstimator.h @@ -43,7 +43,7 @@ class SortPerformanceEstimator { size_t maxNumberOfElementsToSort); /// Set up the sort estimates. This will take some time. Only samples, that - /// can be allocated by the allocator and that have less thatn + /// can be allocated by the allocator and that have less than /// `maxNumberOfElementsToSort` elements will actually be measured. void computeEstimatesExpensively( const ad_utility::AllocatorWithLimit& allocator, @@ -61,7 +61,7 @@ class SortPerformanceEstimator { static constexpr size_t NUM_SAMPLES_COLS = sampleValuesCols.size(); static constexpr size_t NUM_SAMPLES_ROWS = sampleValuesRows.size(); - // The time in seconds for the samples that are sorted during initializtion. + // The time in seconds for the samples that are sorted during initialization. // _samples[i][j] is the measured time it takes to sort an IdTable with // sampleValuesRows[i] rows and sampleValuesCols[j] columns. // The values are default-initialized to 0. diff --git a/src/engine/TransitivePathBase.h b/src/engine/TransitivePathBase.h index 1fcfc56e2d..ce7c32ac3e 100644 --- a/src/engine/TransitivePathBase.h +++ b/src/engine/TransitivePathBase.h @@ -20,7 +20,7 @@ struct TransitivePathSide { // Column of the sub table where the Ids of this side are located size_t subCol_; std::variant value_; - // The column in the ouput table where this side Ids are written to. + // The column in the output table where this side Ids are written to. // This member is set by the TransitivePath class size_t outputCol_ = 0; @@ -270,8 +270,8 @@ class TransitivePathBase : public Operation { // Return a set of subtrees that can be used alternatively when the left or // right side is bound. This is used by the `TransitivePathBinSearch` class, - // which keeps both possible sortings of the predicate of which transitivity - // is computed. + // which has to store both ways to sort the subtree until it knows which side + // becomes bound. virtual std::span> alternativeSubtrees() const { return {}; diff --git a/src/engine/TransitivePathImpl.h b/src/engine/TransitivePathImpl.h index a4a116d9ce..ea4a7a8560 100644 --- a/src/engine/TransitivePathImpl.h +++ b/src/engine/TransitivePathImpl.h @@ -146,7 +146,8 @@ class TransitivePathImpl : public TransitivePathBase { if (minDist_ == 0 && !isBoundOrId() && lhs_.isVariable() && rhs_.isVariable()) { AD_THROW( - "This query might have to evalute the empty path, which is currently " + "This query might have to evaluate the empty path, which is " + "currently " "not supported"); } auto [startSide, targetSide] = decideDirection(); diff --git a/src/engine/idTable/CompressedExternalIdTable.h b/src/engine/idTable/CompressedExternalIdTable.h index d444db8e69..27b78c6121 100644 --- a/src/engine/idTable/CompressedExternalIdTable.h +++ b/src/engine/idTable/CompressedExternalIdTable.h @@ -469,7 +469,7 @@ class CompressedExternalIdTable // exactly once. auto getRows() { if (!this->transformAndPushLastBlock()) { - // For the case of only a single block we have to mimick the exact same + // For the case of only a single block we have to mimic the exact same // return type as that of `writer_.getGeneratorForAllRows()`, that's why // there are the seemingly redundant multiple calls to // join(OwningView(vector(...))). @@ -538,7 +538,7 @@ struct BlockSorter { #endif } }; -// Deduction guide for the implicit aggregate initializtion (its "constructor") +// Deduction guide for the implicit aggregate initialization (its "constructor") // in the aggregate above. Is actually not needed in C++20, but GCC 11 requires // it. template diff --git a/src/engine/idTable/IdTable.h b/src/engine/idTable/IdTable.h index 425735dcf4..c2eb10acaa 100644 --- a/src/engine/idTable/IdTable.h +++ b/src/engine/idTable/IdTable.h @@ -618,7 +618,7 @@ class IdTable { // first copies the sorted input completely, and then calls `std::unique`, // followed by `erase` at the end. `DISTINCT` should be implemented via an // out-of-place algorithm that only writes the distinct elements. The the - // follwing two functions can be deleted. + // following two functions can be deleted. void erase(const iterator& beginIt, const iterator& endIt) requires(!isView) { AD_EXPENSIVE_CHECK(begin() <= beginIt && beginIt <= endIt && endIt <= end()); diff --git a/src/engine/raw_thoughts.txt b/src/engine/raw_thoughts.txt index b37fbc6021..df5ebe05bb 100644 --- a/src/engine/raw_thoughts.txt +++ b/src/engine/raw_thoughts.txt @@ -3,7 +3,7 @@ Thoughts on open TODOS: TODO: Evaluate filters as early as possible. - A filter with one variable is essentially another relation on that var. - A filter with two variables will be applied as soon as both nodes are collapsed -Right now Filters with two varibales are implemented but they are processed in the end. +Right now Filters with two variables are implemented but they are processed in the end. This is possibly not optimal. Think of: ?x mother ?m @@ -78,7 +78,7 @@ FOR THE SIMPLE CASE ?x -- ?c [word] -SOLUTION: no longer as weired semantics. +SOLUTION: no longer as weird semantics. need to collapse the smallest subtrees behind the variable first, then use the words as extra info during the final consume. @@ -131,7 +131,7 @@ PROBLEM3: Two different results. With co-occurring entity and without depending I WANT: Due to problem3, I do NOT create execution trees for context nodes (easy to detect). Depending on the rest of the query graph / tree, there cannot be one optimal operation to compute the context node's result. -When consuming a context node, into a higher up, I create a TEXT OEPRATION forEntity. +When consuming a context node, into a higher up, I create a TEXT OPERATION forEntity. This will be a consumption of an edge with target context-node. I will later add relations that can also consume context nodes. Those will create a TEXT OPERATION forContexts and a context->document mapping (easy Broccoli style with ranges). diff --git a/src/engine/sparqlExpressions/LangExpression.h b/src/engine/sparqlExpressions/LangExpression.h index 9e1a6ac257..bad553f8db 100644 --- a/src/engine/sparqlExpressions/LangExpression.h +++ b/src/engine/sparqlExpressions/LangExpression.h @@ -28,8 +28,8 @@ class LangExpression : public SparqlExpression { // The following methods are required for the virtual interface of // `SparqlExpression`, but they will always fail at runtime when executed. All - // occurences of `LanguageExpression` should be detected and dealt with by the - // parser before any of these methods is ever called. + // occurrences of `LanguageExpression` should be detected and dealt with by + // the parser before any of these methods is ever called. ExpressionResult evaluate(EvaluationContext*) const override { AD_FAIL(); } std::string getCacheKey(const VariableToColumnMap&) const override { diff --git a/src/engine/sparqlExpressions/RegexExpression.h b/src/engine/sparqlExpressions/RegexExpression.h index a584a94707..783acc22db 100644 --- a/src/engine/sparqlExpressions/RegexExpression.h +++ b/src/engine/sparqlExpressions/RegexExpression.h @@ -65,8 +65,8 @@ class RegexExpression : public SparqlExpression { namespace detail { // Check if `regex` is a prefix regex which means that it starts with `^` and // contains no other "special" regex characters like `*` or `.`. If this check -// suceeds, the prefix is returned without the leading `^` and with all escaping -// undone. Else, `std::nullopt` is returned. +// succeeds, the prefix is returned without the leading `^` and with all +// escaping undone. Else, `std::nullopt` is returned. std::optional getPrefixRegex(std::string regex); } // namespace detail } // namespace sparqlExpression diff --git a/src/global/ValueId.h b/src/global/ValueId.h index 27b0263716..121a2bd6d4 100644 --- a/src/global/ValueId.h +++ b/src/global/ValueId.h @@ -125,7 +125,7 @@ class ValueId { // NOTE: (Also for the operator<=> below: These comparisons only work // correctly if we only store entries in the local vocab that are NOT part of // the vocabulary. This is currently not true for expression results from - // GROUP BY and BIND operations (for performance reaons). So a join with such + // GROUP BY and BIND operations (for performance reasons). So a join with such // results will currently lead to wrong results. constexpr bool operator==(const ValueId& other) const { if (getDatatype() == Datatype::LocalVocabIndex && diff --git a/src/index/CompressedRelation.h b/src/index/CompressedRelation.h index a1ccc0ce2e..1acfb7ebe3 100644 --- a/src/index/CompressedRelation.h +++ b/src/index/CompressedRelation.h @@ -522,7 +522,7 @@ class CompressedRelationReader { // Get the first and the last triple that the result of a `scan` with the // given arguments would lead to. Throw an exception if the scan result would // be empty. This function is used to more efficiently filter the blocks of - // index scans between joining them to get better estimates for the begginning + // index scans between joining them to get better estimates for the beginning // and end of incomplete blocks. MetadataAndBlocks::FirstAndLastTriple getFirstAndLastTriple( const MetadataAndBlocks& metadataAndBlocks) const; diff --git a/src/index/ConstantsIndexBuilding.h b/src/index/ConstantsIndexBuilding.h index 7ce99a6648..dd65b5cd7c 100644 --- a/src/index/ConstantsIndexBuilding.h +++ b/src/index/ConstantsIndexBuilding.h @@ -39,7 +39,7 @@ inline std::atomic BUFFER_SIZE_JOIN_PATTERNS_WITH_OSP = 50'000; // before they are written to the output. inline std::atomic BATCH_SIZE_VOCABULARY_MERGE = 10'000'000; -// When the BZIP2 parser encouters a parsing exception it will increase its +// When the BZIP2 parser encounters a parsing exception it will increase its // buffer and try again (we have no other way currently to determine if the // exception was "real" or only because we cut a statement in the middle. Once // it holds this many bytes in total, it will assume that there was indeed an @@ -82,7 +82,7 @@ constexpr size_t QUEUE_SIZE_BEFORE_PARALLEL_PARSING = 10; constexpr size_t QUEUE_SIZE_AFTER_PARALLEL_PARSING = 10; // The blocksize parameter of the parallel vocabulary merging. Higher values -// mean higher memory consumption, wherease a too low value will impact the +// mean higher memory consumption, whereas a too low value will impact the // performance negatively. static constexpr size_t BLOCKSIZE_VOCABULARY_MERGING = 100; diff --git a/src/index/Index.h b/src/index/Index.h index 60d19ba7eb..48c2717687 100644 --- a/src/index/Index.h +++ b/src/index/Index.h @@ -134,8 +134,8 @@ class Index { [[nodiscard]] const CompactVectorOfStrings& getPatterns() const; /** - * @return The multiplicity of the entites column (0) of the full has-relation - * relation after unrolling the patterns. + * @return The multiplicity of the entities column (0) of the full + * has-relation relation after unrolling the patterns. */ [[nodiscard]] double getAvgNumDistinctPredicatesPerSubject() const; diff --git a/src/index/IndexImpl.Text.cpp b/src/index/IndexImpl.Text.cpp index 6fd591b47e..68d1ab87d0 100644 --- a/src/index/IndexImpl.Text.cpp +++ b/src/index/IndexImpl.Text.cpp @@ -25,7 +25,7 @@ namespace { // Custom delimiter class for tokenization of literals using `absl::StrSplit`. // The `Find` function returns the next delimiter in `text` after the given -// `pos` or an empty subtring if there is no next delimiter. +// `pos` or an empty substring if there is no next delimiter. struct LiteralsTokenizationDelimiter { absl::string_view Find(absl::string_view text, size_t pos) { auto isWordChar = [](char c) -> bool { return std::isalnum(c); }; @@ -56,8 +56,8 @@ cppcoro::generator IndexImpl::wordsInTextRecords( contextId = contextId.incremented(); } } - // ROUND 2: Optionally, consider each literal from the interal vocabulary as a - // text record. + // ROUND 2: Optionally, consider each literal from the internal vocabulary as + // a text record. if (addWordsFromLiterals) { for (VocabIndex index = VocabIndex::make(0); index.get() < vocab_.size(); index = index.incremented()) { diff --git a/src/index/IndexImpl.cpp b/src/index/IndexImpl.cpp index 6d23931c0e..49b55cb763 100644 --- a/src/index/IndexImpl.cpp +++ b/src/index/IndexImpl.cpp @@ -33,10 +33,10 @@ using std::array; using namespace ad_utility::memory_literals; -// During the index building we typically have two permutation sortings present -// at the same time, as we directly push the triples from the first sorting to -// the second sorting. We therefore have to adjust the amount of memory per -// external sorter. +// During the index building we typically have two permutations present at the +// same time, as we directly push the triples from the first sorting to the +// second sorting. We therefore have to adjust the amount of memory per external +// sorter. static constexpr size_t NUM_EXTERNAL_SORTERS_AT_SAME_TIME = 2u; // _____________________________________________________________________________ @@ -152,7 +152,7 @@ std::unique_ptr> IndexImpl::buildOspWithPatterns( // the additional permutation. hasPatternPredicateSortedByPSO->moveResultOnMerge() = false; // The column with index 1 always is `has-predicate` and is not needed here. - // Note that the order of the columns during index building is alwasy `SPO`, + // Note that the order of the columns during index building is always `SPO`, // but the sorting might be different (PSO in this case). auto lazyPatternScan = lazyScanWithPermutedColumns( hasPatternPredicateSortedByPSO, std::array{0, 2}); @@ -1418,7 +1418,7 @@ namespace { // Return a lambda that is called repeatedly with triples that are sorted by the // `idx`-th column and counts the number of distinct entities that occur in a // triple where none of the elements fulfills the `isQleverInternalId` -// predicate. This is used to cound the number of distinct subjects, objects, +// predicate. This is used to count the number of distinct subjects, objects, // and predicates during the index building. template auto makeNumDistinctIdsCounter = diff --git a/src/index/IndexImpl.h b/src/index/IndexImpl.h index 57962104e2..10c6ff0c79 100644 --- a/src/index/IndexImpl.h +++ b/src/index/IndexImpl.h @@ -272,8 +272,8 @@ class IndexImpl { const CompactVectorOfStrings& getPatterns() const; /** - * @return The multiplicity of the Entites column (0) of the full has-relation - * relation after unrolling the patterns. + * @return The multiplicity of the Entities column (0) of the full + * has-relation relation after unrolling the patterns. */ double getAvgNumDistinctPredicatesPerSubject() const; @@ -611,7 +611,7 @@ class IndexImpl { private: /** * @brief Throws an exception if no patterns are loaded. Should be called from - * whithin any index method that returns data requiring the patterns + * within any index method that returns data requiring the patterns * file. */ void throwExceptionIfNoPatterns() const; diff --git a/src/index/IndexMetaData.h b/src/index/IndexMetaData.h index 32c5100f97..a3b4cdccd6 100644 --- a/src/index/IndexMetaData.h +++ b/src/index/IndexMetaData.h @@ -110,8 +110,8 @@ class IndexMetaData { // `isPersistentMetaData` is true when we do not need to add relation meta // data to data_, but assume that it is already contained in data_. This must - // be a compile time parameter because we have to avoid instantation of member - // function set() when `MapType` is read only (e.g., when based on + // be a compile time parameter because we have to avoid instantiation of + // member function set() when `MapType` is read only (e.g., when based on // MmapVectorView). template void add(AddType addedValue); @@ -132,7 +132,7 @@ class IndexMetaData { static const bool value = std::is_same::value || std::is_same::value; }; - // Compile time information whether this instatiation if MMapBased or not + // Compile time information whether this instantiation if MMapBased or not static constexpr bool isMmapBased_ = IsMmapBased::value; // This magic number is written when serializing the IndexMetaData to a file. diff --git a/src/index/MetaDataHandler.h b/src/index/MetaDataHandler.h index 6de4b6a856..1060f1143d 100644 --- a/src/index/MetaDataHandler.h +++ b/src/index/MetaDataHandler.h @@ -68,7 +68,7 @@ class MetaDataWrapperDense { MetaDataWrapperDense& operator=(MetaDataWrapperDense&& other) = default; // Templated setup version - // Arguments are passsed through to template argument M. + // Arguments are passed through to template argument M. // TODO: enable_if for better error messages template void setup(Args... args) { diff --git a/src/index/PatternCreator.h b/src/index/PatternCreator.h index 02349ef40b..7a044c5e34 100644 --- a/src/index/PatternCreator.h +++ b/src/index/PatternCreator.h @@ -111,8 +111,8 @@ class PatternCreator { ad_utility::BufferedVector tripleBuffer_; TripleSorter tripleSorter_; - // The predicates which have already occured in one of the patterns. Needed to - // count the number of distinct predicates. + // The predicates which have already occurred in one of the patterns. Needed + // to count the number of distinct predicates. ad_utility::HashSet distinctPredicates_; // The number of distinct subjects and distinct subject-predicate pairs. diff --git a/src/index/PrefixHeuristic.cpp b/src/index/PrefixHeuristic.cpp index 47ab3821ae..2353362f9c 100644 --- a/src/index/PrefixHeuristic.cpp +++ b/src/index/PrefixHeuristic.cpp @@ -84,7 +84,7 @@ TreeNode* TreeNode::insert(string_view value) { // ___________________________________________________________________________ std::pair TreeNode::getMaximum(size_t codelength) { - // _sharedCount = _ownCount + sum over childrens _sharedCount + // _sharedCount = _ownCount + sum over childrens' _sharedCount _sharedCount = _ownCount; // get Maximum score and node from all the children @@ -118,7 +118,7 @@ std::pair TreeNode::getMaximum(size_t codelength) { _score = _sharedCount * relevantLength; - // Check if our own score is greater than any of the childrens + // Check if our own score is greater than the score any of the childrens' // we choose >= so we get a valid pointer when there is only the root with // score 0 left. if (_score >= maxScore) { diff --git a/src/index/PrefixHeuristic.h b/src/index/PrefixHeuristic.h index c812429989..a7c783a050 100644 --- a/src/index/PrefixHeuristic.h +++ b/src/index/PrefixHeuristic.h @@ -21,7 +21,7 @@ // be added to every word, no matter if it is // actually compressed. (This is true for the // vocabulary in QLever). The Algorithm has to know -// this in order to chosse the correct prefixes. +// this in order to choose the correct prefixes. // // Returns: Vector of suitable prefixes which have been selected by the // algorithm diff --git a/src/index/vocabulary/CombinedVocabulary.h b/src/index/vocabulary/CombinedVocabulary.h index 117e9c2fa6..fb1efb76fc 100644 --- a/src/index/vocabulary/CombinedVocabulary.h +++ b/src/index/vocabulary/CombinedVocabulary.h @@ -136,7 +136,7 @@ class CombinedVocabulary { } // Return a global ID (sometimes just an index) that is the largest global ID - // occuring in either of the underlying vocabularies plus 1. This ID can be + // occurring in either of the underlying vocabularies plus 1. This ID can be // used as the "end" ID to indicate "not found". [[nodiscard]] uint64_t getEndIndex() const { uint64_t endA = _firstVocab.size() == 0 diff --git a/src/parser/ParallelBuffer.h b/src/parser/ParallelBuffer.h index fda663b0c6..79eb8f55c1 100644 --- a/src/parser/ParallelBuffer.h +++ b/src/parser/ParallelBuffer.h @@ -39,7 +39,7 @@ class ParallelBuffer { */ virtual void open(const string& filename) = 0; /** - * @brief Get (approximately) the next blocksize_ bytes from the inut stream. + * @brief Get (approximately) the next blocksize_ bytes from the input stream. * * Only valid after a call to open(). * diff --git a/src/parser/ParsedQuery.cpp b/src/parser/ParsedQuery.cpp index 7dcd07f39f..5c480e4a34 100644 --- a/src/parser/ParsedQuery.cpp +++ b/src/parser/ParsedQuery.cpp @@ -292,7 +292,7 @@ void ParsedQuery::GraphPattern::addLanguageFilter(const Variable& variable, // If necessary create an empty `BasicGraphPattern` at the end to which we // can append a triple. // TODO It might be beneficial to place this triple not at the - // end but close to other occurences of `variable`. + // end but close to other occurrences of `variable`. if (_graphPatterns.empty() || !std::holds_alternative( _graphPatterns.back())) { diff --git a/src/parser/SelectClause.cpp b/src/parser/SelectClause.cpp index bb32be05e0..92ec043c26 100644 --- a/src/parser/SelectClause.cpp +++ b/src/parser/SelectClause.cpp @@ -103,6 +103,6 @@ void SelectClause::deleteAliasesButKeepVariables() { } auto& varsAndAliases = std::get(varsAndAliasesOrAsterisk_); // The variables that the aliases are bound to have previously been stored - // seperately in `varsAndAliases.vars_`, so we can simply delete the aliases. + // separately in `varsAndAliases.vars_`, so we can simply delete the aliases. varsAndAliases.aliases_.clear(); } diff --git a/src/parser/Tokenizer.h b/src/parser/Tokenizer.h index 7d97bdcd09..74701f3afa 100644 --- a/src/parser/Tokenizer.h +++ b/src/parser/Tokenizer.h @@ -211,7 +211,7 @@ struct SkipWhitespaceAndCommentsMixin { void skipWhitespaceAndComments() { // Call `skipWhitespace` and `skipComments` in a loop until no more input // was consumed. This is necessary because we might have multiple lines of - // comments that are spearated by whitespace. + // comments that are separated by whitespace. while (true) { bool a = skipWhitespace(); bool b = skipComments(); diff --git a/src/parser/TokenizerCtre.h b/src/parser/TokenizerCtre.h index 6bded41e55..1801b448f1 100644 --- a/src/parser/TokenizerCtre.h +++ b/src/parser/TokenizerCtre.h @@ -330,10 +330,10 @@ class TokenizerCtre : public SkipWhitespaceAndCommentsMixin { } /* - * The helper struct used for the intenal apply function + * The helper struct used for the internal apply function * Its static function process(string_view) * tries to match a prefix of the string_view with the regex and returns - * on sucess and on failure + * on success and on failure */ struct Matcher { template diff --git a/src/parser/TurtleParser.cpp b/src/parser/TurtleParser.cpp index bdd7dbb096..c2496070bb 100644 --- a/src/parser/TurtleParser.cpp +++ b/src/parser/TurtleParser.cpp @@ -697,7 +697,7 @@ bool TurtleStreamParser::resetStateAndRead( byteVec_ = std::move(buf); tok_.reset(byteVec_.data(), byteVec_.size()); - LOG(TRACE) << "Succesfully decompressed next batch of " << nextBytes.size() + LOG(TRACE) << "Successfully decompressed next batch of " << nextBytes.size() << " << bytes to parser\n"; // repair the backup state, its pointers might have changed due to @@ -734,7 +734,7 @@ bool TurtleStreamParser::getLine(TurtleTriple* triple) { !isParserExhausted_) { bool parsedStatement; std::optional ex; - // If this buffer reads from an mmaped file, then exceptions are + // If this buffer reads from a memory-mapped file, then exceptions are // immediately rethrown. If we are reading from a stream in chunks of // bytes, we can try again with a larger buffer. try { @@ -751,7 +751,7 @@ bool TurtleStreamParser::getLine(TurtleTriple* triple) { // try to parse with a larger buffer and repeat the reading process // (maybe the failure was due to statements crossing our block). if (resetStateAndRead(&b)) { - // we have succesfully extended our buffer + // we have successfully extended our buffer if (byteVec_.size() > BZIP2_MAX_TOTAL_BUFFER_SIZE) { auto d = tok_.view(); LOG(ERROR) << "Could not parse " << PARSER_MIN_TRIPLES_AT_ONCE diff --git a/src/parser/sparqlParser/SparqlQleverVisitor.cpp b/src/parser/sparqlParser/SparqlQleverVisitor.cpp index 73db4d5c18..7dc9334726 100644 --- a/src/parser/sparqlParser/SparqlQleverVisitor.cpp +++ b/src/parser/sparqlParser/SparqlQleverVisitor.cpp @@ -1110,7 +1110,7 @@ vector Visitor::visit(Parser::ArgListContext* ctx) { if (ctx->NIL()) { return std::vector{}; } - // The grammar allows an optional DISTICT before the argument list (the + // The grammar allows an optional DISTINCT before the argument list (the // whole list, not the individual arguments), but we currently don't support // it. if (ctx->DISTINCT()) { diff --git a/src/util/AsyncStream.h b/src/util/AsyncStream.h index e5a0c281c9..b5d664d926 100644 --- a/src/util/AsyncStream.h +++ b/src/util/AsyncStream.h @@ -45,8 +45,8 @@ cppcoro::generator runStreamAsync( queue.finish(); }}; - // Only rethrow an exception from the `thread` if no exception occured in this - // thread to avoid crashes because of multiple active exceptions. + // Only rethrow an exception from the `thread` if no exception occurred in + // this thread to avoid crashes because of multiple active exceptions. auto cleanup = ad_utility::makeOnDestructionDontThrowDuringStackUnwinding( [&queue, &thread, &exception] { queue.finish(); diff --git a/src/util/Cache.h b/src/util/Cache.h index 648e3315d8..1c7eb5923c 100644 --- a/src/util/Cache.h +++ b/src/util/Cache.h @@ -478,7 +478,7 @@ class TreeBasedLRUCache }; /// typedef for the simple name LRUCache that is fixed to one of the possible -/// implementations at compiletime +/// implementations at compile time #ifdef _QLEVER_USE_TREE_BASED_CACHE template ValueSizeGetter> using LRUCache = TreeBasedLRUCache; diff --git a/src/util/CancellationHandle.h b/src/util/CancellationHandle.h index c928772eca..0e62a01c61 100644 --- a/src/util/CancellationHandle.h +++ b/src/util/CancellationHandle.h @@ -64,7 +64,7 @@ AD_ALWAYS_INLINE constexpr bool isCancelled( /// Helper struct to allow to conditionally compile fields into a class. struct Empty { - // Ignore potential assigment + // Ignore potential assignment template explicit Empty(const Args&...) {} }; diff --git a/src/util/ConfigManager/ConfigManager.cpp b/src/util/ConfigManager/ConfigManager.cpp index a4b7ab2813..12d7db1313 100644 --- a/src/util/ConfigManager/ConfigManager.cpp +++ b/src/util/ConfigManager/ConfigManager.cpp @@ -298,7 +298,7 @@ std::string ConfigManager::createJsonPointerString( std::ostringstream pointerString; // We don't use a `lazyStrJoin` here, so that an empty `keys` produces an - // emptry string. + // empty string. std::ranges::for_each( keys, [&escapeSpecialCharacters, &pointerString](std::string_view key) { pointerString << "/" << escapeSpecialCharacters(key); @@ -386,7 +386,7 @@ void ConfigManager::verifyPath(const std::vector& path) const { `some/options/optionA` in json pointer terms, but in string terms, because `"option"` is a prefix of `"options"`. - This can be fixed, by adding the seperator `/` at the end of both + This can be fixed, by adding the separator `/` at the end of both string representation. Because the symbol `/` is not allowed in `xi`, for `any i in [0, N]`, but must be between them, it forces all the `xi` and `yi` to be equal. diff --git a/src/util/ConfigManager/ConfigManager.h b/src/util/ConfigManager/ConfigManager.h index 9c9ddacbdd..63d44eed04 100644 --- a/src/util/ConfigManager/ConfigManager.h +++ b/src/util/ConfigManager/ConfigManager.h @@ -44,7 +44,7 @@ class ConfigManager { Our hash map always saves either a configuration option, or a sub manager (another `ConfigManager`). - This class makes the handeling more explicit and allows for more information + This class makes the handling more explicit and allows for more information to be saved alongside the configuration options and sub managers. For example: The order, in which they were created. */ @@ -285,13 +285,13 @@ class ConfigManager { /* @brief Returns a string containing a json configuration and, optionally, the - string representations of all added configuration options, togehter with the + string representations of all added configuration options, together with the validator invariants. @param detailed Iff false, only print the json configuration. Otherwise, print the json configuration, followed by the string representations of all added configuration options, which contain more detailed information about the - configuration options, togehter with the validator invariants + configuration options, together with the validator invariants */ std::string printConfigurationDoc(bool detailed) const; @@ -309,7 +309,7 @@ class ConfigManager { get thrown, if the `validatorFunction` returns false. @param validatorDescriptor A description of the invariant, that `validatorFunction` imposes. - @param configOptionsToBeChecked Proxies for the configuration options, whos + @param configOptionsToBeChecked Proxies for the configuration options, whose values will be passed to the validator function as function arguments. Will keep the same order. */ @@ -552,7 +552,7 @@ class ConfigManager { /* We can't just create a `ConfigOption` variable, pass it and return it, because the hash map has ownership of the newly added `ConfigOption`. - Which was transfered via creating a new internal `ConfigOption` with move + Which was transferred via creating a new internal `ConfigOption` with move constructors. Which would mean, that our local `ConfigOption` isn't the `ConfigOption` we want to return a reference to. diff --git a/src/util/ConfigManager/ConfigOption.cpp b/src/util/ConfigManager/ConfigOption.cpp index 42984f3d4d..26249649f7 100644 --- a/src/util/ConfigManager/ConfigOption.cpp +++ b/src/util/ConfigManager/ConfigOption.cpp @@ -70,7 +70,7 @@ bool ConfigOption::wasSet() const { void ConfigOption::setValueWithJson(const nlohmann::json& json) { // TODO Use "deducing this" for simpler recursive lambdas. /* - Manually checks, if the json represents one of the possibilites of + Manually checks, if the json represents one of the possibilities of `AvailableTypes`. */ auto isValueTypeSubType = [](const nlohmann::json& j, diff --git a/src/util/ConfigManager/ConfigOption.h b/src/util/ConfigManager/ConfigOption.h index b2abed3793..f80fd5183f 100644 --- a/src/util/ConfigManager/ConfigOption.h +++ b/src/util/ConfigManager/ConfigOption.h @@ -42,7 +42,7 @@ class ConfigOption { private: /* - Holds the type dependant data of the class, because the class is not a + Holds the type dependent data of the class, because the class is not a templated class, but sometimes behaves like one. */ template diff --git a/src/util/ConfigManager/Validator.h b/src/util/ConfigManager/Validator.h index f0d68cfad8..8400332b31 100644 --- a/src/util/ConfigManager/Validator.h +++ b/src/util/ConfigManager/Validator.h @@ -30,7 +30,7 @@ concept ValidatorFunction = RegularInvocableWithSimilarReturnType; // Simple struct, that holds an error message. For use as the return type of -// invocable object, that fullfill `ExceptionValidator`. +// invocable object, that fulfill `ExceptionValidator`. struct ErrorMessage { private: std::string message_; @@ -100,7 +100,7 @@ class ConfigOptionValidatorManager { */ std::function wrappedValidatorFunction_; - // A descripton of the invariant, this validator imposes. + // A description of the invariant, this validator imposes. std::string descriptor_; // Pointer to the `configOption`, that will be checked. diff --git a/src/util/ConstexprUtils.h b/src/util/ConstexprUtils.h index d53745ee28..90b40e6ab8 100644 --- a/src/util/ConstexprUtils.h +++ b/src/util/ConstexprUtils.h @@ -18,7 +18,7 @@ namespace ad_utility { // Compute `base ^ exponent` where `^` denotes exponentiation. This is consteval // because for all runtime calls, a better optimized algorithm from the standard // library should be chosen. -// TODO why can't this be consteval when the result is boudn to a +// TODO why can't this be consteval when the result is bound to a // `constexpr` variable? constexpr auto pow(auto base, int exponent) { if (exponent < 0) { diff --git a/src/util/CopyableUniquePtr.h b/src/util/CopyableUniquePtr.h index 08e37f7bf1..f3cc4cbe2f 100644 --- a/src/util/CopyableUniquePtr.h +++ b/src/util/CopyableUniquePtr.h @@ -14,8 +14,8 @@ namespace ad_utility { /* -A version of `std::unique_ptr` with a copy assigment operator and a copy -constructor, which both copy the dereferenced pointer to create a new instace +A version of `std::unique_ptr` with a copy assignment operator and a copy +constructor, which both copy the dereferenced pointer to create a new instance of the object for the `unique_ptr`. Currently not written with support for dynamically-allocated array of objects in mind, so that may not work. diff --git a/src/util/CryptographicHashUtils.h b/src/util/CryptographicHashUtils.h index 7345666da4..90094d355a 100644 --- a/src/util/CryptographicHashUtils.h +++ b/src/util/CryptographicHashUtils.h @@ -35,23 +35,23 @@ inline constexpr auto hexFormatter = [](std::string* out, char c) { return absl::AlphaNumFormatter()(out, absl::Hex(c, absl::kZeroPad2)); }; -// `HashMd5` takes an arguement of type `std::string_view` and provides +// `HashMd5` takes an argument of type `std::string_view` and provides // a Hex value by applying `EVP_md5()` from the openssl library as a result. constexpr auto hashMd5 = hashImpl<&EVP_md5, MD5_DIGEST_LENGTH>; -// `HashSha1` takes an arguement of type `std::string_view` and provides +// `HashSha1` takes an argument of type `std::string_view` and provides // a Hex by applying `EVP_sha1()` from the openssl library as a result. constexpr auto hashSha1 = hashImpl<&EVP_sha1, SHA_DIGEST_LENGTH>; -// `HashSha256` takes an arguement of type `std::string_view` and provides +// `HashSha256` takes an argument of type `std::string_view` and provides // a Hex by applying `EVP_sha256()` from the openssl library as a result. constexpr auto hashSha256 = hashImpl<&EVP_sha256, SHA256_DIGEST_LENGTH>; -// `HashSha384` takes an arguement of type `std::string_view` and provides +// `HashSha384` takes an argument of type `std::string_view` and provides // a Hex by applying `EVP_sha384()` from the openssl library as a result. constexpr auto hashSha384 = hashImpl<&EVP_sha384, SHA384_DIGEST_LENGTH>; -// `HashSha512` takes an arguement of type `std::string_view` and provides +// `HashSha512` takes an argument of type `std::string_view` and provides // a Hex by applying `EVP_sha512()` from the openssl library as a result. constexpr auto hashSha512 = hashImpl<&EVP_sha512, SHA512_DIGEST_LENGTH>; diff --git a/src/util/Date.h b/src/util/Date.h index 0999506eba..51f0ac7c78 100644 --- a/src/util/Date.h +++ b/src/util/Date.h @@ -192,7 +192,7 @@ class Date { /// Convert a `uint64_t` to a `Date`. This is only valid if the `uint64_t` was /// obtained via a call to `Date::toBits()`. This just casts the underlying - /// representaion. + /// representation. static constexpr Date fromBits(uint64_t bytes) { return std::bit_cast(bytes); } @@ -413,7 +413,7 @@ class DateOrLargeYear { // format used by Wikidata). std::pair toStringAndType() const; - // The bitwise comparison also correpsonds to the semantic ordering of years + // The bitwise comparison also corresponds to the semantic ordering of years // and dates. auto operator<=>(const DateOrLargeYear&) const = default; diff --git a/src/util/Exception.h b/src/util/Exception.h index 18278c75d7..a317a02350 100644 --- a/src/util/Exception.h +++ b/src/util/Exception.h @@ -102,7 +102,7 @@ std::string getMessageImpl( } // Helper function used to format the arguments passed to `AD_CONTRACT_CHECK` -// etc. Return "" followed by +// etc. Return "" followed by // a full stop and space if there is at least one message. std::string concatMessages(auto&&... messages) { if constexpr (sizeof...(messages) == 0) { diff --git a/src/util/File.h b/src/util/File.h index b895c01d84..cde77a4aaf 100644 --- a/src/util/File.h +++ b/src/util/File.h @@ -222,7 +222,7 @@ Stream makeFilestream(const std::filesystem::path& path, auto&&... args) { } // namespace detail // Open and return a std::ifstream from a given filename and optional -// additionals `args`. Throw an exception stating the filename and the absolute +// additional `args`. Throw an exception stating the filename and the absolute // path when the file can't be opened. std::ifstream makeIfstream(const std::filesystem::path& path, auto&&... args) { return detail::makeFilestream(path, AD_FWD(args)...); diff --git a/src/util/JoinAlgorithms/JoinAlgorithms.h b/src/util/JoinAlgorithms/JoinAlgorithms.h index 12e39859f4..5b3e9de8d9 100644 --- a/src/util/JoinAlgorithms/JoinAlgorithms.h +++ b/src/util/JoinAlgorithms/JoinAlgorithms.h @@ -158,7 +158,7 @@ template (const T& row) { if constexpr (isSimilar && @@ -662,7 +662,7 @@ class BlockAndSubrange { // A helper struct for the zipper join on blocks algorithm (see below). It // combines the current iterator, then end iterator, the relevant projection to -// obtain the input to the comparsion, and a buffer for blocks that are +// obtain the input to the comparison, and a buffer for blocks that are // currently required by the join algorithm for one side of the join. template struct JoinSide { diff --git a/src/util/MemorySize/MemorySize.h b/src/util/MemorySize/MemorySize.h index 7fe86be8ad..59d7e47a19 100644 --- a/src/util/MemorySize/MemorySize.h +++ b/src/util/MemorySize/MemorySize.h @@ -66,7 +66,7 @@ class MemorySize { /* Factory functions for creating an instance of this class with the wanted - memory size saved internally. Always requries the exact memory size unit and + memory size saved internally. Always requires the exact memory size unit and size wanted. */ template @@ -175,7 +175,7 @@ constexpr ConstexprMap numBytesPerUnit( /* Helper function for dividing two instances of `size_t`. Needed, because there is no `std` division function, that takes unconverted -`size_t`.This tends to lead to error and unprecise results. This function +`size_t`.This tends to lead to error and imprecise results. This function however, should be about as precise as possible, when having the return type `double`. */ @@ -222,7 +222,7 @@ template constexpr size_t convertMemoryUnitsToBytes(const T amountOfUnits, std::string_view unitName) { if constexpr (std::is_signed_v) { - // Negativ values makes no sense. + // Negative values makes no sense. AD_CONTRACT_CHECK(amountOfUnits >= 0); } @@ -267,7 +267,7 @@ multiplied/divied with. `MemorySize` records. It will be given the amount of bytes in `m`, followed by `c` for this calculation. Both will either have been cast to `size_t`, or `double.` Note, that the rounding and casting to `size_t` for floating point -return types will be automaticly done, and can be ignored by `func`. +return types will be automatically done, and can be ignored by `func`. */ template requires std::invocable || @@ -289,7 +289,7 @@ constexpr MemorySize magicImplForDivAndMul(const MemorySize& m, const T c, template constexpr MemorySize MemorySize::bytes(T numBytes) { if constexpr (std::is_signed_v) { - // Doesn't make much sense to a negativ amount of memory. + // Doesn't make much sense to a negative amount of memory. AD_CONTRACT_CHECK(numBytes >= 0); } diff --git a/src/util/MmapVector.h b/src/util/MmapVector.h index 9f99af080e..447f219834 100644 --- a/src/util/MmapVector.h +++ b/src/util/MmapVector.h @@ -161,13 +161,13 @@ class MmapVector { } // create Array of given size fill with default value - // file contents will be overriden if existing! + // file contents will be overridden if existing! // allows read and write access void open(size_t size, const T& defaultValue, string filename, AccessPattern pattern = AccessPattern::None); - // create unititialized array of given size at path specified by filename - // file will be created or overriden! + // create uninitialized array of given size at path specified by filename + // file will be created or overridden! // allows read and write access void open(size_t size, string filename, AccessPattern pattern = AccessPattern::None); @@ -305,7 +305,7 @@ class MmapVectorView : private MmapVector { // ____________________________________________________ size_t size() const { return MmapVector::size(); } - // default constructor, leaves an unitialized vector that will throw until a + // default constructor, leaves an uninitialized vector that will throw until a // valid call to open() MmapVectorView() = default; @@ -342,8 +342,8 @@ class MmapVectorView : private MmapVector { open(filename, pattern); } - // explicitly close the vector to an unitialized state and free the associated - // ressources + // explicitly close the vector to an uninitialized state and free the + // associated resources void close(); // destructor diff --git a/src/util/MmapVectorImpl.h b/src/util/MmapVectorImpl.h index 79dc53a698..8584cb9b17 100644 --- a/src/util/MmapVectorImpl.h +++ b/src/util/MmapVectorImpl.h @@ -82,7 +82,7 @@ template void MmapVector::mapForReading() { // open to get valid file descriptor int orig_fd = ::open(_filename.c_str(), O_RDONLY); - // TODO: check if MAP_SHARED is necessary/usefule + // TODO: check if MAP_SHARED is necessary/useful void* ptr = mmap(nullptr, _bytesize, PROT_READ, MAP_SHARED, orig_fd, 0); AD_CONTRACT_CHECK(ptr != MAP_FAILED); diff --git a/src/util/PriorityQueue.h b/src/util/PriorityQueue.h index 0a4dd08af5..bbf4359be6 100644 --- a/src/util/PriorityQueue.h +++ b/src/util/PriorityQueue.h @@ -153,7 +153,7 @@ class TreeBasedPQ { /** * Update the key of a value in the HeapBasedPQ * @param newKey - * @param handle inout parameter, will be changed to be a valid handle after + * @param handle in/out parameter, will be changed to be a valid handle after * the operation has finished. * @throws NotInPQException if the handle does not point into the PQ (because * of pop or erase operations) @@ -241,7 +241,7 @@ class HeapBasedPQ { const Value& value() const { return mData->mValue; } Value& value() { return mData->mValue; } - // was the value asociated with this handle already deleted because of an + // was the value associated with this handle already deleted because of an // erase operation bool isValid() const { return (mData->mScore).index() == 1; }; @@ -370,7 +370,7 @@ class HeapBasedPQ { * associated with the handle * * @param newKey - * @param handle Inout parameter: Updated s.t. it stays valid. + * @param handle in/out parameter: Updated s.t. it stays valid. * @throws NotInPQException if the handle does not point into the PQ (because * of pop or erase operations) */ diff --git a/src/util/Serializer/Serializer.h b/src/util/Serializer/Serializer.h index b66a49d94b..574604ed90 100644 --- a/src/util/Serializer/Serializer.h +++ b/src/util/Serializer/Serializer.h @@ -144,7 +144,7 @@ static constexpr bool SerializerMatchesConstness = requires(Constraint) void serialize(S& serializer, T&& arg) /// Similar to `AD_SERIALIZE_FUNCTION_WITH_CONSTRAINT` but only for -/// `WriteSerializer`s. For an exmple usage see `SerializeVector.h` +/// `WriteSerializer`s. For an example usage see `SerializeVector.h` #define AD_SERIALIZE_FUNCTION_WITH_CONSTRAINT_WRITE(Constraint) \ template \ requires(Constraint) void serialize(S& serializer, T&& arg) diff --git a/src/util/Simple8bCode.h b/src/util/Simple8bCode.h index 2a97848b8e..ff13bfb8e9 100644 --- a/src/util/Simple8bCode.h +++ b/src/util/Simple8bCode.h @@ -127,7 +127,7 @@ class Simple8bCode { } // Check that the max value (60 bit) is not exceeded. // I put it here to same some for this check, otherwise we must - // for each elements in hte plaintext do this check. + // for each elements in the plaintext do this check. assert(get(nofElementsEncoded + nofItemsInWord) <= 0x0FFFFFFFFFFFFFFF); } } diff --git a/src/util/StringUtils.cpp b/src/util/StringUtils.cpp index c81f496ed5..9ccfbb7a7d 100644 --- a/src/util/StringUtils.cpp +++ b/src/util/StringUtils.cpp @@ -155,7 +155,7 @@ size_t findLiteralEnd(const std::string_view input, } } - // if we have found any unescaped occurence of literalEnd, return the last + // if we have found any unescaped occurrence of literalEnd, return the last // of these positions if (lastFoundPos != size_t(-1)) { return lastFoundPos; diff --git a/src/util/StringUtils.h b/src/util/StringUtils.h index c7191b37c7..0ee68289c6 100644 --- a/src/util/StringUtils.h +++ b/src/util/StringUtils.h @@ -94,7 +94,7 @@ size_t findLiteralEnd(std::string_view input, std::string_view literalEnd); @brief Add elements of the range to a stream, with the `separator` between the elements. -@tparam Range An input range, whos dereferenced iterators can be inserted into +@tparam Range An input range, whose dereferenced iterators can be inserted into streams. @param separator Will be put between each of the string representations @@ -191,7 +191,7 @@ void lazyStrJoin(std::ostream* stream, Range&& r, std::string_view separator) { return; } - // Add the first entry without a seperator. + // Add the first entry without a separator. *stream << *begin; // Add the remaining entries. @@ -259,7 +259,7 @@ std::string insertThousandSeparator(const std::string_view str, /* For walking over the string view. Our initialization value skips the leading digits, so that only the digits - remain, where we have to put the seperator in front of every three chars. + remain, where we have to put the separator in front of every three chars. */ size_t currentIdx{s.length() % 3 == 0 ? 3 : s.length() % 3}; ostream << s.substr(0, currentIdx); diff --git a/src/util/SuppressWarnings.h b/src/util/SuppressWarnings.h index fd128d7fea..1f90b85c97 100644 --- a/src/util/SuppressWarnings.h +++ b/src/util/SuppressWarnings.h @@ -12,7 +12,7 @@ // really sure that the suppressed warnings are false positives and that there // is no feasible way to avoid them. -// Macros to disable and reenable certain warnings on GCC13. Currently some +// Macros to disable and re-enable certain warnings on GCC13. Currently some // (valid) uses of `std::sort` trigger a false positive `-Warray-bounds` // warning. It is important that there is a corresponding `ENABLE_...` macro // issued for every `DISABLE_...` macro. diff --git a/src/util/Synchronized.h b/src/util/Synchronized.h index 04c08dcd6a..d699e612ca 100644 --- a/src/util/Synchronized.h +++ b/src/util/Synchronized.h @@ -107,7 +107,7 @@ class Synchronized { * type, return the result. * * Note that return type deduction is done via auto which means, - * that no references are passed out. This happens deliberatly as + * that no references are passed out. This happens deliberately as * passing out references to the underlying type would ignore the locking. */ template @@ -146,7 +146,7 @@ class Synchronized { * return the result. * * Note that return type deduction is done via auto which means, - * that no references are passed out. This happens deliberatly as + * that no references are passed out. This happens deliberately as * passing out references to the underlying type would ignore the locking. * Only supported if the mutex allows shared locking and the * function type F only treats its object as const. diff --git a/src/util/TaskQueue.h b/src/util/TaskQueue.h index 40d6f80c5e..878f13c70e 100644 --- a/src/util/TaskQueue.h +++ b/src/util/TaskQueue.h @@ -58,7 +58,7 @@ class TaskQueue { /// "pusher" is faster for many tasks, the queue will grow too large to fit /// into memory. The task queue will work optimally, when on the average the /// workers are at least as fast as the "pusher", but the pusher is faster - /// sometimes (which the queue can then accomodate). + /// sometimes (which the queue can then accommodate). TaskQueue(size_t maxQueueSize, size_t numThreads, std::string name = "") : queueMaxSize_{maxQueueSize}, name_{std::move(name)} { AD_CONTRACT_CHECK(queueMaxSize_ > 0); diff --git a/src/util/TupleForEach.h b/src/util/TupleForEach.h index 96910cd00a..a0fef421cb 100644 --- a/src/util/TupleForEach.h +++ b/src/util/TupleForEach.h @@ -16,7 +16,7 @@ void forEachInTuple(Tuple&& tuple, Function&& function) { std::apply(forEachInParamPack, std::forward(tuple)); } -/// Apply the `function` to each element of the `tuple`. Retur an `array` of +/// Apply the `function` to each element of the `tuple`. Return an `array` of /// the results. The function is applied on the tuple elements sequentially /// from left to right. /// \param tuple must be a std::tuple<...>. diff --git a/src/util/TupleHelpers.h b/src/util/TupleHelpers.h index 90a37e94f2..675d031af5 100644 --- a/src/util/TupleHelpers.h +++ b/src/util/TupleHelpers.h @@ -44,7 +44,7 @@ auto setupTupleFromCallable(F&& f) { * toUniquePtrTuple(int(3), std::string("foo")) == * std::tuple(std::make_unique(3), std::make_unique("foo")) It * can take an arbitrary positive number of arguments. Currently this template - * is linearly expanded, if this becomes a bottleneck at compiletime (e.g. for + * is linearly expanded, if this becomes a bottleneck at compile time (e.g. for * very long parameter packs) we could do something more intelligent. * @return std::tuple(std::make_unique(std::forward(l), * std::make_unique constexpr static bool isArray> = true; -// `SimilarToArray` is also true for `std::aray<...>&`, etc. +// `SimilarToArray` is also true for `std::array<...>&`, etc. template concept SimilarToArray = isArray>; diff --git a/src/util/http/HttpClient.cpp b/src/util/http/HttpClient.cpp index 1f7429255d..82cea0b6b8 100644 --- a/src/util/http/HttpClient.cpp +++ b/src/util/http/HttpClient.cpp @@ -21,7 +21,7 @@ namespace net = boost::asio; using tcp = boost::asio::ip::tcp; using ad_utility::httpUtils::Url; -// Implemented using Boost.Beast, code apapted from +// Implemented using Boost.Beast, code adapted from // https://www.boost.org/doc/libs/master/libs/beast/example/http/client/sync/http_client_sync.cpp // https://www.boost.org/doc/libs/master/libs/beast/example/http/client/sync-ssl/http_client_sync_ssl.cpp diff --git a/src/util/http/HttpClient.h b/src/util/http/HttpClient.h index 45daecff34..a526412f6a 100644 --- a/src/util/http/HttpClient.h +++ b/src/util/http/HttpClient.h @@ -40,7 +40,7 @@ class HttpClientImpl { ~HttpClientImpl(); // Send a request (the first argument must be either `http::verb::get` or - // `http::verb::post`) and return the body of the reponse (possibly very + // `http::verb::post`) and return the body of the response (possibly very // large) as an `cppcoro::generator`. The same connection // can be used for multiple requests in a row. cppcoro::generator> sendRequest( diff --git a/src/util/http/HttpUtils.cpp b/src/util/http/HttpUtils.cpp index 93ac1d9294..cae479d54f 100644 --- a/src/util/http/HttpUtils.cpp +++ b/src/util/http/HttpUtils.cpp @@ -13,7 +13,7 @@ namespace ad_utility::httpUtils { // The regex for parsing the components of a URL. We need it also as a string -// (for error messagin) and CTRE has no function for printing a regex as a +// (for error messaging) and CTRE has no function for printing a regex as a // a string, hence the two variables. static constexpr char urlRegexString[] = "^(http|https)://([^:/]+)(:([0-9]+))?(/.*)?$"; diff --git a/src/util/http/MediaTypes.h b/src/util/http/MediaTypes.h index da53387f04..43a809e33b 100644 --- a/src/util/http/MediaTypes.h +++ b/src/util/http/MediaTypes.h @@ -47,7 +47,7 @@ struct MediaTypeWithQuality { float _qualityValue; Variant _mediaType; - // Order first by the qualities, and then by the specifity of the type. + // Order first by the qualities, and then by the specificity of the type. std::partial_ordering operator<=>(const MediaTypeWithQuality& rhs) const { if (auto cmp = _qualityValue <=> rhs._qualityValue; cmp != 0) { return cmp; diff --git a/src/util/http/websocket/WebSocketSession.cpp b/src/util/http/websocket/WebSocketSession.cpp index 202c5033f0..75e6e4402d 100644 --- a/src/util/http/websocket/WebSocketSession.cpp +++ b/src/util/http/websocket/WebSocketSession.cpp @@ -122,7 +122,7 @@ net::awaitable WebSocketSession::handleSession( queryRegistry, std::move(queryId)}; // There is currently no safe way of which we know that allows us to respawn // the coroutine onto another thread AND make it safely cancellable at the - // same time. Therfore we just assert that the cancellation slot is not + // same time. Therefore we just assert that the cancellation slot is not // connected. auto slot = (co_await net::this_coro::cancellation_state).slot(); AD_CORRECTNESS_CHECK(!slot.is_connected()); diff --git a/test/AlgorithmTest.cpp b/test/AlgorithmTest.cpp index aa613e492f..485f6930cc 100644 --- a/test/AlgorithmTest.cpp +++ b/test/AlgorithmTest.cpp @@ -31,7 +31,8 @@ TEST(Algorithm, Contains) { std::vector substrings{"h", "a", "l", "ha", "al", "hal"}; ASSERT_TRUE(std::ranges::all_of( substrings, [&s](const auto& el) { return contains(s, el); })); - std::vector noSubstrings{"x", "hl", "hel"}; + std::vector noSubstrings{"x", "hl", + "hel"}; // codespell-ignore ASSERT_TRUE(std::ranges::none_of( noSubstrings, [&s](const auto& el) { return contains(s, el); })); } @@ -40,7 +41,8 @@ TEST(Algorithm, Contains) { "ha", "al", "hal"}; ASSERT_TRUE(std::ranges::all_of( substrings, [&s](const auto& el) { return contains(s, el); })); - std::vector noSubstrings{"x", "hl", "hel"}; + std::vector noSubstrings{"x", "hl", + "hel"}; // codespell-ignore ASSERT_TRUE(std::ranges::none_of( noSubstrings, [&s](const auto& el) { return contains(s, el); })); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f9956cecaf..1aace8bca3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,7 @@ function (linkTest basename) qlever_target_link_libraries(${basename} ${ARGN} GTest::gtest GTest::gmock_main testUtil ${CMAKE_THREAD_LIBS_INIT}) endfunction() -# Add the exectutable ${basename} that is compiled from the source file +# Add the executable ${basename} that is compiled from the source file # "${basename}".cpp function (addTest basename) add_executable(${basename} "${basename}.cpp") diff --git a/test/CacheTest.cpp b/test/CacheTest.cpp index d28e992016..885c652ed6 100644 --- a/test/CacheTest.cpp +++ b/test/CacheTest.cpp @@ -69,7 +69,7 @@ TEST(LRUCacheTest, testSimpleMapUsage) { ASSERT_EQ(*cache["5"], "xxxxx"); // Non-existing elements must yield shared_ptr(nullptr) // this bool converts to false - ASSERT_FALSE(cache["non-existant"]); + ASSERT_FALSE(cache["non-existent"]); } // _____________________________________________________________________________ TEST(LRUCacheTest, testSimpleMapUsageWithDrop) { @@ -133,7 +133,7 @@ TEST(LRUCacheTest, testDecreasingCapacity) { cache.insert("9", "xxxxxxxxx"); cache.setMaxNumEntries(2); ASSERT_EQ(*cache["9"], "xxxxxxxxx"); // freshly inserted - ASSERT_EQ(*cache["5"], "xxxxx"); // second leat recently used + ASSERT_EQ(*cache["5"], "xxxxx"); // second least recently used ASSERT_FALSE(cache["1"]); ASSERT_FALSE(cache["2"]); ASSERT_FALSE(cache["3"]); diff --git a/test/ConfigManagerTest.cpp b/test/ConfigManagerTest.cpp index 3c5131ee91..0d90283201 100644 --- a/test/ConfigManagerTest.cpp +++ b/test/ConfigManagerTest.cpp @@ -129,8 +129,8 @@ TEST(ConfigManagerTest, AddConfigurationOptionExceptionTest) { /* Trying to add a configuration option, whose entire path is a prefix of the path of an already added sub manager, should cause an exception. After all, - this would imply, that the sub manger is part of this new option. Which is not - supported at the moment. + this would imply, that the sub manager is part of this new option. Which is + not supported at the moment. */ config.addSubManager({"sub"s, "manager"s}) .addOption("someOpt"s, "", ¬Used, 42); @@ -139,8 +139,8 @@ TEST(ConfigManagerTest, AddConfigurationOptionExceptionTest) { /* Trying to add a configuration option, who contains the entire path of an - already added sub manger as prefix, should cause an exception. After all, such - recursive builds should have been done on `C++` level, not json level. + already added sub manager as prefix, should cause an exception. After all, + such recursive builds should have been done on `C++` level, not json level. */ AD_EXPECT_THROW_WITH_MESSAGE( config.addOption({"sub"s, "manager"s, "someOption"s}, "", ¬Used, 42), @@ -148,7 +148,7 @@ TEST(ConfigManagerTest, AddConfigurationOptionExceptionTest) { /* Trying to add a configuration option, whose path is the path of an already - added sub manger, should cause an exception. + added sub manager, should cause an exception. */ AD_EXPECT_THROW_WITH_MESSAGE( config.addOption({"sub"s, "manager"s}, "", ¬Used, 42), @@ -178,7 +178,7 @@ TEST(ConfigManagerTest, AddConfigurationOptionFalseExceptionTest) { The reasons, why it's not allowed, are basically the same. In the past, it was possible to cause path collisions even though there - weren't any, by having paths, which json pointer representation fullfilled the + weren't any, by having paths, which json pointer representation fulfilled the conditions for one of the cases. For example: It should be possible, to have one option under `[prefixes]` and one under `[prefixes-eternal]`. But, because `/prefixes` is a prefix of @@ -261,8 +261,8 @@ TEST(ConfigManagerTest, addSubManagerExceptionTest) { /* Trying to add a sub manager, whose entire path is a prefix of the path of an - already added sub manger, should cause an exception. After all, such recursive - builds should have been done on `C++` level, not json level. + already added sub manager, should cause an exception. After all, such + recursive builds should have been done on `C++` level, not json level. */ AD_EXPECT_THROW_WITH_MESSAGE( config.addSubManager({"Shared_part"s, "Unique_part_1"s}), @@ -280,7 +280,7 @@ TEST(ConfigManagerTest, addSubManagerExceptionTest) { R"('\[Shared_part\]\[Unique_part_1\]\[Sense_of_existence\]\[Answer\]\[42\]')")); /* - Trying to add a sub manger, whose entire path is a prefix of the path of an + Trying to add a sub manager, whose entire path is a prefix of the path of an already added config option, should cause an exception. After all, such recursive builds should have been done on `C++` level, not json level. */ @@ -291,8 +291,8 @@ TEST(ConfigManagerTest, addSubManagerExceptionTest) { /* Trying to add a sub manager, who contains the entire path of an already added config option as prefix, should cause an exception. - After all, this would imply, that the sub manger is part of this option. Which - is not supported at the moment. + After all, this would imply, that the sub manager is part of this option. + Which is not supported at the moment. */ AD_EXPECT_THROW_WITH_MESSAGE( config.addSubManager({"some"s, "option"s, "manager"s}), @@ -330,7 +330,7 @@ TEST(ConfigManagerTest, AddSubManagerFalseExceptionTest) { The reasons, why it's not allowed, are basically the same. In the past, it was possible to cause path collisions even though there - weren't any, by having paths, which json pointer representation fullfilled the + weren't any, by having paths, which json pointer representation fulfilled the conditions for one of the cases. For example: It should be possible, to have one sub manager under `[prefixes]` and one under `[prefixes-eternal]`. But, because `/prefixes` is a prefix of @@ -1034,7 +1034,7 @@ TEST(ConfigManagerTest, HumanReadableAddValidator) { return (one && !two && !three) || (!one && two && !three) || (!one && !two && three); }, - "Exactly one bool must be choosen.", "", boolOneOption, boolTwoOption, + "Exactly one bool must be chosen.", "", boolOneOption, boolTwoOption, boolThreeOption); checkValidator( m, @@ -1042,7 +1042,7 @@ TEST(ConfigManagerTest, HumanReadableAddValidator) { R"--({"numberInRange" : 60, "boolOne": true, "boolTwo": false, "boolThree": false})--"), nlohmann::json::parse( R"--({"numberInRange" : 60, "boolOne": true, "boolTwo": true, "boolThree": false})--"), - "Exactly one bool must be choosen."); + "Exactly one bool must be chosen."); } // Human readable examples for `addOptionValidator` with `Validator` functions. @@ -1094,7 +1094,7 @@ TEST(ConfigManagerTest, HumanReadableAddOptionValidator) { /* @brief Generate an informative validator name in the form of `Config manager validator y`. With `x` being the list of function argument types and `y` an -unqiue number id. +unique number id. @tparam Ts The types of the function arguments of the validator function. @@ -1167,7 +1167,7 @@ void doValidatorTest( /* @brief Adjust `variant` argument for `createDummyValueForValidator` and `generateDummyNonExceptionValidatorFunction`. - The bool type in those helper functions needs special handeling, because it + The bool type in those helper functions needs special handling, because it only has two values and can't fulfill the invariant, that `createDummyValueForValidator` and `generateDummyNonExceptionValidatorFunction` should fulfill. @@ -1218,7 +1218,7 @@ void doValidatorTest( /* @brief Test all validator functions generated by `addValidatorToConfigManager` for a given range of `variant` and a specific configuration of `Ts`. Note: - This is for specificly for testing the validators generated by calling + This is for specifically for testing the validators generated by calling `addValidatorToConfigManager` with a all values in `[variantStart, variantEnd)` as `variant` and all other arguments unchanged. @@ -1633,8 +1633,8 @@ void doValidatorTest( ConfigManager& managerToAddValidatorTo, ConstConfigOptionProxy option, const nlohmann::json::json_pointer& pathToOption) { - // The value, which causes the automaticly generated validator with the - // given variant to fail. + // The value, which causes the automatically generated validator with + // the given variant to fail. const std::string& failValue = createDummyValueForValidator(variantNumber); @@ -1695,7 +1695,7 @@ void doValidatorTest( nlohmann::json::json_pointer("/some/manager/someValue1")); /* - Reseting `mValidatorSubValidatorOption1`, so that the validator, that was + Resetting `mValidatorSubValidatorOption1`, so that the validator, that was added via `doExceptionMessageTest`, not longer fails. We can not use an r-value nlohmann json object for this, because there is no @@ -2475,7 +2475,7 @@ TEST(ConfigManagerTest, ConfigurationDocValidatorAssignment) { /* Generate the `ConfigOption`, together with their validators. Note: We do not - need working `ConfigOption`. As long as they exists, everythings fine. + need working `ConfigOption`. As long as they exists, everything fine. */ const auto configOptionKeysAndValidators{createKeyAndValidatorPairVector( []() { @@ -2486,7 +2486,7 @@ TEST(ConfigManagerTest, ConfigurationDocValidatorAssignment) { /* Generate the `ConfigManager`, together with their validators. Note: We do not - need working `ConfigManager`. As long as they exists, everythings fine. + need working `ConfigManager`. As long as they exists, everything fine. */ const auto configManagerKeysAndValidators{createKeyAndValidatorPairVector( []() { return ConfigManager{}; }, NUM_CONFIG_MANAGER)}; diff --git a/test/CopyableUniquePtrTest.cpp b/test/CopyableUniquePtrTest.cpp index f243493e35..5e5eb729a7 100644 --- a/test/CopyableUniquePtrTest.cpp +++ b/test/CopyableUniquePtrTest.cpp @@ -75,7 +75,7 @@ TEST(CopyableUniquePtr, CopyAndMoveConstructor) { { ad_utility::CopyableUniquePtr nonEmptyPointer( ad_utility::make_copyable_unique(42)); - // Saving the adress of the int object, so that we can later check, that + // Saving the address of the int object, so that we can later check, that // it was actually moved. int* const intAdress = nonEmptyPointer.get(); diff --git a/test/GroupByTest.cpp b/test/GroupByTest.cpp index 8906fef14e..101bb842df 100644 --- a/test/GroupByTest.cpp +++ b/test/GroupByTest.cpp @@ -454,10 +454,10 @@ struct GroupByOptimizations : ::testing::Test { } static SparqlExpressionPimpl makeGroupConcatPimpl( - const Variable& var, const std::string& seperator = " ") { + const Variable& var, const std::string& separator = " ") { return SparqlExpressionPimpl{ std::make_unique( - false, makeVariableExpression(var), seperator), + false, makeVariableExpression(var), separator), "GROUP_CONCAT(?someVariable)"}; } @@ -1226,7 +1226,7 @@ TEST_F(GroupByOptimizations, hashMapOptimizationGroupConcatIndex) { auto groupConcatExpression2 = makeGroupConcatPimpl(varY, ","); auto aliasGC2 = Alias{groupConcatExpression2, varW}; - // SELECT (GROUP_CONCAT(?y) as ?z) (GROUP_CONCAT(?y;seperator=",") as ?w) + // SELECT (GROUP_CONCAT(?y) as ?z) (GROUP_CONCAT(?y;separator=",") as ?w) // WHERE {...} GROUP BY ?x GroupBy groupBy{qec, variablesOnlyX, {aliasGC1, aliasGC2}, subtreeWithSort}; auto result = groupBy.getResult(); diff --git a/test/IdTableHelpersTest.cpp b/test/IdTableHelpersTest.cpp index 01fad0c817..2bae9888c7 100644 --- a/test/IdTableHelpersTest.cpp +++ b/test/IdTableHelpersTest.cpp @@ -187,7 +187,7 @@ TEST(IdTableHelpersTest, createRandomlyFilledIdTableWithoutGenerators) { // The overloads that take generators for creating the content of the join // columns. TEST(IdTableHelpersTest, createRandomlyFilledIdTableWithGeneratos) { - // Creates a 'generator', that counts one up, everytime it's called. + // Creates a 'generator', that counts one up, every time it's called. auto createCountUpGenerator = []() { return [i = 0]() mutable { return ad_utility::testing::VocabId(i++); }; }; @@ -284,7 +284,7 @@ TEST(IdTableHelpersTest, createRandomlyFilledIdTableWithGeneratos) { TEST(IdTableHelpersTest, generateIdTable) { /* - Creates a 'generator', that returns a row of the given lenght, were every + Creates a 'generator', that returns a row of the given length, were every entry contains the same number. The number starts with 0 and goes on up with every call. */ diff --git a/test/IdTableTest.cpp b/test/IdTableTest.cpp index b4fb384a72..9e0c03dc78 100644 --- a/test/IdTableTest.cpp +++ b/test/IdTableTest.cpp @@ -67,7 +67,7 @@ TEST(IdTable, DocumentationOfIteratorUsage) { // The following calls do not change the table, but are also not expected to // do so because we explicitly bind to a `value_type`. { - IdTable::row_type row = t[0]; // Explitly copy/materialize the full row. + IdTable::row_type row = t[0]; // Explicitly copy/materialize the full row. row[0] = V(50); // We have changed the copied row, but not the table. ASSERT_EQ(V(50), row[0]); @@ -76,7 +76,7 @@ TEST(IdTable, DocumentationOfIteratorUsage) { { // Exactly the same example, but with `iterator`s and `iterator_traits`. std::iterator_traits::value_type row = - *t.begin(); // Explitly copy/materialize the full row. + *t.begin(); // Explicitly copy/materialize the full row. row[0] = V(51); // We have changed the copied row, but not the table. ASSERT_EQ(V(51), row[0]); @@ -254,7 +254,7 @@ void runTestForDifferentTypes(auto testCase, std::string testCaseName) { // to be made. It is necessary because for some `IdTable` instantiations // (for example when the data is stored in a `BufferedVector`) the `clone` // member function needs additional arguments. Currently, the only additional -// argument is the filenmae for the copy for `IdTables` that store their data in +// argument is the filename for the copy for `IdTables` that store their data in // a `BufferedVector`. For an example usage see the test cases below. auto clone(const auto& table, auto... args) { if constexpr (requires { table.clone(); }) { diff --git a/test/JsonCustomConverterForThirdPartyTest.cpp b/test/JsonCustomConverterForThirdPartyTest.cpp index 937e8e6316..d16c5f2b35 100644 --- a/test/JsonCustomConverterForThirdPartyTest.cpp +++ b/test/JsonCustomConverterForThirdPartyTest.cpp @@ -121,7 +121,7 @@ TEST(JsonCustomConverterForThirdParty, StdVariant) { doSimpleTest(std::monostate{}, (int)42); doSimpleTest((float)4.2777422, std::monostate{}); - // There is a custom exception, should the index for a value tpye be not + // There is a custom exception, should the index for a value type be not // valid. That is, to big, or to small. j["index"] = -1; ASSERT_THROW(variant = j.get(), nlohmann::detail::out_of_range); @@ -160,11 +160,11 @@ TEST(JsonCustomConverterForThirdParty, pointer = j.get(); }; - // Uniqe pointer doesn't own an object. + // Unique pointer doesn't own an object. doCheckPreparation(nullptr, std::make_unique(42)); ASSERT_EQ(pointer.get(), nullptr); - // Uniqe pointer owns an object. + // Unique pointer owns an object. doCheckPreparation(std::make_unique(42), nullptr); ASSERT_NE(pointer.get(), nullptr); ASSERT_EQ(*pointer, 42); diff --git a/test/NBitIntegerTest.cpp b/test/NBitIntegerTest.cpp index 5609ab2985..0a004375f0 100644 --- a/test/NBitIntegerTest.cpp +++ b/test/NBitIntegerTest.cpp @@ -93,7 +93,7 @@ auto testTranslationNearLimits = []() { // to(b))))`, when `to` is `NBitInteger::toNBit` and `from` is the // corresponding `fromNBit`. This tests the (well-defined) behavior of the // `NBitInteger`s in the presence of overflows. The `wouldOverflow(a, b)` -// function must return `true` if `f(a, b)` would overlow, leading to undefined +// function must return `true` if `f(a, b)` would overflow, leading to undefined // behavior. In those cases, the result `i(f(u(a), u(b))` is evaluated instead // of `f(a, b)`, where `i` is a cast to int64_t and `u` is a cast to `uint64_t`. // The behavior of this operation is well-defined because unsigned integer diff --git a/test/PriorityQueueTest.cpp b/test/PriorityQueueTest.cpp index 8ef15aa189..6c78acd977 100644 --- a/test/PriorityQueueTest.cpp +++ b/test/PriorityQueueTest.cpp @@ -96,11 +96,11 @@ TEST(PqTest, TreeUpdateReinsert) { ASSERT_EQ(pq.size(), 0ul); ASSERT_THROW(pq.updateKey(15, &h), ad_utility::NotInPQException); ASSERT_EQ(pq.size(), 0ul); - auto h2 = pq.insert(500, "alot"s); + auto h2 = pq.insert(500, "alot"s); // codespell-ignore ASSERT_EQ(pq.size(), 1ul); h = pq.pop(); ASSERT_EQ(h.score(), 500); - ASSERT_EQ(h.value(), "alot"s); + ASSERT_EQ(h.value(), "alot"s); // codespell-ignore }; TreeBasedPQ pq; test(pq); diff --git a/test/RandomTest.cpp b/test/RandomTest.cpp index 4e845c7909..d66389d28a 100644 --- a/test/RandomTest.cpp +++ b/test/RandomTest.cpp @@ -162,7 +162,7 @@ TEST(RandomNumberGeneratorTest, SlowRandomIntGenerator) { seed}; }); - // For use withing the range tests. + // For use within the range tests. const std::vector> ranges{ {4ul, 7ul}, {200ul, 70171ul}, {71747ul, 1936556173ul}}; @@ -181,7 +181,7 @@ TEST(RandomNumberGeneratorTest, RandomDoubleGenerator) { std::numeric_limits::max(), seed}; }); - // For use withing the range tests. + // For use within the range tests. const std::vector> ranges{ {4.74717, 7.4}, {-200.0771370, -70.77713}, {-71747.6666, 1936556173.}}; diff --git a/test/ResultTableColumnOperationsTest.cpp b/test/ResultTableColumnOperationsTest.cpp index c260439811..a04ac895ff 100644 --- a/test/ResultTableColumnOperationsTest.cpp +++ b/test/ResultTableColumnOperationsTest.cpp @@ -61,7 +61,7 @@ static void compareToColumn( // For generating better messages, when failing a test. auto trace{generateLocationTrace(l, "compareToColumn")}; - // Compare every entry with the fitting comparsion function. + // Compare every entry with the fitting comparison function. AD_CONTRACT_CHECK(expectedContent.size() == tableToCompareAgainst.numRows()); for (size_t i = 0; i < expectedContent.size(); i++) { if constexpr (std::floating_point) { @@ -333,7 +333,7 @@ TEST(ResultTableColumnOperations, calculateSpeedupOfColumn) { ad_utility::SlowRandomIntGenerator rowGenerator( 0, table.numRows() - 1); - // Test things trough for all possible input and output columns. + // Test things through for all possible input and output columns. for (size_t outputColumn = 0; outputColumn < table.numColumns(); outputColumn++) { for (size_t firstInputColumn = 0; diff --git a/test/SelectClauseTest.cpp b/test/SelectClauseTest.cpp index a86f6704a2..26eceb0e93 100644 --- a/test/SelectClauseTest.cpp +++ b/test/SelectClauseTest.cpp @@ -1,6 +1,6 @@ // Copyright 2022, University of Freiburg, // Chair of Algorithms and Data Structures. -// Autor: +// Author: // 2022 - Johannes Kalmbach (kalmbach@informatik.uni-freiburg.de) #include "engine/sparqlExpressions/LiteralExpression.h" diff --git a/test/SerializerTest.cpp b/test/SerializerTest.cpp index edc2fea6b5..0ea8b1266b 100644 --- a/test/SerializerTest.cpp +++ b/test/SerializerTest.cpp @@ -165,7 +165,7 @@ TEST(Serializer, SimpleExample) { A a{}; // Uninitialized, we will read into it; serialization::FileReadSerializer reader{filename}; reader >> a; - // We have succesfully restored the values. + // We have successfully restored the values. ASSERT_EQ(a.a, 42); ASSERT_EQ(a.b, -5); } @@ -425,7 +425,7 @@ TEST(Serializer, Array) { testWithAllSerializers(testNonTriviallyCopyableDatatype); } -// Test that we can succesfully write `string_view`s to a serializer and +// Test that we can successfully write `string_view`s to a serializer and // correctly read them as `string`s. TEST(Serializer, StringViewToString) { auto testString = [](auto&& writer, auto makeReaderFromWriter) { diff --git a/test/SparqlAntlrParserTestHelpers.h b/test/SparqlAntlrParserTestHelpers.h index af89918a88..6092eb6485 100644 --- a/test/SparqlAntlrParserTestHelpers.h +++ b/test/SparqlAntlrParserTestHelpers.h @@ -794,7 +794,7 @@ inline auto SelectQuery = namespace pq { -// This is implemented as a separater Matcher because it generates some overhead +// This is implemented as a separated Matcher because it generates some overhead // in the tests. inline auto OriginalString = [](const std::string& originalString) -> Matcher { diff --git a/test/SparqlExpressionTest.cpp b/test/SparqlExpressionTest.cpp index f82781a191..9b1a9e2a4c 100644 --- a/test/SparqlExpressionTest.cpp +++ b/test/SparqlExpressionTest.cpp @@ -1083,7 +1083,7 @@ TEST(SparqlExpression, ReplaceExpression) { IdOrLiteralOrIri{lit("(?i)[ei]")}, IdOrLiteralOrIri{lit("x")}}); - // Multiple matches withing the same string + // Multiple matches within the same string checkReplace( IdOrLiteralOrIri{lit("wEeDEflE")}, std::tuple{IdOrLiteralOrIri{lit("weeeDeeflee")}, diff --git a/test/StringSortComparatorTest.cpp b/test/StringSortComparatorTest.cpp index 6546b1786c..ade2178ae0 100644 --- a/test/StringSortComparatorTest.cpp +++ b/test/StringSortComparatorTest.cpp @@ -90,7 +90,7 @@ TEST(StringSortComparatorTest, TripleComponentComparatorQuarternary) { ASSERT_TRUE(comp("\"Hannibal\"@en", "\"HanNibal\"@en")); - // something is not smaller thant itself + // something is not smaller than itself ASSERT_FALSE(comp("\"beta\"", "\"beta\"")); // Testing that latin and Hindi numbers mean exactly the same up to the @@ -170,7 +170,7 @@ TEST(StringSortComparatorTest, TripleComponentComparatorTotal) { assertTrue("\"Hannibal\"@en", "\"HanNibal\"@en"); - // something is not smaller thant itself + // something is not smaller than itself assertFalse("\"beta\"", "\"beta\""); // Testing that latin and Hindi numbers mean exactly the same up to the @@ -205,7 +205,7 @@ TEST(StringSortComparatorTest, SimpleStringComparator) { ASSERT_TRUE(comp("alpha", "ALPHA")); ASSERT_FALSE(comp("ALPHA", "alpha")); - // something is not smaller thant itself + // something is not smaller than itself ASSERT_FALSE(comp("beta", "beta")); ASSERT_TRUE(comp("\"@u2", "@u2")); diff --git a/test/StringUtilsTest.cpp b/test/StringUtilsTest.cpp index 5c1b6b92f4..9a7968994c 100644 --- a/test/StringUtilsTest.cpp +++ b/test/StringUtilsTest.cpp @@ -319,7 +319,7 @@ TEST(StringUtilsTest, findLiteralEnd) { using namespace ad_utility; EXPECT_EQ(findLiteralEnd("nothing", "\""), std::string_view::npos); EXPECT_EQ(findLiteralEnd("no\"thing", "\""), 2u); - EXPECT_EQ(findLiteralEnd("no\\\"thi\"ng", "\""), 7u); + EXPECT_EQ(findLiteralEnd("no\\\"thi\"ng", "\""), 7u); // codespell-ignore EXPECT_EQ(findLiteralEnd("no\\\\\"thing", "\""), 4u); } diff --git a/test/SynchronizedTest.cpp b/test/SynchronizedTest.cpp index fc5341bcb7..1d1db77d9f 100644 --- a/test/SynchronizedTest.cpp +++ b/test/SynchronizedTest.cpp @@ -249,8 +249,9 @@ TEST(Synchronized, SFINAE) { // Outcommenting this does not compile and cannot be brought to compile // without making usage of the Synchronized classes "withWriteLock" method - // unecessarily hard. static_assert(!AllowsNonConstExclusiveAccessLambda>::value); + // unnecessarily hard. + // static_assert(!AllowsNonConstExclusiveAccessLambda>::value); static_assert(AllowsConstExclusiveAccessLambda< const Synchronized>::value); static_assert(AllowsConstSharedAccessLambda< @@ -269,8 +270,9 @@ TEST(Synchronized, SFINAE) { // Outcommenting this does not compile and cannot be brought to compile // without making usage of the Synchronized classes "withWriteLock" method - // unecessarily hard. static_assert(!AllowsNonConstExclusiveAccessLambda>::value); + // unnecessarily hard. + // static_assert(!AllowsNonConstExclusiveAccessLambda>::value); static_assert(AllowsConstExclusiveAccessLambda< const Synchronized>::value); static_assert(!AllowsConstSharedAccessLambda< diff --git a/test/TransitivePathTest.cpp b/test/TransitivePathTest.cpp index 4e82a65202..651faa9442 100644 --- a/test/TransitivePathTest.cpp +++ b/test/TransitivePathTest.cpp @@ -476,9 +476,9 @@ TEST_P(TransitivePathTest, zeroLengthException) { left, right, 0, std::numeric_limits::max()); AD_EXPECT_THROW_WITH_MESSAGE( T->computeResultOnlyForTesting(), - ::testing::ContainsRegex( - "This query might have to evalute the empty path, which is currently " - "not supported")); + ::testing::ContainsRegex("This query might have to evaluate the empty " + "path, which is currently " + "not supported")); } INSTANTIATE_TEST_SUITE_P(TransitivePathTestSuite, TransitivePathTest, diff --git a/test/VocabularyGeneratorTest.cpp b/test/VocabularyGeneratorTest.cpp index 35b357ba07..d44f156f18 100644 --- a/test/VocabularyGeneratorTest.cpp +++ b/test/VocabularyGeneratorTest.cpp @@ -34,7 +34,7 @@ bool vocabTestCompare(const IdPairMMapVecView& a, auto V = ad_utility::testing::VocabId; } // namespace -// Test fixture that sets up the binary files vor partial vocabulary and +// Test fixture that sets up the binary files for partial vocabulary and // everything else connected with vocabulary merging. class MergeVocabularyTest : public ::testing::Test { protected: @@ -71,7 +71,7 @@ class MergeVocabularyTest : public ::testing::Test { "lead to test failures\n"; } - // make paths abolute under created tmp directory + // make paths absolute under created tmp directory _path0 = _basePath + _path0; _path1 = _basePath + _path1; _pathVocabExp = _basePath + std::string(".vocabExp"); diff --git a/test/VocabularyTestHelpers.h b/test/VocabularyTestHelpers.h index 6a46b67229..33c17fd50f 100644 --- a/test/VocabularyTestHelpers.h +++ b/test/VocabularyTestHelpers.h @@ -102,8 +102,8 @@ void testUpperAndLowerBoundContiguousIDs(const auto& vocab, auto makeWordLarger, words, ids); } -// Same as the previous function, but explictly state, which IDs are expected in -// the vocabulary. +// Same as the previous function, but explicitly state, which IDs are expected +// in the vocabulary. void testUpperAndLowerBoundWithStdLessFromWordsAndIds(auto vocabulary, const auto& words, const auto& ids) { @@ -183,7 +183,7 @@ void testUpperAndLowerBoundWithNumericComparator(auto createVocabulary) { // Checks that vocabulary[ids[i]] == words[i]. auto testAccessOperatorFromWordsAndIds(auto vocabulary, const auto& words, const auto& ids) { - // Not in any particulary order. + // Not in any particularly order. AD_CONTRACT_CHECK(words.size() == ids.size()); ASSERT_EQ(words.size(), vocabulary.size()); for (size_t i = 0; i < words.size(); ++i) { @@ -193,7 +193,7 @@ auto testAccessOperatorFromWordsAndIds(auto vocabulary, const auto& words, // Check that the `operator[]` works as expected for an unordered vocabulary, // created via `createVocabulary(std::vector)`. auto testAccessOperatorForUnorderedVocabulary(auto createVocabulary) { - // Not in any particulary order. + // Not in any particularly order. const std::vector words{"alpha", "delta", "ALPHA", "beta", "42", "31", "0a", "a0", "al"}; std::vector ids; diff --git a/test/engine/CartesianProductJoinTest.cpp b/test/engine/CartesianProductJoinTest.cpp index 4ef4897242..f07bb11218 100644 --- a/test/engine/CartesianProductJoinTest.cpp +++ b/test/engine/CartesianProductJoinTest.cpp @@ -115,7 +115,7 @@ TEST(CartesianProductJoin, computeResult) { {1, 3, 5}}, {{{0}, {1}}, {{2}, {3}}, {{4}, {5}}}); - // Heterogenous sizes. + // Heterogeneous sizes. testCartesianProduct( {{0, 2, 4}, {1, 2, 4}, {0, 2, 5}, {1, 2, 5}, {0, 2, 6}, {1, 2, 6}}, {{{0}, {1}}, {{2}}, {{4}, {5}, {6}}}); diff --git a/test/engine/TextIndexScanForEntityTest.cpp b/test/engine/TextIndexScanForEntityTest.cpp index e7d593da48..f2e8bcd611 100644 --- a/test/engine/TextIndexScanForEntityTest.cpp +++ b/test/engine/TextIndexScanForEntityTest.cpp @@ -124,7 +124,7 @@ TEST(TextIndexScanForEntity, CacheKeys) { TextIndexScanForEntity s8{qec, Variable{"?text7"}, newFixedEntity, "sentences"}; - // Same text var, same fixed entitiy, different words + // Same text var, same fixed entity, different words ASSERT_NE(s7.getCacheKeyImpl(), s8.getCacheKeyImpl()); } diff --git a/test/util/AsyncTestHelpers.h b/test/util/AsyncTestHelpers.h index 6a02c449b7..b94daef0e9 100644 --- a/test/util/AsyncTestHelpers.h +++ b/test/util/AsyncTestHelpers.h @@ -93,7 +93,7 @@ void runAsyncTest(Func innerRun, size_t numThreads) { // Drop-in replacement for gtest's TEST() macro, but for tests that make // use of boost asio's awaitable coroutines. Note that this prevents you -// from using ASSERT_* macros unless you redefine the return keword with +// from using ASSERT_* macros unless you redefine the return keyword with // co_return so it works nicely with the coroutine. #define ASYNC_TEST(test_suite_name, test_name) \ ASYNC_TEST_N(test_suite_name, test_name, 1) diff --git a/test/util/IdTableHelpers.cpp b/test/util/IdTableHelpers.cpp index 78d7c966ba..d643476256 100644 --- a/test/util/IdTableHelpers.cpp +++ b/test/util/IdTableHelpers.cpp @@ -1,6 +1,6 @@ // Copyright 2023, University of Freiburg, // Chair of Algorithms and Data Structures. -// Author: Andre Schlegel (Januar of 2023, schlegea@informatik.uni-freiburg.de) +// Author: Andre Schlegel (January of 2023, schlegea@informatik.uni-freiburg.de) #include "../test/util/IdTableHelpers.h" @@ -42,7 +42,7 @@ void compareIdTableWithExpectedContent( auto trace{generateLocationTrace(l, traceMessage.str())}; // Because we compare tables later by sorting them, so that every table has - // one definit form, we need to create local copies. + // one definite form, we need to create local copies. IdTable localTable{table.clone()}; IdTable localExpectedContent{expectedContent.clone()}; @@ -131,7 +131,7 @@ IdTable createRandomlyFilledIdTable( return ad_utility::testing::VocabId(randomNumberGenerator()); }; - // Assiging the column number to a generator function. + // Assigning the column number to a generator function. std::vector*> columnToGenerator( numberColumns, &normalEntryGenerator); std::ranges::for_each(joinColumnWithGenerator, diff --git a/test/util/IdTableHelpers.h b/test/util/IdTableHelpers.h index 8c65d77ad9..a7ca2a4279 100644 --- a/test/util/IdTableHelpers.h +++ b/test/util/IdTableHelpers.h @@ -1,6 +1,6 @@ // Copyright 2023, University of Freiburg, // Chair of Algorithms and Data Structures. -// Author: Andre Schlegel (Januar of 2023, schlegea@informatik.uni-freiburg.de) +// Author: Andre Schlegel (January of 2023, schlegea@informatik.uni-freiburg.de) #pragma once @@ -84,7 +84,7 @@ IdTable makeIdTableFromVector(const VectorTable& content, /* * @brief Tests, whether the given IdTable has the same content as the sample - * solution and, if the option was choosen, if the IdTable is sorted by + * solution and, if the option was chosen, if the IdTable is sorted by * the join column. * * @param table The IdTable that should be tested. @@ -104,7 +104,7 @@ void compareIdTableWithExpectedContent( /* * @brief Sorts an IdTable in place, in the same way, that we sort them during - * normal programm usage. + * normal program usage. */ void sortIdTableByJoinColumnInPlace(IdTableAndJoinColumn& table); @@ -205,7 +205,7 @@ IdTable createRandomlyFilledIdTable( ad_utility::FastRandomIntGenerator{}())); /* -@brief Return a IdTable, that is completly randomly filled. +@brief Return a IdTable, that is completely randomly filled. @param numberRows, numberColumns The size of the IdTable, that is to be returned. diff --git a/test/util/JoinHelpers.h b/test/util/JoinHelpers.h index d835563fbe..2034cf03a0 100644 --- a/test/util/JoinHelpers.h +++ b/test/util/JoinHelpers.h @@ -42,7 +42,7 @@ IdTable useJoinFunctionOnIdTables(const IdTableAndJoinColumn& tableA, // You need to use this special function for executing lambdas. The normal // function for functions won't work. - // Additionaly, we need to cast the two size_t, because callFixedSize only + // Additionally, we need to cast the two size_t, because callFixedSize only // takes arrays of int. ad_utility::callFixedSize( (std::array{static_cast(tableA.idTable.numColumns()), diff --git a/test/util/ValidatorHelpers.h b/test/util/ValidatorHelpers.h index 94fd83561a..f5827c9bfa 100644 --- a/test/util/ValidatorHelpers.h +++ b/test/util/ValidatorHelpers.h @@ -52,7 +52,7 @@ auto generateDummyNonExceptionValidatorFunction(size_t variant) { return [... dummyValuesToCompareTo = createDummyValueForValidator(variant)]( const ParameterTypes&... args) { - // Special handeling for `args` of type bool is needed. For the reasoning: + // Special handling for `args` of type bool is needed. For the reasoning: // See the doc string. auto compare = [](const T& arg, const T& dummyValueToCompareTo) {