ฉันกำลังพยายามคิดให้ออกแบบฝึกหัดในข้อความหุ้นและการเรียงลำดับ. ออกกำลังกาถามเพื่อแยกคำพูดนั้นมีเวลาอ้างอิง(e.g.,ชั่วโมง,วัน)จากข้อความและเรียงลำดับแถวจากพื้นฐานที่สะกัดออกมาใน ascendent คำสั่ง เป็นตัวอย่างของข้อมูลคือ:
Customer Text
1 12 hours ago — the customer applied for a discount
2 6 hours ago — the customer contacted the customer service
3 1 day ago — the customer reported an issue
4 1 day ago — no answer
4 2 days ago — Open issue
5
ในงานนี้ผมสามารถบอกได้ว่าหลายวามยากลำบาก:
- time reference can be expressed as hours/days/weeks
- there are null values or no reference to time
- get a time format suitable and more general, e.g., based on the current datetime
ที่นี่คือจุดแรกที่ฉันรู้แล้โดยปกติแล้วคนที่คู่เดทมาก่อน—ไม่ว่าของขวัญดังนั้นมันอาจจะเป็นเรื่องง่ายที่จะคลายแฟ้มพวกเขา สองจุดนักถ้าแถลงการณ์จะสามารถหลีกเลี่ยงข้อความผิดพลาดเนื่องจากยังไม่สมบูรณ์/หายไปฟิลด์ ฉันไม่รู้ว่าจะต้องตอบจุดที่สามที่นะ
ฉันคาดหวังว่าผลจะเป็น:
Customer Text Sort by
1 12 hours ago — the customer applied for a discount 1
2 6 hours ago — the customer contacted the customer service 2
3 1 day ago — the customer reported an issue 2
4 1 day ago — no answer 2
4 2 days ago — Open issue 3
5