dupa

Author Topic: New DLL functions in Hal 5.0 beta  (Read 5493 times)

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
New DLL functions in Hal 5.0 beta
« on: September 04, 2003, 07:41:55 pm »
The following functions (methods) have been added to the HalBrain.DLL file which now includes 2 classes called "Brain" and "WordNet"


The Brain class has this new method:

Function SearchPattern(UserSent As Variant, Pattern As Variant, ReturnWhichStar As Variant) As Variant

An example of what this does can be seen in the Hal 5.0 script where Hal gives dictionary definitions


The new WordNet class contains these methods:

'This tells the program where to find the WordNet database. Usually running this function is not needed as it will default to the WordNet folder in Hal's program folder.
Sub SetPath(WordNetPath As Variant)

'This function looks up a word in the WordNet DB and returns if the word exists. This function must be run before running any of the following functions so that the program knows which word you are looking at.
Function LookupWord(TheWord As Variant) As Boolean

'Returns true if the word can be used as a noun
Function IsNoun() As Boolean

'Returns true if the word can be used as a verb
Function IsVerb() As Boolean

'Returns true if the word can be used as an adjective
Function IsAdj() As Boolean

'Returns true if the word can be used as an adverb
Function IsAdv() As Boolean

'Gets the base form of any word (turns plural to singular, past tense to present, ...) of a certain part of speech (pass "NOUN", "VERB", "ADJ", or "ADV")
Function GetBase(PartOfSpeech As Variant) As Variant

'Returns the number of senses (different definitions) a certain part of speech has
Function GetNumSenses(PartOfSpeech As Variant) As Variant

'If a word can have more then 1 part of speech, this will return which form is used more often.
Function GuessPartOfSpeech() As Variant

'This returns the definition of a word (DefType = "D"), synonyms that define the word (DefType = "S"), or an example sentence using the word (DefType = "E").
Function GetDefinition(PartOfSpeech As Variant, Sense As Variant, DefType As String) As Variant
   
'This returns a list of compound words that contain the looked up word. Can be slow.
Function GetCompoundWords(PartOfSpeech As Variant) As Variant

'Gets a list of Holonyms (a word that names the whole of which a given word is a part. Whole name. ';`hat' is a holonym for `brim' and `crown".) of a word and sense, subset tells it how deep to go.
Function GetHolonyms(Sense As Variant, SubSet As Variant) As Variant

'Gets a list of Hypernyms (Hypernym: a word that is more generic than a given word. Superordinate, superordinate word. Canine is a hypernym for both dog and wolf)
Function GetHypernyms(PartOfSpeech As Variant, Sense As Variant, Level As Variant) As Variant

'Gets a list of Meronyms (Meronym: a word that names a part of a larger whole. Part name. ';`brim' and `crown' are meronyms of `hat".)
Function GetMeronyms(Sense As Variant) As Variant

'Gets a list of synonyms (deeper then the synonyms returned by getdefinition)
Function GetSynonyms(PartOfSpeech As Variant, Sense As Variant) As Variant
   
'Gets a list of sister terms
Function GetSisters(PartOfSpeech As Variant, Sense As Variant) As Variant

'Gets a list of antonyms
Function GetAntonyms(PartOfSpeech As Variant, Sense As Variant) As Variant

'Counts how many parts of speech a word has
Function GetPartOfSpeechCount() As Variant


'If you feed a word list generated by one of the above functions to this, it will randomly choose a single word from the list.
Function ChooseRandomWord(WordList As Variant) As Variant

'If you feed a word list generated by one of the above functions to this, it will return the first word from the list.
Function GetFirstInList(TheList As Variant) As Variant

'Given any single sentence this function will replace all words with synonyms if the function is certain it will make sense.
Function RewordSentence(Sentence As Variant) As Variant

'This function will find the first noun in a sentence. (usefull for guessing the subject of a sentence)
Function FindFirstNoun(Sentence As Variant) As Variant

'If you are familiar with the WN command line utility, you can query any WordNet command using this function
Function GetWN(WordNetQuery As Variant) As Variant
Robert Medeksza

Spitfire2600

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
Re: New DLL functions in Hal 5.0 beta
« Reply #1 on: July 09, 2017, 07:59:25 pm »
Are these functions included in the HalBrain.dll for Hal6? I can't seem to find any reference to searching for verbs or adverbs that were in hal5 in hal6.

- Spitfire