Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Naming convention for consistency วิธีการตั้งชื่อไฟล์ #141

Closed
bact opened this issue Oct 30, 2018 · 5 comments
Labels
question asking questions/giving suggestions
Projects
Milestone

Comments

@bact
Copy link
Member

bact commented Oct 30, 2018

ปัจจุบันไฟล์ใน pythainlp/corpus มีรูปแบบการตั้งชื่อที่ไม่สม่ำเสมอ
เสนอให้มีการใช้ชื่อที่สม่ำเสมอครับ เพื่อความสะดวกในการดูแลโค้ด (มีความคาดเดาได้บางอย่าง)

ตัวอย่าง

การใช้ _ หรือ - คั่นคำ

  • thaipos.py <- ไม่มีคั่น
  • thaipos.json <- ไม่มีคั่น, ชื่อไฟล์ข้อมูลเหมือนไฟล์โค้ด
  • thaiword.py <- ไม่มีคั่น
  • thaiword.txt <- ไม่มีคั่น, ชื่อไฟล์ข้อมูลเหมือนไฟล์โค้ด
  • thaisyllable.py <- ไม่มีคั่น
  • thai_syllable.txt <- มี _ คั่น, ชื่อไฟล์ข้อมูลไม่เหมือนไฟล์โค้ด (ต่างตรงการคั่น)
  • new-thaidict.txt <- มี - คั่น, ชื่อไฟล์ข้อมูลไม่เหมือนไฟล์โค้ด (ใช้คนละคำไปเลย dict vs word)
  • newthaiword.py <- ไม่มีคั่น

เอกพจน์หรือพหูพจน์

  • country.py <-- เอกพจน์
  • provinces.py <-- พหูพจน์
  • stopwords.py <- พหูพจน์
  • thaiword.py <- เอกพจน์

suffix/prefix แสดงภาษา

  • stopwords.py <- โค้ด ไม่ระบุภาษา
  • stopwords-th.txt <- ชุดข้อมูล ระบุภาษาด้วย th
  • thaiword.py <- โค้ด ระบุภาษาด้วย thai
  • thaiword.txt <- ชุดข้อมูล ระบุภาษาด้วย thai
@cstorm125
Copy link
Member

ผมคิดว่า

  1. ใช้ _ เพราะมีปัญหาน้อยกว่า ไม่ถูกมองผิดเป็นเครื่องหมายลบ
  2. ควรเป็นพหูจน์เพราะไฟล์นั้นๆมีสิ่งของมากกว่าหนึ่ง
  3. suffix เพราะส่วนใหญ่เป็น thai เวลาเรากดหาน่าจะอยากหา functional keyword มากกว่า
    3.1 เห็นว่าควรใช้ th เพราะตัวหนังสือน้อยกว่า

@wannaphong wannaphong added the question asking questions/giving suggestions label Oct 31, 2018
@bact
Copy link
Member Author

bact commented Nov 4, 2018

ผมลองตามที่ @cstorm125 เสนอครับ ใช้ _ (underscore), ใช้พหูพจน์, ใช้ suffix _th ต่อท้ายถ้าเป็นข้อมูลภาษาไทย

@cstorm125
Copy link
Member

Can we move these rules somewhere so we can close this?

@p16i
Copy link
Contributor

p16i commented Sep 1, 2019

maybe wiki?

@bact bact added this to the Future milestone Dec 6, 2019
@bact bact added this to To do in PyThaiNLP Dec 6, 2019
@wannaphong
Copy link
Member

Is it done? @bact

@PyThaiNLP PyThaiNLP locked and limited conversation to collaborators Oct 11, 2022
@bact bact converted this issue into discussion #722 Oct 11, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question asking questions/giving suggestions
Projects
PyThaiNLP
  
To do
Development

No branches or pull requests

4 participants