Virtual Humans Forum
Virtual Humans Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Virtual Humans
Partner website:
Chatbots.org
 All Forums
 Virtual Humans
 Artificial Intelligence
 human mind map
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic 
Page: of 25

toborman
Hooked Member



USA
289 Posts

Posted - Mar 18 2009 :  04:25:18  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
A sample question would be" Can you describe the facing of the main gate?"

I need to tell Harry that the answer is not "Yes, I can", even though that's the correct answer.

http://mindmap.iwarp.com
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Mar 21 2009 :  19:32:13  Show Profile  Visit toborman's Homepage  Reply with Quote
I’m working on teaching Harry to recognize “who” questions, like “Who am I?”, “Who are you?”, “Who is smart?”.

“Who” is a sub type of “which”. “Which” is the question word for a command like identify or name. For example, “Identify island states” could be stated, “Which states are islands?” or “Name all island states”.

“Who” has an implied class of “human”.

“Who am I?” and “Who are you?” are special cases with pronouns that imply the speaker or the listener.

http://mindmap.iwarp.com
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Mar 25 2009 :  04:22:45  Show Profile  Visit toborman's Homepage  Reply with Quote
Harry 1.0.7 is released and available at the mindmap webpage.

1. fixed file access error.
2. harry now understands who and which.
3. harry now reads the clipboard if you tell him "read clipboard."

four new intelligence tests have been added to the mental acquity testing webpage at vhmats.

More question words to follow: when, where, etc. he will have to learn about time and space for these. an interesting challenge.

http://mindmap.iwarp.com
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 11 2009 :  06:54:10  Show Profile  Visit toborman's Homepage  Reply with Quote
Harry 1.0.8 now available for download at mindmap site.

Harry now handles some spatial concepts, i.e., on, at, in.

New tests for these concepts may be found at VHMATS site. Try it out and let me know about problems on your machine.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 26 2009 :  02:39:32  Show Profile  Reply with Quote
Toborman. Thank you so much for your many contributions! I am really excited at seeing your work.

I would be happy to assist you with things like custom auto installers and uninstallers, knowledge loading, and webinfo parsing and such.

I code in Autoit/VBA and am a member of very active communities for both.

Just a couple of things you can add that would enhance this projects potential.

I believe you need <type> added
You start with a blank table named “Class”

When you say: “Species is a type of Class. “
It creates a row within “Class” and adds “Species” Then
It creates a table “Species”.

When you say: “Human is a type of Species. “
It creates a row within “Species” and adds “Human” Then
It creates a table “Human”.

When you say: “Male is a type of Human. “
It creates a row within “Human” and adds “Male” Then
It creates a table “Male”.

When you say: “Female is a type of Human. “
It creates a row within “Human” and adds “Female” Then
It creates a table “Female”.

When you say: “David is a male.”
It adds David to the male Table.
It searches other tables for “David” and finds none.

When you say: “Is David a human?”
It finds David in “Male Table” and verifies that Male belongs to human.
“David may be a human”

When you say: “Monkey is a type of Species.”
It adds a row within “Species” and adds “Monkey” Then
It creates a table “Monkey”

When you say: “David is a monkey.”
It adds David to the monkey Table.
It searches other tables for “David”
It finds “David” in “Male Table”
“Male” is 3 subsets down from “Class” while “Monkey” is only 2.
It adds “male” as a type of “Monkey”

When you say: “What species is David?”
It looks to “species Table” and searches subsets.
“Human Table” –no entry
“Monkey Table” –found entry
“David is a monkey”

When you say: “Is David a human?”
It searches “Human” and verifies no entries
It searches subsets of “Human” and finds “David” in “Male”
It searches remaining hierarchy of “Male” and finds “David” in Monkey
“David is a monkey”


What do you think?
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 26 2009 :  05:46:41  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
I would be happy to assist you with things like custom auto installers and uninstallers, knowledge loading, and webinfo parsing and such.

I code in Autoit/VBA and am a member of very active communities for both.

Harry was originally written in MS ACCESS VBA and has been converted to VB6.

Harry is a project designed to incorporate and influence the ideas in the human mindmap.

VHMATS is an attempt to provide some means to determine how well an AI system emulates human intelligence. The tests are also based on the human mindmap.

Have you downloaded and run Harry, yet?

We need to share some design concepts before I comment on your suggestion for adding a <type>.

My experience with installers and uninstallers is weak, so I can certainly use the help. I am interested in hearing more about your ideas for knowledge loading, and webinfo parsing.

Welcome aboard.

http://mindmap.iwarp.com
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 27 2009 :  00:56:23  Show Profile  Visit toborman's Homepage  Reply with Quote
Lets look at the test first.

A test using <type>.

G: “Species is a type of Class. “
G: “Human is a type of Species. “
G: “Male is a type of Human. “
G: “Female is a type of Human. “
G: “David is a male.”

Q: “Is David a human?”
A: “David may be a human”

G: “Monkey is a type of Species.”
G: “David is a monkey.”

Q: “What species is David?”
A: “David is a monkey”

Q: “Is David a human?”
A: “David is a monkey”

A test using implied <type>.

G: Humans are species.
G: Some Males are humans.
G: Some Females are humans.
G: David is a male.

Q: “Is David a human?”
A: “David may be a human”

G: “Monkeys are Species.”
G: “David is a monkey.”

Q: “What species is David?”
A: “David is a monkey”

Q: “Is David a human?”
A: “David is a monkey”

Both tests are valid. This works because the interpretation stage allows us to create the same internal knowledge representation from different input statements.

Next time I’ll comment on the internal knowledge representation.


http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 27 2009 :  01:17:19  Show Profile  Reply with Quote
quote:
Have you downloaded and run Harry, yet?

Yes, yesterday morning before posting.

quote:
I am interested in hearing more about your ideas for knowledge loading


My first step is to load info as a type.
Then add members to the types.

As you add each type it records where the info came from, and what type it is in addition to what it connects to.

The Idea is to build a network. (or pathway)
While Harry is not working,(Compuer Idle) he will "Think" (Build his own network paths based on the data you provided)
When he stores it (The same place you do) he records the author as himself.

If he is incorrect in an answer, ask him how he arrived at that. -That info is stored also. (He will also correct his entries as you make more)

This would help give instant results to questions you have not provided based on info you have and connections he made while idle.

He could ever expand his network to cover many topics.
---------------------------------------------------------
I started this yesterday. Here is what I have so far.

It is not coded to idle think yet; only to create connections you provide.

Try:
Species is a type of Class
Human is a type of Species
Male is a type of Human
Female is a type of Human
Bob is a Male

The structure must be "* is a type of *" to build a type relationship.

The structure must be "* is a *" to build a member relationship.

-They are coded to not cross over. (Mismatch)

The only requirement is Excel and Autoit
I am using Excel be cause it is easy to see (later will convert to SQLite I think) -its free and light.

For Autoit
http://www.autoitscript.com/autoit3/downloads.shtml

I recommend AutoIt Full Installation and AutoIt Script Editor

It is very similar to VB/VB6/VBA -but faster to code, and easier. -plus the community is very active and helpful

After install, right click desktop -> Create new autoit 3 script ->Paste code below -> press F5.

Press the ok button when the script loads (not enter)
After that press enter.

Much more to come as I have time . . .

Code below. (Work in progress)

#include <Array.au3>
#include <Excel.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{ENTER}", "_Entry")
HotKeySet("{ESC}", "_Terminate")
Dim $Lower, $Upper, $avArray, $sString, $User

$UserName = InputBox("Who are you?", "Please Enter Your Name", @UserName)
$oExcel = _ExcelBookNew(1)
GUICreate(" Talk to me!", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1)
$Input = GUICtrlCreateInput("", 10, 35, 300, 20)
GUISetState(@SW_SHOW)

While 1
	Sleep(10) ;Keep the Gui Open
WEnd

Func _Entry()
	$sString = GUICtrlRead($Input)
	GUICtrlSetData($Input, "")
	_BreakDownString()
EndFunc   ;==>_Entry

Func _BreakDownString()
	Switch $sString
		Case StringInStr($sString, "is") <> 0 And StringInStr($sString, "a") <> 0 And StringInStr($sString, "type") <> 0 And StringInStr($sString, "of") <> 0
			;MsgBox(0, "", "EntryCall 1")
			_TypeEntry()
		Case StringInStr($sString, "is") <> 0 And StringInStr($sString, "a") <> 0 And StringInStr($sString, "type") = 0
			;MsgBox(0, "", "EntryCall 2")
			_MemberEntry()
	EndSwitch
EndFunc   ;==>_BreakDownString

Func _TypeEntry()
	;Msgbox(0,"","EntryCall 1a")
	Dim $sPattern = '(?i)(\w++) is a type of (\w++)'
	Dim $aMatch = StringRegExp($sString, $sPattern, 1)
	If IsArray($aMatch) And UBound($aMatch) > 1 Then
		Global $Lower = $aMatch[0]
		Global $Upper = $aMatch[1]
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Upper, 0, 0, 0, 1) ;Check to see if Hierarchy Exists in Collection
		If @error Then ;If Hierarchy Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Upper) ;Add Hierarchy to Collection
			_ExcelWriteCell($oExcel, "Subset", 1, 1) ;Add Subset to Hierarchy and Remember Source
			_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to Hierarchy and Remember Source
			_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to Hierarchy and Remember Source
		Else
			_ExcelSheetActivate($oExcel, $Upper) ;Activate Hierarchy
			;_ExcelReadSheetToArray($oExcel, [$iStartRow , $iStartColumn [, $iRowCnt, $iColCnt], [$iColShift]])
			$avArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;List Hierarchy
			If IsArray($avArray)And UBound($avArray) > 1 Then ;You can only search array in info exsists to create array
				;Msgbox(0,"","EntryCall 1b")
				$iIndex = _ArraySearch($avArray, $Lower) ;Check to see if Subset Exists in Hierarchy
				If @error Then ;If Subset Not Exists in Hierarchy
					_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in Hierarchy Subsets
					_ExcelWriteCell($oExcel, "Subset", 1, 1) ;Add Subset to Hierarchy and Remember Source
					_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to Hierarchy and Remember Source
					_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to Hierarchy and Remember Source
				EndIf
			Else ;If info did not exsist to create array.
				;Msgbox(0,"","EntryCall 1c")
				_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in Hierarchy Subsets
				_ExcelWriteCell($oExcel, "Subset", 1, 1) ;Add Subset to Hierarchy and Remember Source
				_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to Hierarchy and Remember Source
				_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to Hierarchy and Remember Source
			EndIf
		EndIf
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Lower, 0, 0, 0, 1) ;Check to see if Subset Exists in Collection
		If @error Then ;If Subset Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Lower) ;Add Subset to Collection
		EndIf
	EndIf
EndFunc   ;==>_TypeEntry

Func _MemberEntry()
	;Msgbox(0,"","EntryCall 2a")
	Dim $sPattern = '(?i)(\w++) is a (\w++)'
	Dim $aMatch = StringRegExp($sString, $sPattern, 1)
	If IsArray($aMatch) And UBound($aMatch) > 1 And $aMatch[1] <> "type" Then
		Global $Lower = $aMatch[0]
		Global $Upper = $aMatch[1]
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Upper, 0, 0, 0, 1) ;Check to see if Hierarchy Exists in Collection
		If @error Then ;If Hierarchy Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Upper) ;Add Hierarchy to Collection
			_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add Member to Hierarchy and Remember Source
			_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Member to Hierarchy and Remember Source
			_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Member to Hierarchy and Remember Source
		Else
			_ExcelSheetActivate($oExcel, $Upper) ;Activate Hierarchy
			;_ExcelReadSheetToArray($oExcel, [$iStartRow , $iStartColumn [, $iRowCnt, $iColCnt], [$iColShift]])
			$avArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;List Hierarchy
			If IsArray($avArray) And UBound($avArray) > 1 Then ;You can only search array in info exsists to create array
				$iIndex = _ArraySearch($avArray, $Lower) ;Check to see if Member Exists in Hierarchy
				If @error Then ;If Member Not Exists in Hierarchy
					_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in Hierarchy Members
					_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add Member to Hierarchy and Remember Source
					_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Member to Hierarchy and Remember Source
					_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Member to Hierarchy and Remember Source
				EndIf
			Else ;If info did not exsist to create array.
				_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in Heirchy Subsets
				_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add Subset to Hierarchy and Remember Source
				_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to Hierarchy and Remember Source
				_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to Hierarchy and Remember Source
			EndIf
		EndIf
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Lower, 0, 0, 0, 1) ;Check to see if Member Exists in Collection
		If @error Then ;If Member Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Lower) ;Add Member to Collection
		EndIf
	EndIf
EndFunc   ;==>_MemberEntry

Func _Terminate()
	_ExcelBookClose($oExcel, 0, 0)
	Exit 0
EndFunc   ;==>_Terminate

Edited by - Hatcheda on Apr 27 2009 03:59:56
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 27 2009 :  04:07:52  Show Profile  Reply with Quote
quote:
Originally posted by toborman


Both tests are valid. This works because the interpretation stage allows us to create the same internal knowledge representation from different input statements.

Next time I’ll comment on the internal knowledge representation.





I can see how they are very similar and produce like results. I am expecting to see some differences soon though. I am going to contiue with my test of grouping until I can get it to group itself. At that point I will start dumping data from lists into the entry. I will use an automated script to feed it so as to allow it to create connections one at a time.

I think I will start from the most basic and work my way down. Once I have enough, I believe it will start linking them on its own. (as logic would provide for)

Looking forward to hearing more about Harry's internals . . .

Edited by - Hatcheda on Apr 27 2009 04:09:27
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 27 2009 :  04:42:55  Show Profile  Visit toborman's Homepage  Reply with Quote
Nice code! I understand your approach.

quote:
The structure must be "* is a type of *" to build a type relationship.

The structure must be "* is a *" to build a member relationship.

I see a possible use for <type> in Harry. Do you see the <type> relationship as a superset<->subset or as a set<->property relationship?

To allow Harry to use alternative phrases for patterns like "* is a type of *", he stores all his patterns in an "english" table that can be used to convert the alternative to the standard wording.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 27 2009 :  07:03:11  Show Profile  Reply with Quote
Thanks! :-)

http://en.wikipedia.org/wiki/Subset
If A and B are sets and every element of A is also an element of B, then:
A is a subset of (or is included in) B.
B is a superset of (or includes) A.

If A is a subset of B, but A is not equal to B (i.e. there exists at least one element of B not contained in A), then:
A is also a proper (or strict) subset of B.
B is a proper superset of A.

quote:
Do you see the <type> relationship as a superset<->subset or as a set<->property relationship?


I see it as Superset<->Subset
I also intend to classify all other entries where possible.
<Member>
<Type>
<Discription>
<Function>

I believe this will not only help with relationships, but also with sentence structure.

Most classifications, I suspect, will only belong to the lower levels.

quote:
To allow Harry to use alternative phrases for patterns like "* is a type of *", he stores all his patterns in an "english" table that can be used to convert the alternative to the standard wording.


I was wondering about that. For now, I am going to leave it strict until I get in all the classifications. Then I will try to duplicate something like that. I am hoping to create templates for input recognition and classification for correct output.
Can you imagine: Input

"Greg likes to sing while he walks"
Templates breakdown:

Greg -becomes standalone if not already (unnetworked)
He - links to Male , adds Greg to Male, Adds Superset to Greg
Greg -may be a Human -Male is subset of Human
Sing -Likes to * -Discribes Greg -adds <Discription>

That's 5 entries from one input!

We will see in the comming days. I think I will start the search function tomorrow (searches when new info added for other info in other subsets, supersets, and unlinked sheets)

I am up to here:
When you say: “Species is a type of Class. “
It creates a row within “Class” and adds “Species” Then
It creates a table “Species”.

When you say: “Human is a type of Species. “
It creates a row within “Species” and adds “Human” Then
It creates a table “Human”.

When you say: “Male is a type of Human. “
It creates a row within “Human” and adds “Male” Then
It creates a table “Male”.

When you say: “Female is a type of Human. “
It creates a row within “Human” and adds “Female” Then
It creates a table “Female”.

When you say: “David is a male.”
It adds David to the male Table.
It searches other tables for “David” and finds none.

Edited by - Hatcheda on Apr 27 2009 07:28:32
Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 27 2009 :  15:59:30  Show Profile  Visit toborman's Homepage  Reply with Quote
quote:
Can you imagine: Input

"Greg likes to sing while he walks"
Templates breakdown:

Greg -becomes standalone if not already (unnetworked)
He - links to Male , adds Greg to Male, Adds Superset to Greg
Greg -may be a Human -Male is subset of Human
Sing -Likes to * -Discribes Greg -adds <Discription>

That's 5 entries from one input!

I can feel your excitement. At this rate your VH will be passing the VHMATS test in the near future. Great work.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 28 2009 :  03:55:41  Show Profile  Reply with Quote
Busy day at work today. I plan a few additions before bed tonight.

