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

77377 satır eklendi. #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

77377 satır eklendi. #2

wants to merge 1 commit into from

Conversation

ufukart
Copy link

@ufukart ufukart commented Jan 11, 2021

Elimdeki halihazırda bulunan 77377 satır sözlük veritabanını aktardım. Mevcut json'da duplike kontrolü yapmadım.

Elimdeki halihazırda bulunan 77377 satır sözlük veritabanını aktardım. Mevcut json'da duplike kontrolü yapmadım.
@kahramanumut
Copy link
Owner

Katkın için çok teşekkür ederim baya bir kelime var, boyut çok fazla olduğu için deserialize işleminde ve sonrasında sorun yaratabileceğinden şu an direkt merge atamıyorum ama dosyayı aldım.

@huseyinsimsekk
Copy link

Merhaba, mergelenirse duplicate kontrolü yapabilirim. Sadece tekil olacak şekilde düzenlenebilir json dosyası. Yine de fazla olabilir boyut tabiki

@berkakkaya
Copy link
Contributor

berkakkaya commented Jan 19, 2021

Merhaba, bahsedilen JSON dosyasında duplicate kontrolü yapması için bir Python scripti yazdım.
Scriptimin çıktısını şuraya ekledim.

Kullandığım script:

from json import load, dump
from os import mkdir
from os.path import isdir


print("File is loading...")

# Load the file
with open("frequentlyWords.json", "r") as f:
    file = load(f)

words = dict()

print("Scanning...")

for record in file:
    # Word string: [English equivalent]_[Turkish equivalent]
    word_string = f"{record['english']}_{record['turkish']}"
    
    if not word_string in words:
        words[word_string] = 1
    else:
        words[word_string] += 1

duplicate_words = dict()

for word in words:
    if words[word] > 1:
        duplicate_words[word] = words[word]

# We don't need words variable anymore
del words

len_duplicate_words = len(duplicate_words)

if len_duplicate_words == 0:
    print("No duplicate word has been found.")
else:
    print(f"{len_duplicate_words} duplicate word(s) has been found.")

data = dict(
    note="Words are shown as word strings. Word strings are formatted as [English equivalent]_[Turkish equivalent]. Also key values in duplicate words are indicating how many duplicates of that word are in the target file.",
    duplicate_words_count=len_duplicate_words,
    duplicate_words=duplicate_words
)

if not isdir("out"):
    mkdir("out")

with open("out/result.json", "w", encoding="utf8") as f:
    dump(data, f, ensure_ascii=False, indent=2)

print("More detailed results are in out/result.json")

Ayrıca dosyayı kontrol ederken bazı kelimelerin Türkçe karşılıklarının şu şekilde olduğunu fark ettim (276898. satırda):

{
  "english": "piercing",
  "turkish": "n.delme:v.del:prep.delerek"
}

Sanırsam bunun gibi birçok kelime var. Belki düzeltilmesi gerekebilir.

@kahramanumut
Copy link
Owner

10 numara olmuş @berkakkaya eline sağlık

@berkakkaya
Copy link
Contributor

10 numara olmuş @berkakkaya eline sağlık

Teşekkürler 😄

Ayrıca verdiğim scripti Github Actions'a ekleyebilirsiniz isterseniz ileriki pull requestlerde işinizi kolaylaştırır

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants