Giving certain kinds of things to certain people (relation between people and kinds of things) - inform7

I would like for the player to be able to give certain kinds of thing to certain people, where the default is that people do not accept the items, but it should be possible to override this.
I'm trying to do this using a relation.
The block giving rule is not listed in the check giving it to rules.
Interest relates one person to various things. The verb to like means the interest relation.
Check giving (this is the polite refusal of unwanted objects rule):
unless the second noun likes the noun:
say "[The second noun] disdainfully refuses [the noun]." instead.
Then setting up the kind / instance of the relation, where Billy should accept food.
Food is a kind of thing. A baguette is food. A baguette is here.
Billy is a man. Billy is in Example Location. Billy likes food.
However taking the baguette and giving it to Billy results in:
Billy disdainfully refuses the baguette
However, if I say
Billy likes the baguette.
Then giving succeeds:
You give the baguette to Billy
How can I make Billy accept all food items?

I figured out how, not using a relation, but an either/or property.
A person can be interested-in-food.
With the giving-check:
Check giving (this is the polite refusal of unwanted objects rule):
Unless noun is food and the second noun is interested-in-food:
say "[The second noun] disdainfully refuses [the noun]." instead.
And giving setting property on the person:
Billy is interested-in-food.

The statement Billy likes food. creates a thing called 'food' that Billy likes. A way to make Billy like all food is using the word all, like the following:
All food is liked by Billy.
or
When play begins, now Billy likes all food.
These makes Billy like each food item individually.

Related

LUIS not able to classify multiple person names in a query

I am having an issue where in LUIS is unable to identify multiple person names in an utterance when separated by "and or ," in a phrase.
For Eg:
When user types, "Schedule a meeting with Bob and Lisa", LUIS recognizes only Bob as builtin.personName where in Lisa is not recognized at all. Also separating names with comma didn't work either. If I change the order of names to Lisa and Bob, only Lisa gets listed and poor Bob gets ignored this time.
Also it failed to identify the name when typing, "Book meeting and Bob".
My another attempt was successful after changing the utterance to "Book meeting with Bob as well as Lisa". But that would not be general way of posting a query.
Phrase lists didn't help either, I have added below two samples in phrase list but the results were same as stated above.
"Schedule a meeting with {personName}, {personName}"
"can i have {personName} and {personName} for a quick meeting"
I don't see similar issue with emails separated by "and or comma".
Note:I also tried built in domain entity Entertainment.Person but got similar results.
Appreciate your help.
You need to make your app more intelligent by adding patterns to the app. I have tried to replicate your issue by creating my LUIS app, it successfully detects the entities properly. Refer the app stored as a gist here : https://gist.github.com/mandardhikari/f0edd9406aeeb6d7b9fd0f68371ff4eb

Split block of text into separate parts

New to R so apolgies if this is obvious..
Given a text document containing a sample block of text such as the following:
Deputy Kermit: Sir, providing access to good education for all the
Utoppia's children is one of our most important responsibilities as
States’ Members. We all recognise that. On the morning we began to
debate the future of selection in secondary education that was why
feelings ran so high, and why it was so closely fought.
But our responsibility does not stop at the doors of this Assembly.
For the sake of practicality we delegate day-to-day policy
responsibilities to individual Committees. As Deputy Fozzy has rightly
said, the Committee is the agent of the States. Ultimately it should
do what it is told. So there should be no doubt that the buck stops
with us, the States, to be sure that our agent, the Committee, has the
skills, strength and experience necessary for the task we have
assigned to it. If the Committee is not the right one for the task
ahead, especially if it is a task of vital importance to our Island,
then it is our duty to deal with that. We must remember that there is
no hierarchy here, no power to hire or fire discreetly in this
Assembly. If a Committee is in the wrong job but it does not step
down, the only tool we have to manage that is a motion of no
confidence.
Deputy Fozzy’s record too is similar, he just said that change is a
recipe for disaster. On the steps of the States after December’s
debate he told us that Utopia would rue –
The Bailiff: Deputy Fozzy.
Deputy Fozzy: That was never said on the steps of this Assembly
after the debate. I have said nothing ever like that after the debate.
I think you need to check your facts.
The Bailiff: Through the Chair,
Deputy Kermit: I repeat what I heard in the media, sir.
I would like to split each speakers statements out into their own separate file. What are my options to do this, given the speakers title (in this example Deputy or Baliff) and the character ':' may also occur within the block of text?
Not sure about the sentence breaks here...just an attempt.
Regex:
(^|[\W\S]\s*)(([A-Z][a-z]+\s?)+:)
Replacement:
$1\n\n$2
Output:
Deputy Kermit: Sir, providing access to good education for all the Utoppia's children is one of our most important responsibilities as States’ Members. We all recognise that. On the morning we began to debate the future of selection in secondary education that was why feelings ran so high, and why it was so closely fought.
But our responsibility does not stop at the doors of this Assembly. For the sake of practicality we delegate day-to-day policy responsibilities to individual Committees. As Deputy Fozzy has rightly said, the Committee is the agent of the States. Ultimately it should do what it is told. So there should be no doubt that the buck stops with us, the States, to be sure that our agent, the Committee, has the skills, strength and experience necessary for the task we have assigned to it. If the Committee is not the right one for the task ahead, especially if it is a task of vital importance to our Island, then it is our duty to deal with that. We must remember that there is no hierarchy here, no power to hire or fire discreetly in this Assembly. If a Committee is in the wrong job but it does not step down, the only tool we have to manage that is a motion of no confidence.
Deputy Fozzy’s record too is similar, he just said that change is a recipe for disaster. On the steps of the States after December’s debate he told us that Utopia would rue –
The Bailiff: Deputy Fozzy.
Deputy Fozzy: That was never said on the steps of this Assembly after the debate. I have said nothing ever like that after the debate. I think you need to check your facts.
The Bailiff: Through the Chair,
Deputy Kermit: I repeat what I heard in the media, sir.