oCheck for db and open or create new if not.
oSave db at close and every $x of time
oBuild in initial search
oWrite Superset entries to go along with subsets.
oPost results

After I get my programming up to my initial post requirement I will begin to study your db entries for more ideas on how to improve both as well as how you could gain mass entry knowledge. (will need to understand your structure more)
Post to come . . .

Go to Top of Page

toborman
Hooked Member



USA
289 Posts

Posted - Apr 28 2009 :  04:46:23  Show Profile  Visit toborman's Homepage  Reply with Quote
Harry's primary tables are knowledge, english, conversation, inference (as per the mindmap). They all have the same physical structure: Sense1,object1,relation,sense2,object2. this structure allows the same set of table access functions to be used for all tables.

The content of each record is the relationship of object1 to object2. sense1 and sense2 constrain the meaning of each object.

Each record has a record number.

http://mindmap.iwarp.com
Go to Top of Page

Hatcheda
Curious Member



27 Posts

Posted - Apr 28 2009 :  07:23:04  Show Profile
quote:
Originally posted by toborman
I can feel your excitement. At this rate your VH will be passing the VHMATS test in the near future. Great work.



Thanks!

As promised:
All above plus MATH
My Project will be named Cortona

-Have to clean up code comments from copy/paste of other sections.
-Cortona currently writes to "Console" -viewed in SciTE where she is launched (F5) -there you will see math results and search results.
-SciTE->View->Toggle all folds -very useful for ease of reading sections

Code below: Work in Progress

#Region ;Includes
#include <Array.au3>
#include <Excel.au3>
#include <GUIConstantsEx.au3>
#include <Timers.au3>
#include <WindowsConstants.au3>
#EndRegion 
#Region ;HotKeys
HotKeySet("{ENTER}", "_Entry")
HotKeySet("{ESC}", "_Terminate")
#EndRegion 
#Region ;Variables
Dim $Lower, $Upper, $avArray, $sString, $User
$UserName = InputBox("Who are you?", "Please Enter Your Name", @UserName)
#EndRegion 
#Region ;Database
If FileExists(@ScriptDir & "\db.xls") Then
	$oExcel = _ExcelBookOpen(@ScriptDir & "\db.xls", 1)
Else
	$oExcel = _ExcelBookNew(1)
	_ExcelBookSaveAs($oExcel, @ScriptDir & "\db", "xls")
	If @error Then MsgBox(0, "Error", "Unable to save!", 3)
EndIf
#EndRegion 
#Region ;Gui
$hWnd = GUICreate(" Talk to me!", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1)
$Input = GUICtrlCreateInput("", 10, 35, 300, 20)
GUISetState(@SW_SHOW)
#EndRegion 
#Region ;Timers
$sSave = _Timer_SetTimer($hWnd, 30 * 60 * 1000, "_Save", -1) ;Save every 30 minutes
#EndRegion 
#Region ;Main Loop
While 1
	Sleep(10) ;Keep the Gui Open
	_Think()
WEnd
#EndRegion 
#Region ;Functions
Func _Entry()
	$sString = GUICtrlRead($Input)
	GUICtrlSetData($Input, "")
	$x = StringRegExpReplace($sString, "[^0-9+*/^()=<>-]", "")
	If StringLeft($x, 1) = "-" Then $x = "0" & $x
	ConsoleWrite(Execute($x) & @CRLF) ;Write to Console
	_BreakDownString()
EndFunc   ;==>_Entry

Func _BreakDownString()
	Switch $sString
		Case StringInStr($sString, "is") <> 0 And StringInStr($sString, "a") <> 0 And StringInStr($sString, "type") <> 0 And StringInStr($sString, "of") <> 0
			_TypeEntry()
		Case StringInStr($sString, "is") <> 0 And StringInStr($sString, "a") <> 0 And StringInStr($sString, "type") = 0
			_MemberEntry()
	EndSwitch
EndFunc   ;==>_BreakDownString

