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

단어가 없는 발음을 기준으로 단어를 추가하는 테스크 추가하기 #44

Merged
merged 3 commits into from
Oct 11, 2020

Conversation

kimdoori
Copy link
Contributor

@kimdoori kimdoori commented Apr 30, 2020

tldr;

단어가 없는 발음을 기준으로 단어를 추가하는 테스크 추가하기

주요 변경 사항

단어가 없는 발음을 가져와서 단어를 추가하는 save_words_task 테스크를 추가합니다.

  • Pronunciation에 scrapped_at 컬럼 추가
  • 스크래핑할 때 해당 컬럼 업데이트
  • scrapped_at == null && 단어가 없는 발음으로 검색

@kimdoori kimdoori added the enhancement New feature or request label Apr 30, 2020
@kimdoori kimdoori requested a review from zoripong April 30, 2020 11:54
@kimdoori kimdoori self-assigned this Apr 30, 2020
word_way/scrapping/word.py Outdated Show resolved Hide resolved
word_way/scrapping/word.py Outdated Show resolved Hide resolved
word_way/scrapping/word.py Outdated Show resolved Hide resolved
@kimdoori
Copy link
Contributor Author

리뷰 전부 반영했습니다~

).all()
for pronunciation in pronunciations:
pronunciation_id = save_word(pronunciation.pronunciation, session)
if pronunciation.id != pronunciation_id:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이상한 단어인 경우 저장할 단어가 없어서 삭제하는 건가요?
맞다면 row를 삭제한는 것보다 컬럼을 추가해서 이미 저장하려고 시도해봤지만 저장할 것이 없었다는 플래그를 주는게 더 좋지 않을까요?
이유는 삭제했는데 그 발음이 문장을 파싱하면서 다시 추가 될 것이고 그럼 다시 단어 정보가 없어서 삭제할 것이고 이것을 반복할텐데 리소스 낭비일 것 같아서요.

다만 걱정되는 것은 과거에는 특정 발음에 대한 정보가 없었지만, 나중에는 생기는 경우
한번 플래그가 바뀌어서 다시 의미를 추가하지 않으려고 할 수 도 있을 것 같아요.

근데 아래 문제는 나중에 주기적으로 플래그를 지운다거나 하는 식으로 해결 할 수 있을 것 같아서 큰 문제는 되지 않을 것 같아서 컬럼으로 구분하는것이 어떨까합니다.

Copy link
Contributor Author

@kimdoori kimdoori Oct 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다음이 변경되었습니다.

  • Pronunciation에 scrapped_at 컬럼 추가
  • 스크래핑할 때 해당 컬럼 업데이트
  • 없는 단어 검색할 때 scrapped_at이 null인 조건 추가

@zoripong
Copy link
Member

저번에는 떠오르지 않았지만 다시보니 떠오르는 코멘트,,, 쏘 쏘리,,

@kimdoori
Copy link
Contributor Author

쏘 새드... 담주에 반영할게욥!!

@zoripong zoripong changed the base branch from master to main October 11, 2020 05:03
@kimdoori kimdoori merged commit f197198 into main Oct 11, 2020
@kimdoori kimdoori deleted the word-way-backend-38 branch October 11, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

단어가 없는 발음을 기준으로 단어를 추가하는 테스크 추가하기
2 participants