Skip to content

Commit b305b48

Browse files
committed
Fix typos
1 parent 5646802 commit b305b48

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

evaluate/generate_dataset.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def processSentences(sentences, outFile):
174174

175175

176176
def main():
177-
parser = argparse.ArgumentParser(description='datset generator')
177+
parser = argparse.ArgumentParser(description='dataset generator')
178178
parser.add_argument('out_file', type=str, help='will be created out_file_train and out_file_test')
179179
parser.add_argument('-lz', '--leipzig', type=str, help='path to file or dir with Leipzig Corpora files')
180180
parser.add_argument('-fb2', '--fb2', type=str, help='path to file or dir with files in FB2 format')

jamspell/spell_corrector.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ TWords TSpellCorrector::GetCandidatesRaw(const TWords& sentence, size_t position
148148
}
149149

150150
void TSpellCorrector::FilterCandidatesByFrequency(std::unordered_set<TWord, TWordHashPtr>& uniqueCandidates, TWord origWord) const {
151-
if (uniqueCandidates.size() <= MaxCandiatesToCheck) {
151+
if (uniqueCandidates.size() <= MaxCandidatesToCheck) {
152152
return;
153153
}
154154

@@ -163,7 +163,7 @@ void TSpellCorrector::FilterCandidatesByFrequency(std::unordered_set<TWord, TWor
163163
return a.first > b.first;
164164
});
165165

166-
for (size_t i = 0; i < MaxCandiatesToCheck; ++ i) {
166+
for (size_t i = 0; i < MaxCandidatesToCheck; ++ i) {
167167
uniqueCandidates.insert(candidateCounts[i].second);
168168
}
169169
uniqueCandidates.insert(origWord);
@@ -273,8 +273,8 @@ void TSpellCorrector::SetPenalty(double knownWordsPenalty, double unknownWordsPe
273273
UnknownWordsPenalty = unknownWordsPenalty;
274274
}
275275

276-
void TSpellCorrector::SetMaxCandiatesToCheck(size_t maxCandidatesToCheck) {
277-
MaxCandiatesToCheck = maxCandidatesToCheck;
276+
void TSpellCorrector::SetMaxCandidatesToCheck(size_t maxCandidatesToCheck) {
277+
MaxCandidatesToCheck = maxCandidatesToCheck;
278278
}
279279

280280
const TLangModel& TSpellCorrector::GetLangModel() const {

jamspell/spell_corrector.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TSpellCorrector {
2020
std::wstring FixFragment(const std::wstring& text) const;
2121
std::wstring FixFragmentNormalized(const std::wstring& text) const;
2222
void SetPenalty(double knownWordsPenalty, double unknownWordsPenalty);
23-
void SetMaxCandiatesToCheck(size_t maxCandidatesToCheck);
23+
void SetMaxCandidatesToCheck(size_t maxCandidatesToCheck);
2424
const NJamSpell::TLangModel& GetLangModel() const;
2525
private:
2626
void FilterCandidatesByFrequency(std::unordered_set<NJamSpell::TWord, NJamSpell::TWordHashPtr>& uniqueCandidates, NJamSpell::TWord origWord) const;
@@ -37,7 +37,7 @@ class TSpellCorrector {
3737
std::unique_ptr<TBloomFilter> Deletes2;
3838
double KnownWordsPenalty = 20.0;
3939
double UnknownWordsPenalty = 5.0;
40-
size_t MaxCandiatesToCheck = 14;
40+
size_t MaxCandidatesToCheck = 14;
4141
};
4242

4343

tests/test_perfect_hash.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ TEST(PerfetHashTest, basicFlow) {
1616
ph.Init(keys);
1717

1818
ASSERT_TRUE(ph.BucketsNumber() < uint32_t(2.0 * keys.size()));
19-
std::set<size_t> backetsUsed;
19+
std::set<size_t> bucketsUsed;
2020

2121
for (auto&& s: keys) {
22-
backetsUsed.insert(ph.Hash(s));
22+
bucketsUsed.insert(ph.Hash(s));
2323
}
2424

25-
ASSERT_EQ(keys.size(), backetsUsed.size());
25+
ASSERT_EQ(keys.size(), bucketsUsed.size());
2626

2727
std::string serialized;
2828
{
@@ -38,9 +38,9 @@ TEST(PerfetHashTest, basicFlow) {
3838
ph2.Load(in);
3939
}
4040

41-
backetsUsed.clear();
41+
bucketsUsed.clear();
4242
for (auto&& s: keys) {
43-
backetsUsed.insert(ph2.Hash(s));
43+
bucketsUsed.insert(ph2.Hash(s));
4444
}
45-
ASSERT_EQ(keys.size(), backetsUsed.size());
45+
ASSERT_EQ(keys.size(), bucketsUsed.size());
4646
}

0 commit comments

Comments
 (0)