| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi everyone, We know, for example, how to check if "X < Y" in a code. However, how do you check if "keywordA is example of keywordB" for example? For example, how do you check if "Lexus is example of Auto" in a code? Thanks, Mike |
|
#2
| |||
| |||
| maasultan@gmail.com writes: >Hi everyone, >We know, for example, how to check if "X < Y" in a code. However, how >do you check if "keywordA is example of keywordB" for example? >For example, how do you check if "Lexus is example of Auto" in a code? Gotta be homework? -- Chris. |
|
#3
| |||
| |||
| On Jul 31, 10:28*pm, Chris McDonald <ch...@csse.uwa.edu.au> wrote: > maasul...@gmail.com writes: > >Hi everyone, > >We know, for example, how to check if "X < Y" in a code. However, how > >do you check if "keywordA is example of keywordB" for example? > >For example, how do you check if "Lexus is example of Auto" in a code? > > Gotta be homework? > > -- > Chris. No, it is not and may be I didn't put my question right! I apologize. In the mathematical example I brought above, X<Y, there is an algorithm that allows to compare things. In the 2nd example, how can we create an algorithm that will check if X is example of Y, where X and Y could be related to anything not just Autos? Hope that help now? Mike |
|
#4
| |||
| |||
| >No, it is not and may be I didn't put my question right! I apologize. OK, sorry, it seemed a very basic question from the first week of a CS101 course. >In the mathematical example I brought above, X<Y, there is an >algorithm that allows to compare things. In the 2nd example, how can >we create an algorithm that will check if X is example of Y, where X >and Y could be related to anything not just Autos? Your problem as restated is still very general. In the first case, even defining a meaning for X<Y is very general. For example, we could define the '<' operator for many different uses: "young" < "old" is FALSE if talking about alphabetic comparisons "young" < "old" is TRUE if talking about ages "2nd Aug" < "2nd Apr" is FALSE if talking about alphabetic comparisons "2nd Aug" < "2nd Sep" is TRUE if talking about dates So defining 'is an example of' is an equally wide-open problem. An apple 'is an example of' a fruit is TRUE An apple 'is an example of' a computer is TRUE Perhaps I still don't understand your question, but I don't feel you'll get *any* mathematical equivalent of this. The closest you may get is to discuss things in terms of sets and subsets? -- Chris. |
|
#5
| |||
| |||
| On Aug 1, 5:47*pm, Chris McDonald <ch...@csse.uwa.edu.au> wrote: > >No, it is not and may be I didn't put my question right! I apologize. > > OK, sorry, it seemed a very basic question from the first week of a CS101 > course. > > >In the mathematical example I brought above, X<Y, there is an > >algorithm that allows to compare things. In the 2nd example, how can > >we create an algorithm that will check if X is example of Y, where X > >and Y could be related to anything not just Autos? > > Your problem as restated is still very general. > In the first case, even defining a meaning for X<Y is very general. > For example, we could define the '<' operator for many different uses: > > * * "young" < "old" * * * * * * *is FALSE if talking about alphabetic comparisons > * * "young" < "old" * * * * * * *is TRUE if talking about ages > * * "2nd Aug" < "2nd Apr" * * * *is FALSE if talking about alphabetic comparisons > * * "2nd Aug" < "2nd Sep" * * * *is TRUE if talking about dates > > So defining 'is an example of' is an equally wide-open problem. > > * * An apple 'is an example of' a fruit * * * * is TRUE > * * An apple 'is an example of' a computer * * *is TRUE > > Perhaps I still don't understand your question, but I don't feel you'll > get *any* mathematical equivalent of this. *The closest you may get is > to discuss things in terms of sets and subsets? > > -- > Chris. I have read somewhere aout "ontology" as follows: they are sets of defined terms like the sort that you would find in a dictionary, but the terms are given hierarchical relationships to one another. So, if X is an example of Y, then X and Y have hierarchical relationship. Now, suppose you have a text file such as an email and you want to search for ontology in that file, you will look for all terms and see which one might be an example of another. How your logic above could be applied here since X could be Lexus or Apple or anything else, and so is Y! Mike |
|
#6
| |||
| |||
| Responding to Maasultan@gmail.com... > We know, for example, how to check if "X < Y" in a code. However, how > do you check if "keywordA is example of keywordB" for example? > > For example, how do you check if "Lexus is example of Auto" in a code? The short answer is that you can't unless you have more information. Even "X < Y" is undefined unless one has a context (e.g., integers? Complex numbers? ASCII strings?...). IOW, you need to provide a better description of the ontological context. You also need to provide more information about the problem you are trying to solve. For example, are you dealing with an existing taxonomy or do you wish to provide an generic approach to defining an arbitrary taxonomy in a manner that will allow navigation of it? -- There is nothing wrong with me that could not be cured by a capful of Drano. H. S. Lahman hsl@pathfindermda.com Pathfinder Solutions http://www.pathfindermda.com blog: http://pathfinderpeople.blogs.com/hslahman "Model-Based Translation: The Next Step in Agile Development". Email info@pathfindermda.com for your copy. Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php. (888)OOA-PATH |
|
#7
| |||
| |||
| Responding to Maasul...@gmail.com... On Aug 4, 3:40*am, "H. S. Lahman" <h...@pathfindermda.com> wrote: > Responding to Maasul...@gmail.com... > > > We know, for example, how to check if "X < Y" in a code. However, how > > do you check if "keywordA is example of keywordB" for example? > > > For example, how do you check if "Lexus is example of Auto" in a code? > > The short answer is that you can't unless you have more information. > Even "X < Y" is undefined unless one has a context (e.g., integers? > Complex numbers? ASCII strings?...). IOW, you need to provide a better > description of the ontological context. > > You also need to provide more information about the problem you are > trying to solve. For example, are you dealing with an existing taxonomy > or do you wish to provide an generic approach to defining an arbitrary > taxonomy in a manner that will allow navigation of it? > > -- > There is nothing wrong with me that could > not be cured by a capful of Drano. > > H. S. Lahman > h...@pathfindermda.com > Pathfinder Solutionshttp://www.pathfindermda.com > blog:http://pathfinderpeople.blogs.com/hslahman > "Model-Based Translation: The Next Step in Agile Development". *Email > i...@pathfindermda.com for your copy. > Pathfinder is hiring:http://www.pathfindermda.com/about_us/careers_pos3.php. > (888)OOA-PATH Do you want to check the Type of a object at run time? for example: there is a Class Auto, and Lexus is an object of Aotu, how can we determine Lexus's type during the runtime? If you are looking answer for this, and coincidently, you are using C+ +, you can try Traits with the help of effective C++ item 47: Use traits classes for information about types. |
|
#8
| |||
| |||
| On Aug 1, 9:29 pm, maasul...@gmail.com wrote: > On Aug 1, 5:47 pm, Chris McDonald <ch...@csse.uwa.edu.au> wrote: > > > > > >No, it is not and may be I didn't put my question right! I apologize. > > > OK, sorry, it seemed a very basic question from the first week of a CS101 > > course. > > > >In the mathematical example I brought above, X<Y, there is an > > >algorithm that allows to compare things. In the 2nd example, how can > > >we create an algorithm that will check if X is example of Y, where X > > >and Y could be related to anything not just Autos? > > > Your problem as restated is still very general. > > In the first case, even defining a meaning for X<Y is very general. > > For example, we could define the '<' operator for many different uses: > > > "young" < "old" is FALSE if talking about alphabetic comparisons > > "young" < "old" is TRUE if talking about ages > > "2nd Aug" < "2nd Apr" is FALSE if talking about alphabetic comparisons > > "2nd Aug" < "2nd Sep" is TRUE if talking about dates > > > So defining 'is an example of' is an equally wide-open problem. > > > An apple 'is an example of' a fruit is TRUE > > An apple 'is an example of' a computer is TRUE > > > Perhaps I still don't understand your question, but I don't feel you'll > > get *any* mathematical equivalent of this. The closest you may get is > > to discuss things in terms of sets and subsets? > > > -- > > Chris. > > I have read somewhere aout "ontology" as follows: they are sets of > defined terms like the sort that you would find in a dictionary, but > the terms are given hierarchical relationships to one another. > > So, if X is an example of Y, then X and Y have hierarchical > relationship. Now, suppose you have a text file such as an email and > you want to search for ontology in that file, you will look for all > terms and see which one might be an example of another. How your logic > above could be applied here since X could be Lexus or Apple or > anything else, and so is Y! > > Mike SO close. Do you have any database knowledge? You could code this as a table MYDICTIONARY with columns WORD and TYPE. it could have entries like (Lexus, Auto) (Ford,Auto) (Auto, Vehicle) Then your program construct IF Lexus is example of Auto THEN becomes a query Select 1 from MYDICTIONARY where word=Lexus and type=Auto returning 1 row for true and no rows for false. There would be more complex syntax to check higher level types, like whether Lexus is a Vehicle. That would depend on your database. In Perl you might us associative arrays. Also you could code this as a tree (a hierarchy) where the "is example of" operation goes from the node Lexus toward the root looking for Auto, returning true if found, false otherwise. So in a program, there are lots of ways of solving this. You might even write a compiler that accepts the syntax X= Lexus Y= Auto If X is example of Y THEN ... and have it do what you want. HTH, Ed |
|
#9
| |||
| |||
| maasultan@gmail.com escribió: > Hi everyone, > > We know, for example, how to check if "X < Y" in a code. However, how > do you check if "keywordA is example of keywordB" for example? > > For example, how do you check if "Lexus is example of Auto" in a code? > > Thanks, > Mike > Hi Mike, i read the example about parsing an email with the "is example of" criterium. You got replies for both relational as well as object oriented solutions, both could serve your purpose, once you decide on the purpose you might be getting somewhere. In a purely relational context, you would take a look at the word alone and check if it is contained in a group, which it is an example of. The group itself has a name and can be part of another group. In order for the groups to make any sense, you will need a data model which delivers you the information you need to do cover your use cases. The simple relation x is example of y is worth nothing if it is ambigous, like in the apple example. Anyway, the simple relation approach would be sufficient for quite a lot of use cases. An example: You want to filter out the target of an email within a company by counting references to product types. Simple lookup tables that check for product names and look up the product group they belong to could provide you with that information. Much more precise information could be achieved if you would be able to identify your object more exactly than just by name. In an object oriented approach, an apple could be a subclass of fruit, which could be a subclass of alimentation. It would be an object named apple, more than "the apple". Another object named apple could be subclass of notebooks, being a subclass of computers. Being an example of could translate in this context to being a subclass of another class. Take note that there are programming languages that allow a class to be a subclass of more than one superclass. A very interesting way to check for something being an example of something else though would be duck typing. "if it swims like a duck and quacks licke a duck and looks like a duck, it is a duck (at least for my purposes)". Likewise, a man in a duck costume could be an example of a duck, as could some toons, though technically they are not live ducks. Careful here, if you make being edible a criteria for your duck, the result might change. In duck typing, you would create a function that checks for the existence of certain methods and attributes and make a decision based on a set of criteria, if your x qualifies to be an example of y. In the email context obviously, you seem to have just a name to start with, but you could dig up more info: You could check context, word positioning and whatever distinguishing parameters that come to your mind, to make an identifiable object of your word before checking where it belongs. Example: In an email, it says: "While i was eating your tasty apples, i ...". you could extract from the structure that the apples you want to check upon are object of the action "to be eaten". This obviously puts the apples in the food category, which rules out computers, but still does not necessarily imply fruits. While parsing the text, that way you could determine simple group relations and eliminate impossible ones, until you can pin down all the object relations in a context. A general method to do this would be a topic for a book rather than a newspost, but i think you got the idea, and if you are able to clearly define the use cases for which you need the information, you won't need all information available. hope this helps Regards, Stefan Nolde |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.