Func _TypeEntry()
	Dim $sPattern = '(?i)(\w++) is a type of (\w++)'
	Dim $aMatch = StringRegExp($sString, $sPattern, 1)
	If IsArray($aMatch) And UBound($aMatch) > 1 Then
		Global $Lower = $aMatch[0]
		Global $Upper = $aMatch[1]
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Upper, 0, 0, 0, 1) ;Check to see if SuperSet Exists in Collection
		If @error Then ;If SuperSet Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Upper) ;Add SuperSet to Collection
			_ExcelWriteCell($oExcel, "Subset", 1, 1) ;Add Subset to SuperSet and Remember Source
			_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to SuperSet and Remember Source
			_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to SuperSet and Remember Source
		Else
			_ExcelSheetActivate($oExcel, $Upper) ;Activate SuperSet
			$avArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;List SuperSet
			If IsArray($avArray) And UBound($avArray) > 1 Then ;You can only search array in info exsists to create array
				$iIndex = _ArraySearch($avArray, $Lower) ;Check to see if Subset Exists in SuperSet
				If @error Then ;If Subset Not Exists in SuperSet
					_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
					_ExcelWriteCell($oExcel, "Subset", 1, 1) ;Add Subset to SuperSet and Remember Source
					_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to SuperSet and Remember Source
					_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to SuperSet and Remember Source
				EndIf
			Else ;If info did not exsist to create array.
				_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
				_ExcelWriteCell($oExcel, "Subset", 1, 1) ;Add Subset to SuperSet and Remember Source
				_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to SuperSet and Remember Source
				_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to SuperSet and Remember Source
			EndIf
		EndIf
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Lower, 0, 0, 0, 1) ;Check to see if Subset Exists in Collection
		If @error Then ;If Subset Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Lower) ;Add Subset to Collection
			_ExcelWriteCell($oExcel, "Superset", 1, 1) ;Add SuperSet to Subset and Remember Source
			_ExcelWriteCell($oExcel, $Upper, 1, 2) ;Add SuperSet to Subset and Remember Source
			_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add SuperSet to Subset and Remember Source
		Else
			_ExcelSheetActivate($oExcel, $Lower) ;Activate Subset
			$avArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;List Subset
			If IsArray($avArray) And UBound($avArray) > 1 Then ;You can only search array in info exsists to create array
				$iIndex = _ArraySearch($avArray, $Lower) ;Check to see if SuperSet Exists in SubSet
				If @error Then ;If SuperSet Not Exists in SubSet
					_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
					_ExcelWriteCell($oExcel, "Superset", 1, 1) ;Add SuperSet to Subset and Remember Source
					_ExcelWriteCell($oExcel, $Upper, 1, 2) ;Add SuperSet to Subset and Remember Source
					_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add SuperSet to Subset and Remember Source
				EndIf
			Else ;If info did not exsist to create array.
				_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
				_ExcelWriteCell($oExcel, "Superset", 1, 1) ;Add SuperSet to Subset and Remember Source
				_ExcelWriteCell($oExcel, $Upper, 1, 2) ;Add SuperSet to Subset and Remember Source
				_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add SuperSet to Subset and Remember Source
			EndIf
		EndIf
	EndIf
EndFunc   ;==>_TypeEntry

