Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export SuperMemo format with frequency ranking order #135

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<PackageVersion Include="Google.Protobuf" Version="3.21.10" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.46" />
<PackageVersion Include="Itc4net" Version="1.2.1" />
<PackageVersion Include="LemmaGenerator" Version="1.1.0" />
<PackageVersion Include="Microsoft.Playwright" Version="1.28.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2" />
<PackageVersion Include="Nito.Guids" Version="1.1.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
// You should have received a copy of the GNU General Public License along with
// OneDotNet. If not, see <https://www.gnu.org/licenses/>.

namespace OxfordDictExtractor.ParserModel
namespace OxfordDictExtractor.Core
{
public enum CefrLevel
{
Unspecified,
Unspecified = 0,
A1,
A2,
B1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2022 Zhang Shuai<[email protected]>.
// All rights reserved.
//
// This file is part of OneDotNet.
//
// OneDotNet is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// OneDotNet is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// OneDotNet. If not, see <https://www.gnu.org/licenses/>.

namespace OxfordDictExtractor.Core
{
// See https://www.wordfrequency.info/files.asp
// Rank: 1-62,000. Based on word frequency.
// Lemma: Again, the "dictionary / headword" entry. This is why was or happier or shoes would
// not be included here; they are word forms of the lemmas be, happy, and shoe.
// PoS: Part of speech. This is the first letter of the codes from https://ucrel.lancs.ac.uk/claws7tags.html
// (e.g. N for noun, V for verb, A for adjective, R for adverb, P for preposition, C for conjunction,
// D for determiner, I for interjection, M for numeral, U for pronoun, X for other).
internal record CocaWordFrequencyLemmaEntry(int Rank, string Lemma, string PoS)
{
}
}
24 changes: 24 additions & 0 deletions srcs/private/OxfordDictExtractor/Core/OxfordWordListEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) 2022 Zhang Shuai<[email protected]>.
// All rights reserved.
//
// This file is part of OneDotNet.
//
// OneDotNet is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// OneDotNet is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// OneDotNet. If not, see <https://www.gnu.org/licenses/>.

namespace OxfordDictExtractor.Core
{
internal record OxfordWordListEntry(string Key, CefrLevel Oxford3000CefrLevel, CefrLevel Oxford5000CefrLevel)
{
}
}
35 changes: 35 additions & 0 deletions srcs/private/OxfordDictExtractor/Data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Data

## wordlist.tsv.zip

Extracted from OALD mdx files.

The dictionary file is from https://pdawiki.com/forum/thread-38955-1-1.html (v13.2)

The Chinese meanings are coming from OALD9 official version, but the newly added
terms are machine translated.

Extracted by https://github.com/liuyug/mdict-utils to SQLite database, and then
exported to TSV file.

## lemmas.csv

Downloaded from https://www.wordfrequency.info/samples.asp.

Top 60,000 "lemmas" -> Top 5000 -> Download -> Open with Excel & Save as CSV.

It's possibly too small. Maybe I'd consider some unknown time table.

https://raw.githubusercontent.com/whatofit/LevelWordWithFreq/master/src/main/resources/%E7%BE%8E%E5%9B%BD%E5%BD%93%E4%BB%A3%E8%8B%B1%E8%AF%AD%E8%AF%AD%E6%96%99%E5%BA%93COCA%E8%AF%8D%E9%A2%9120000_words_unique.txt

## oxford3000-5000.html & oxford-phrase-list.html

Wordlist downloaded from https://www.oxfordlearnersdictionaries.com/wordlists/oxford3000-5000.

Phase list downloaded from https://www.oxfordlearnersdictionaries.com/wordlists/oxford-phrase-list.

## full7z-mlteast-en.lem

Downloaded from https://github.com/AlexPoint/LemmaGenerator/blob/05f6883970dc863d61c52e169d1e016fa5c8d67b/Test/Data/Custom/full7z-mlteast-en-modified.lem.

Use this file due to issue https://github.com/AlexPoint/LemmaGenerator/issues/2.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Invoke-WebRequest `
-UseBasicParsing `
-Uri "https://www.oxfordlearnersdictionaries.com/wordlists/oxford-phrase-list" `
-TimeoutSec 5 `
-MaximumRetryCount 3 `
-RetryIntervalSec 1 `
-Method GET `
-OutFile "${PSScriptRoot}\oxford-phrase-list.$([DateTimeOffset]::UtcNow.ToString("yyyyMMdd'T'HHmmssZ", [cultureinfo]::InvariantCulture)).html"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Invoke-WebRequest `
-UseBasicParsing `
-Uri "https://www.oxfordlearnersdictionaries.com/wordlists/oxford3000-5000" `
-TimeoutSec 5 `
-MaximumRetryCount 3 `
-RetryIntervalSec 1 `
-Method GET `
-OutFile "${PSScriptRoot}\oxford3000-5000.$([DateTimeOffset]::UtcNow.ToString("yyyyMMdd'T'HHmmssZ", [cultureinfo]::InvariantCulture)).html"
Binary file not shown.
Loading