Custom Slot with Numeric Data for Alexa Skills Kit

I'm writing an alexa skill for my local public transit directions. I'm defining the Train Stations with a custom slot like this -
LIST_OF_STOPS - 14th Street | 23rd Street | 33rd Street | Christopher Street | Exchange Place
I have a strong suspicion that Alexa is going to have a hard time understanding the ones like 14th Street, is there documentation or guidelines around how these should be defined?
There is not any documentation. Most people do it by trial and error. The only obscurely documented quirk is that "a.", "b.", etc can be used for the letters.
That being said, I think that those values look to be pretty OK. The one thing you need to be aware of is that Alexa takes the list of custom values "under advisement". It is not a definitive list. Alexa will happily return values other than what is on the list. So you are going to need a fuzzy matcher anyway so you can handle '23 street', and things like that.
I would try the simple list you have, and see if you are happy with the results. If not, you might make one intent that is {slot} street, another for {slot} place, etc. That might improve things. But it might not. You need to iterate and try a bunch of things and see.

Graph data modeling assistance relating to soccer matches

I am trying to model soccer matches and the referees and teams that play in them. I want to create nodes based on matches, referees, and players and am not clear on the best approach to model them? That is should I model it after cities, matches? Do I create a root node Id etc?
The kind of information I would looking for later would be stuff like:
1). Show all the matches for a particular referee (could be in multiple cities)
2). Show all matches where referee worked and home team won
3). show all referees that that have the highest count of wins for the home team?
4). show most active refereess in a particular city
As you can see there are all sorts of questions and for someone new this can be a little overwhelming. While I am reading some books, I wanted to see if any experts could help me in the scenario above. Again not sure if I need a root node that connects all the cities and referees and matches or just keep things independent. Your feedback would be most appreciated.
One of the possible models that at the moment seem to satisfy the queries you've posted:
(Team)-[:PLAYS]->(Match)
(Match)-[:HAS_REFEREE]->(Referee)
(Match)-[:PLAYED_IN]->(City)
The PLAYS relation could have a property to indicate if the team was the home team. You could also have a property on the PLAYS relation to indicate whether that team won or not. Or if winning is a big part of what you're looking for, you can create an extra relation such as
(Team)-[:WON]->(Match) (though then you need to think about how to model draws. The absence of a WON relation on either of the two teams for a match could indicate a draw maybe).
1) All matches for a particular referee: Start at the referee, traverse through the Match to the Cities. You might index some unique property of the referee to be able to look him up quickly
2) All matches where the referee worked and the home team won: Start at the referee, find all his matches, filter on the WON relation/property and the home team property
3)All referees that have the highest count of wins for the home team: Same as above, start at all referees
4)Most active referees for a city: Start at the city, find all matches and their referees
You might move things around a bit depending on more questions that you want to answer (especially home team properties, WIN/LOSE relations or properties etc.)
And I don't think you need the root node at all. You can index all matches/cities/referees etc if you want to find all of them
I've done some modelling of football/soccer matches which might be interesting to look at - http://staging.thinkingingraphs.com/
Mostly the same as what Luanne said although I've got specific relationship types indicating which team played at home and away. I've been writing up what I discovered while building out the model here as well - http://www.markhneedham.com/blog/tag/neo4j/page/2/

Describing a Cypher Query for multi-level relationship in Neo4j?

I'm developing a small affiliate structure to understand the concept of graph databases better, as well learn Neo4J and see what it can offer me. I've been with RDBMS for years now and Cypher is pretty rough. I'm trying to build a very simple affiliate system:
Affiliate Joe has referred Mary, Bob and Mark. So, i create all their nodes and create the "referred" relationship. Now Mary refers Julie, Jessica and Joan. Bob refers Billy and Baxter. Mark refers Michael and Marx. And their referrals keep referring people.
For each referral that one of Joe's original referrals, Joe earns a "generation". His first generation is Mary, Bob and Mark. His second generation is Julie, Jessica, Joan, Billy, Baxter, Michael and Marx.
Now, with a Cypher query, how can i discover his generations and, of course, discover their number? Their place in the tree? How can i know who is from his 3rd or 4th generation, and who they are?
My mind is twisting here, hope you guys can help.
Vinny,
look at http://tinyurl.com/7vryzwz, is this what you are lookad for, basically
START referrer=node(1)
MATCH path=referrer-[:referred*1..]->refferee
RETURN referrer,refferee, length(path) as generation
ORDER BY length(path) asc

Resources