Func _MemberEntry()
	;Msgbox(0,"","EntryCall 2a")
	Dim $sPattern = '(?i)(\w++) is a (\w++)'
	Dim $aMatch = StringRegExp($sString, $sPattern, 1)
	If IsArray($aMatch) And UBound($aMatch) > 1 And $aMatch[1] <> "type" Then
		Global $Lower = $aMatch[0]
		Global $Upper = $aMatch[1]
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Upper, 0, 0, 0, 1) ;Check to see if SuperSet Exists in Collection
		If @error Then ;If SuperSet Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Upper) ;Add SuperSet to Collection
			_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add Member to SuperSet and Remember Source
			_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Member to SuperSet and Remember Source
			_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Member to SuperSet and Remember Source
		Else
			_ExcelSheetActivate($oExcel, $Upper) ;Activate SuperSet
			;_ExcelReadSheetToArray($oExcel, [$iStartRow , $iStartColumn [, $iRowCnt, $iColCnt], [$iColShift]])
			$avArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;List SuperSet
			If IsArray($avArray) And UBound($avArray) > 1 Then ;You can only search array in info exsists to create array
				$iIndex = _ArraySearch($avArray, $Lower) ;Check to see if Member Exists in SuperSet
				If @error Then ;If Member Not Exists in SuperSet
					_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Members
					_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add Member to SuperSet and Remember Source
					_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Member to SuperSet and Remember Source
					_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Member to SuperSet and Remember Source
				EndIf
			Else ;If info did not exsist to create array.
				_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
				_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add Subset to SuperSet and Remember Source
				_ExcelWriteCell($oExcel, $Lower, 1, 2) ;Add Subset to SuperSet and Remember Source
				_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add Subset to SuperSet and Remember Source
			EndIf
		EndIf
		$avArray = _ExcelSheetList($oExcel) ;List Collection
		$iIndex = _ArraySearch($avArray, $Lower, 0, 0, 0, 1) ;Check to see if Member Exists in Collection
		If @error Then ;If Subset Not Exists in Collection
			_ExcelSheetAddNew($oExcel, $Lower) ;Add Subset to Collection
			_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add SuperSet to Subset and Remember Source
			_ExcelWriteCell($oExcel, $Upper, 1, 2) ;Add SuperSet to Subset and Remember Source
			_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add SuperSet to Subset and Remember Source
		Else
			_ExcelSheetActivate($oExcel, $Lower) ;Activate Subset
			$avArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;List Subset
			If IsArray($avArray) And UBound($avArray) > 1 Then ;You can only search array in info exsists to create array
				$iIndex = _ArraySearch($avArray, $Lower) ;Check to see if SuperSet Exists in SubSet
				If @error Then ;If SuperSet Not Exists in SubSet
					_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
					_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add SuperSet to Subset and Remember Source
					_ExcelWriteCell($oExcel, $Upper, 1, 2) ;Add SuperSet to Subset and Remember Source
					_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add SuperSet to Subset and Remember Source
				EndIf
			Else ;If info did not exsist to create array.
				_ExcelRowInsert($oExcel, 1, 1) ;Add row to prevent overwrite in SuperSet Subsets
				_ExcelWriteCell($oExcel, "Member", 1, 1) ;Add SuperSet to Subset and Remember Source
				_ExcelWriteCell($oExcel, $Upper, 1, 2) ;Add SuperSet to Subset and Remember Source
				_ExcelWriteCell($oExcel, $UserName, 1, 3) ;Add SuperSet to Subset and Remember Source
			EndIf
		EndIf
		_Search()
	EndIf
EndFunc   ;==>_MemberEntry

Func _Search()
	$avArray = _ExcelSheetList($oExcel) ;Create array of all sheets
	For $x = 0 To UBound($avArray) - 1 ;Cycle through each sheet
		_ExcelSheetActivate($oExcel, $avArray[$x]) ;Activate each sheet
		$xArray = _ExcelReadSheetToArray($oExcel, 1, 2, 0, 1, 1) ;Create array of sheet data
		If IsArray($xArray) And UBound($xArray) > 1 Then ;Insure sheet contained data to create array
			$iIndex = _ArraySearch($xArray, $Lower) ;Search array for $lower
			If Not @error Then ;If Member Not Exists in SuperSet
				ConsoleWrite($Lower & " is a " & _ExcelReadCell($oExcel, $iIndex, 1) & " of " & $avArray[$x] & @CRLF) ;Write to Console
			EndIf
		EndIf
	Next
EndFunc   ;==>_Search

Func _Think()
	;Pending
EndFunc   ;==>_Think

Func _Save()
	_ExcelBookSave($oExcel, 0)
EndFunc   ;==>_Save

Func _Terminate()
	_Timer_KillAllTimers($hWnd)
	_ExcelBookClose($oExcel, 1, 0) ;Close, Save, No Errors
	Exit 0
EndFunc   ;==>_Terminate
#EndRegion 
#Region ;Comments
#cs
	Todo: 4/27/09
	oCheck for db and open or create new if not. -done
	oSave db at close and every $x of time -done
	oBuild in initial search -done
	oWrite Superset entries to go along with subsets. -done
	oAdd Regions to collapse veiw (under view->Toggle all folds) -done
	oMath -done
	oPost results - done
	
	Todo: 4/28/09
	oNext When you say: “Is David a human?” It finds David in “Male Table” and verifies that Male belongs to human.“David may be a human”
	
	Unused Code: (Storage)
#ce
#EndRegion
Go to Top of Page
Page: of 25 Previous Topic Topic   
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Virtual Humans Forum © V.R.Consulting Go To Top Of Page
This page was generated in 0.23 seconds. Snitz Forums 2000