Home >Backend Development >PHP Tutorial >Teach you step by step how to do a keyword matching project (search engine)----Day 15, teach you how to do it----_PHP Tutorial
Day 15
Xiao Shuaishuai is very happy to do simple things. He doesn't know how to do complicated things, but after listening to Boss Yu's explanation, he feels that many things are so simple.
He wrote some code casually, and then went to Boss Yu to ask for advice on what to do next...
<?<span>php </span><span>class</span> OldAgeCharListHandle <span>extends</span><span> CharListHandle{ </span><span>public</span> <span>function</span> <span>exec</span><span>(){ </span><span>$this</span>->charlist->addCore("老年"<span>); </span><span>$this</span>->charlist->addBlacklist("青年"<span>); </span><span>$this</span>->charlist->addBlacklist("少年"<span>); </span><span>$this</span>->charlist->addBlacklist("中年"<span>); </span><span>$this</span>->charlist->addBlacklist("童年"<span>); } }</span>
Xiao Shuaishuai said to the boss: Boss Yu, the middle-aged and elderly people are done. I am wondering if there will be some processing with different colors or brands. When will this code be complete?
Boss Yu said: Well, now that you have mentioned this point, do you have any good plans to solve these problems?
Xiao Shuaishuai said: I don’t know if my plan is mature yet. I need everyone’s support and discussion.
Boss Yu said: Okay, good, Xiao Shuai Shuai finally knows how to use the power of the team. I will convene a discussion meeting with everyone in the afternoon to prepare your problems and your preliminary solutions.
When you have doubts about your decision-making, the strength of the team is your solid backing
During the discussion meeting in the afternoon, Xiao Shuai Shuai pointed out the problems one by one.
Xiao Lele said: To solve these problems, I think we should make an antonym comparison. This information can be saved in the database.
Xiao Huanhuan said: We can try to do it by category. Some attributes of each category are fixed. As long as we find the correspondence between these fixed attributes, it will be done well.
Little Heng Heng said: You can use it as well. I think it can also be used as an alias or a synonym.
......
After some discussion, Xiao Shuai Shuai approached Boss Yu and asked: Boss Yu, which of the solutions they discussed should I adopt?
Boss Yu listed the questions: What do you think of the antonyms, correspondences, synonyms or aliases they mentioned?
Xiao Shuai Shuai replied: Dictionary.
Boss Yu nodded in agreement and continued: Have we already implemented the concept of dictionary in the program?
Xiao Shuaishuai took a look at the code and said excitedly: It is indeed useful, just that CharList.
Boss Yu continued: Since we have used it in our consciousness, now we construct this charlist through our own code. If we already have data such as correspondences, antonyms and synonyms, what can we do? Do it.
Xiao Shuai Shuai replied: Got it, our code is just matching and corresponding based on the existing data.
Boss Yu said: Now that you understand, just do it and look forward to your good results.
Little Shuaishuai finally realized that the boss is indeed extraordinary and a god-like existence.