Groups
Conversations
All groups and messages
Send feedback to Google
Help
Training
Sign in
Groups
python.tw
Conversations
About
re模組統計字串內容
72 views
Skip to first unread message
partyp...@gmail.com
unread,
Nov 27, 2017, 9:52:00 AM
11/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python.tw
s4='大雄有3隻羊2條狗,小明有狗3隻雞2隻,小花有1頭牛3隻豬2隻雞狗5條。'
使用re處理s4,抽取出相關資訊來計算大雄、小明、小花共有幾隻羊、狗、雞、豬、牛。
請問我該如何結合使用defaltdict和finditer來統計問題
目前我只能將動物隻數取出來,但不知道該如何相加同種動物隻數
Dincht Wu
unread,
Jun 8, 2018, 9:22:50 AM
6/8/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python.tw
re是指?
這個可能要用深度學習去處理自然語言或許有解。
使用字典或分割處理的話,先把人名、單位(動物名)、數量前加個特定符號,用先進先出的方式就可以大概分類了。加油。
Reply all
Reply to author
Forward
0 new messages