帮看看我这身儿都适合什么场合?# Fashion - 美丽时尚
J*9
1 楼
1) Uncommon words from two sentences
Example:
str1="this apple is sweet"
str2="that apple is sour"
Return words "this" "that" "sweet" "sour" since they only appear in one
string, not the other.
Extend: how about N sentences?
2) How to generate Query Snippets
User tries to query "wordA wordB" from a large text file
Return the shortest substring containg all queried words
Example:
Query "catch fish" from text "It's not easy to *catch a fish* in a fast-
flowing river while #fish can be easily catched# using a net from a static
lake"
There are two matches between ** and ##, the first one shall be returned
since it's shorter.
Example:
str1="this apple is sweet"
str2="that apple is sour"
Return words "this" "that" "sweet" "sour" since they only appear in one
string, not the other.
Extend: how about N sentences?
2) How to generate Query Snippets
User tries to query "wordA wordB" from a large text file
Return the shortest substring containg all queried words
Example:
Query "catch fish" from text "It's not easy to *catch a fish* in a fast-
flowing river while #fish can be easily catched# using a net from a static
lake"
There are two matches between ** and ##, the first one shall be returned
since it's shorter.