This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
在编程中,即使在决定什么对象以及如何对象之前,拥有明确的目标也很重要。不幸的是,从我上面读到的内容来看,这并不是很清楚。
所以首先忘记程序的如何。忘记对象、代码以及它们的作用。
现在想象一下其他人将为您编写该程序。一个如此优秀的程序员,他们不需要你告诉他们如何编码。以下是他们可能会问您的一些问题。
完成此操作后,忘记你的 convo 对象或其他什么,并根据 1、2 和 4 进行思考。在笔上并思考你的问题的主要元素,即对话。不要只是创建对象......你会找到它们。
现在考虑这些元素之间的相互作用。即
“机器人将消息添加到主题,用户将消息添加到主题,来自主题的消息被发送到日志。”
这将帮助您找到对象是什么、它们必须做什么以及它们需要存储什么信息。
话虽如此,我想说你最大的问题是你承担的事情超出了你的承受范围。首先,计算机识别单词并将其放入主题中是相当复杂的,并且涉及语言学和/或统计学。作为一名新程序员,我倾向于避开这些领域,因为它们只会让你失望,并在此过程中扼杀你的动力。从小事做起...然后做大事。尝试搞乱 GUI 编程,然后制作一个简单的计算器之类的东西......
having clear goals is important in programming even before you set out deciding what objects and how. Unfortunately from what I've read above this isn't really clear.
So first forget the how of the program. forget about the objects, the code and what they do.
Now Imagine someone else was going to write for you the program. someone who is such a good programmer, they don't need you do tell them how to code. here are some questions they might ask you.
Having done this then forget about your convo object or whatever and think in terms of 1, 2 and 4. On Pen and paper think about the main elements of your problems i,e Conversations.Don't Just create Objects... you'll find them.
Now think about the relationships of those elements in terms of how they interact. i.e.
"Bot adds message to Topic, User adds message to Topic, messages from Topic are sent to Log."
this will help you find what the objects are, what they must do and what information they'll need to store.
Having said all that, I would say your biggest problem is your taking on more than you can chew. To begin with, for a computer to recognise words and put them into topics is quite complicated and involves linguistics and/or statistics. As a new programmer I'd tend to avoid these areas because they will simply let you down and in the process kill your motivation. start small... then go BIG. try messing with GUI programming, then make a simple calculator and stuff...