-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from wanhuz/main
Main feature changes
- Loading branch information
Showing
21 changed files
with
600 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
build/ | ||
vs2019/.vs/ | ||
.git/ | ||
vs2019/x86/ | ||
vs2019/x64/ | ||
|
||
# Prerequisites | ||
*.d | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
#include <qstring.h> | ||
|
||
/*Data type for dictionary entry. Each entry will have a kanji, readings, glossary and how common it is in real-life (frequency)*/ | ||
class entry { | ||
private: | ||
QString kanji; | ||
QString reading; | ||
QString gloss; | ||
int freq; | ||
|
||
public: | ||
entry(const QString kanji, const QString reading, const QString gloss, const int freq) { | ||
this->kanji = kanji; | ||
this->reading = reading; | ||
this->gloss = gloss; | ||
this->freq = freq; | ||
} | ||
|
||
QString getKanji() { return this->kanji; } | ||
QString getReading() { return this->reading; } | ||
QString getGloss() { return this->gloss; } | ||
int getFreq() { return this->freq; } | ||
void setFreq(int freq) { if (freq < 101 && freq > -1) { this->freq = freq; } } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
#pragma once | ||
#include <qstring.h> | ||
#include <qvector.h> | ||
#include <qmap.h> | ||
#include "../data/entry.h" | ||
|
||
class Dict { | ||
|
||
public: | ||
Dict(); | ||
void load(); | ||
QVector<QStringList> search(QString searchString); | ||
QVector<entry> search(QString searchString); | ||
QVector<entry> sort(QVector<entry> searchedWord, QString targetString); | ||
|
||
private: | ||
void parse(QByteArray* line); | ||
QVector<QStringList> dictlist; | ||
|
||
QVector<entry> dictlist; | ||
QMap<QString, int> freqMap; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.