Hum Code Base
Hum-FileIn -- HumFileInSubclass
subclassMethod: anArgument3
Hum-FileIn -- HumFileIn
anotherMethod: anArgument2
"This is a second method to check for iteration anomolies."
someMethod: anArgument
"This method provides means to test file in from generated code."
Hum-FileIn -- HumFileOut
myInstanceVariable
^ myInstanceVariable.
Hum-Graph -- HumGraphTests
test110GraphHasNodes
"A graph has a collection (set) of nodes"
test120GraphHasConnections
"A graph has a collection (set) of connections."
test130PutGetNode
"A graph has a collection (set) of nodes"
test140PutGetConnector
"A graph has a collection (set) of connections."
test150PutGetLabeledConnections
"A graph has a collection (set) of connections"
test152PutGetParallelConnections
"A graph has a collection (set) of nodes"
test160DetectCycle
"A graph has a collection (set) of nodes"
Hum-Graph -- HumGraph
addConnection: anAssociation
addConnection: anAssociation label: aString
"Note: A pair of nodes may have more than one relation."
addNode: anObject
"Add the given object to the set of nodes"
addNode: anObject label: aString
"Add the given object to the Set of node-labels"
connectionLabels
"Note: A pair of nodes may have more than one relation."
connections
"Return the connections (associations) in this graph."
connectionsFrom: aNode
"Get the outbound connections from this node. "
countNeighborsOfNode: aNode
"Return the number of neighbors of this node.
hasCycle
"Does the graph contain at least one cycle?"
nodeLabels
^nodeLabels ifNil: [ nodeLabels := Set new ].
nodes
"Return the nodes in this graph."
nodesDownStreamFrom: aRootNode
"Collect the nodes that are down-stream from a root node."
nodesDownStreamFrom: aRootNode butNotIn: upStreamNodes
"Find nodes that are down-stream from the root node but not in the upStreamNodes."
Hum-IDE -- HumCodeBase
everythingIsClassSide
"This is organized as a singleton - all the methods are on the class side."
Hum-IDE -- HumCodeStream
<< aString
asString
^self printString.
contents
^(self stream) contents.
limit
"At what point do we assume code generation has run amock?"
limit: aSmallInteger
printString
^(self stream) contents.
stream
Hum-IDE -- HumFrameUpdater
addActionLine: aSourceString
addDictionaryLine: aSourceString
addMarkUp: aSourceString
addPlanLine: aSourceString
"The kind of line is modal."
addVignetteInstruction: anInstructionLine
addVignetteLine: aSourceString
addVignetteResponse: aResponseString
appendFrameLine: aSourceString
"Create appropriate frameLine type and append to frame."
appendInstructionRole: aRole statement: aStatement
appendInstructionRole: aRole statement: aStatement comment: aComment
appendInstructionStatement: aStatement
"Append a simple instruction (no delegation, no comment) to the frame."
appendPrecondition: aPreconditionStatement
appendRole: aRole action: aStatement
"Pass through to frame."
checkFrameSyntax
compileToOntology: aHumOntology
"Delegate to the frame."
frame
"If frame is not initialized before this call, we have a logic error."
frame: aFrame
"What frame am I editing ?"
getInstructionAt: aSmallInteger
^self lines at: aSmallInteger .
isEmpty
^ (frame isNil) or: [frame isEmpty].
lines
^ (self frame) lines.
nextVignetteContext: aString
ontology
^ (ontology) ifNil: [ Error signal: 'Frame Updater instance must have an ontology.']
ontology: aHumOntology
parseInstruction: sourceWith
prettyPrint
"Pretty print the frame content (rendering as HTML)."
programmersAssistant
^ programmersAssistant ifNil: [programmersAssistant := HumProgrammersAssistant new].
putInstruction: aHumInstruction at: aSmallInteger
storeFrameInOntology
"Store my frame in my ontology"
stripLeaderFrom: aLine
vignetteContext
vignetteMode
"What mode is the vignette parser in?"
vignetteMode: newMode
"What mode is the vignette parser in?"
Hum-IDE -- HumProgrammersAssistant
clearOntology
getAnnotationFromSource: aSourceString
"Match '[...]' if any, and extract it from source."
getCommentFromSource: aSourceString
"Match '(...)' if any, and extract it from source."
getLabelFromSource: aSourceString
"Match 'word:' at the front of the string.
loadOntology: anOntology fromTextFileNamed: fileName
"Load an ontology from the given text file."
loadOntologyFromSaveFileNamed: aFileNameString
"Reload an ontology from the given save file."
loadOntologyFromTextFileNamed: fileName
"Load an ontology from the given text file."
loadOntologyFromTextStream: aStream
"Discover frame type and store each frame in ontology."
makeFramePerTitleLine: source
"The label on the title line indicates the kind of frame."
ontology
"Return the ontolgy. If nil initialize one."
ontology: aHumOntology
parseActionLine: source
"An action line begins with 'Action:' or 'To:' label.
parseActionLine: aString keywords: aCollection
"An action line begins with 'Action:' or 'To:' keyword.
parseInstructionSource: source keywords: keywords
"Parse the source -- Return a list of token-type pairs: ( token -> tokenType ).
parseMarkupSource: aSourceString
parseSource: source keywords: keywords
"Parse the source -- Return a list of token-type pairs: ( token -> tokenType ).
removeAnnotationFromSource: aSourceString
removeCommentFromSource: aSourceString
removeLabelFromSource: aSourceString
"If there is a label, remove it and return the remainder."
saveOntologyOnFileNamed: aFileName
"Save my ontology on the given ReferenceStream file."
writeFrame: aFrame onStream: aStream
"Write frame-lines to given stream in canonical format. *** NO SENDERS ***
writeOntologyContextVignettesOnStream: aStream
writeOntologyFrame: aFrame onStream: aStream
"Write to given stream - customize per frame-type as needed."
writeOntologyFrameWithIndents: aSubFrame onStream: aStream
"Vignette and View frames use dot-leader only for instruction lines."
writeOntologyFramesOfType: aFrameClass onStream: aStream
"Select frames of given class and write them on the stream."
writeOntologyOnTextFileNamed: aFileName
"Save my ontology in text format on the file with the given name. "
writeOntologyRoleActionsOnStream: aStream
"Write role-action frames ordered by role and action."
writeOntologyVFrame: aFrame onStream: aStream
"Write UI frames: Vignette and View frames only use dot-leader for instruction lines."
Hum-IDE -- HumTextEditor
beep
"Signal that cursor is out-of-bounds."
bumpColumn: anInteger
bumpRow: anInteger
column
"What is the current column position of the cursor?"
column: anInteger
"Move cursor to given column position."
currentLine
^self lineAt: (self row).
currentLine: aString
cursorPosition
"Where is the insert point?"
deleteOrMerge
"Delete character to left of cursor.
drawTextOnCanvas: aHumCanvas font: aFont
drawTextOnPane: aHumPane font: aFont
hasNewContent
"Has the content been changed? -- (Dirty data flag)"
hasNewContent: aBoolean
"Set true whenever the content has been changed."
insertCharacter: aCharacter
keyStroke: aCharacter
"Respond to simple keyboard input. (KISS: a character)
lineAt: anInteger
"Get string for given row"
lines
"PRIVATE: My text lines.
row
"What is the current row position of the cursor?"
row: anInteger
"Move cursor to given row position."
splitRow
Hum-Language -- HumCommentLine
source: aString
"override supertype parsing"
Hum-Language -- HumConditionLine
<= aHumConditionLine
"Provide a way to order preconditions
annotation
^ annotation ifNil: [ '' ].
annotation: aString
"Annotation may indicate that condition is 'assumed'. Other cases are not yet defined."
checkSyntaxWithOntology: aHumOntology
comment
^ comment ifNil: [ '' ].
compileLineToOntology: aHumOntology
"compile a precondition line into the ontology.
source
| s |
source: aString
"DEBUG: Should not be 'Precondition' or: 'Pre'"
statement
statement: aSource
"Set my statement."
Hum-Language -- HumDictionaryLine
comment
^ comment ifNil: [ comment := String new. ].
compileLineToOntology: aHumOntology
"Add nouns and noun-relations to the ontology.
getListAfter: aString
source
"Construct a source line based on convention and content of my attributes."
statement
^ statement ifNil: [ statement := HumStatement source: (self source). ]
statement: aStatementString
Hum-Language -- HumFrame4Action
actionStatement
^ actionStatement ifNil:[ Error signal: 'Action frame must have an action statement'].
actionStatement: anObject
appendInstructionRole: aRole statement: aStatement
appendInstructionRole: aRole statement: aStatement comment: aComment
appendInstructionStatement: aSource
checkSyntaxWithOntology: anOntology
"Critique the instructions for this role action."
compileToOntology: aHumOntology
"Compile the frame into the ontology."
instructionLines
^ instructions ifNil: [ instructions := OrderedCollection new ].
instructions
^ instructions ifNil: [ instructions := OrderedCollection new. ].
instructions: anObject
role
^ role.
role: anObject
titleLine
"Format a cannonical title line."
Hum-Language -- HumFrame4Comment
appendFrameLine: aLine
Hum-Language -- HumFrame4Data
appendEntity: aEntityName attrribute: anAttributeName value: aValueString
asString
Hum-Language -- HumFrame4Dictionary
addDictionaryLine: aSourceString
compileToOntology: aHumOntology
"Each dictionary line will have some additive effect on the ontology."
Hum-Language -- HumFrame4Plan
actionStatements
^self planActions.
appendInstructionRole: aRole statement: aStatement
appendPrecondition: aSource
appendPrecondition: aStatement annotation: anAnnotation
appendRole: aRole action: aSource
"Add 'role: action-statement' to plan-frame"
appendRole: aRole action: aSource comment: aComment
"Add 'role: action-statement. (comment)' to plan-frame"
check
"Check the basic integrity of the plan frame."
checkSyntaxWithOntology: anOntology
compileToOntology: aHumOntology
"Check the basic integrity of the plan frame.
goal
"Get the plan frame's goal statement."
goal: aSource
"This instance variable contains the plan frame's goal statement."
isNoPlan
"Frame is no plan if there are no preconditions and no actions.
planActions
"A sequence of actions to be performed after preconditions are satisfied.
preconditions
"Preconditions are ordered to preserve the author`s sequence,
Hum-Language -- HumFrame4View
addMarkUp: aSource
compileToOntology: aHumOntology
""
entity
^ entity ifNil: [ entity := HumCalculator given: (self titleLine) extractAfter: ': '].
entity: anObject
viewEntity: anEntityType.
"What entity-type is this view displaying."
viewName: aString
"Caller passes the name of the view - to be used in calls."
Hum-Language -- HumFrame4Vignette
addPattern: aPatternString
"Enter a pattern -- What pattern will the vignette respond to?"
addVignetteInstruction: anInstructionLine
"Append an instruction to be executed in response to the user / client."
addVignettePattern: patternString
"Append an Pattern to be matched in response to the user / client."
addVignetteResponse: aResponseString
"Append a verbal response line."
checkSyntaxWithOntology: anOntology
"Check the vignette for syntax problems."
compileToOntology: anOntology
"Update the ontology with this vignette."
inputToken: inputToken isEquivalentTo: patternToken
"Is the input equivalent to the pattern?
inputTokensIn: aString
"Return the pattern tokens in the given string."
instructionLines
"Return the vignette's instruction lines. "
nextVignetteContext
"By default, the next context is the current context."
nextVignetteContext: aContextName
"What will be the context after the response is rendered?
patternFields: pattern
"Parse the pattern and return the [noun] fields - including the brackets.
patternMatchScore: aString
"How well does the string (from client) match the pattern int this vignette?
patternNouns
"TODO: DOES THIS BELONG IN HumVignettePatternLine ?"
patternNouns: pattern
"Parse the pattern and return the nouns referenced in [noun] fields.
patternTokensIn: aString
"Return the pattern tokens in the given string.
patterns
^ patterns ifNil: [ patterns := OrderedCollection new ].
responseLines
"What will be the verbal response? "
titleLine
vignetteContext
"The context is used to prioritize responses when two or more patterns match a user input.
vignetteContext: aContextString
"The context is used to prioritize responses when two or more patterns match a user input.
zpatternMatchScore: aString
"How well does the string (from client) match the pattern int this vignette?
Hum-Language -- HumFrameLine
checkForAntecedantsIn: aHumStatement withOntology: aHumOntology
checkSyntaxWithOntology: aHumOntology
comment
"Any frame line can have a comment."
comment: aString
"Any frame line can have a comment."
compileLineToOntology: aHumOntology
"Compile this instruction line."
doTokensIn: input at: x matchPatternTokensIn: patternTokens at: xPattern
"See if we can get any matching sequence."
extractPatternParameters: aPatternString
"Extract parameters (tokens) from source that match the pattern."
generateCodeFrom: aTemplateString using: parameterValues
"Generate code (string) from the template replacing parameters with values in the parameter list."
getParametersIn: input at: x thatMatchParametersIn: patternTokens at: xPattern accumulating: parameters
"See if we can get any matching sequence."
getTokensIn: aString
"This is a helper for #matchesPattern: (). It implements a Hum-friendly tokenizer."
matchesPattern: aPatternString
"Does some part of the frame-line match the given pattern?"
onMatch: aPatternString generate: aTemplateString
"When some part of the content in the current line matches the pattern,
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
sameAs: anotherFrameLine
source
^ source
source: aString
Hum-Language -- HumFrame
appendFrameLine: aFrameLine
"Append a line to the frame."
checkSyntaxWithOntology: anOntology
compileToOntology: aHumOntology
debug
"Am I in debug mode?"
debug: aBoolean
delegateToTranslator
delegated
frameLines
^frameLines ifNil: [ frameLines := OrderedCollection new.]
frameName
"The name of the frame is guaranteed to be a string.
initialize
"The instance should always be a subtype."
isEmpty
linesAsHTMLwithOntology: anOntology
ontology
^ ontology
ontology: anOntology
origin
"Where did this frame come from?"
origin: aString
"Where did this frame come from?"
prettyPrintWithOntology: aHumOntology
"Pretty-print using HTML5 and CSS
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
title
^ self titleLine
titleLine
^titleLine
titleLine: anObject
uniqueIdentifier
"Note: Lazy initialization for this frame`s identifier."
zcompileToOntology: aHumOntology
Hum-Language -- HumInstructionLine
= anInstruction
"??? Looks like bad code ??? "
annotation
^ annotation ifNil: [^'' ].
annotation: aString
"Annotation may indicate timing for simulations.
checkSyntaxWithOntology: aHumOntology
checkSyntaxWithOntology: aHumOntology defaultRole: aRole
comment
^ comment ifNil: [''].
comment: aString
"Comment is not executable. May be displayed in certain contexts."
compileLineToOntology: aHumOntology
"Compile this instruction line."
compileLineToOntology: aHumOntology defaultRole: aRole
"Compile this instruction line."
indent
"How many indents (tabs) before the start of the code-text ?"
indent: aSmallInteger
"How many indents (tabs) before the start of the code-text ?"
jobTicket
"There should be a job ticket if the (run-time) caller expects one."
jobTicket: aJobTicket
"At run-time, a job ticket may be associated with action request."
onComment: aBlockClosure
"If instruction includes a comment, execute the block."
onRole: aBlockClosure
"If instruction includes a role prefix, execute the block."
role
"What role am I delegating to? If none, the instruction is to myself."
role: aString
"Delegate the task (statement) to this role at run-time. "
source
"Construct a source line based on convention and content of my attributes."
source: aString
"Should not be: 'Action:' block-label."
statement
"What will be done . . . will be done at run-time."
statement: aSource
"What to do at run-time?"
title
^ self titleLine.
titleLine
^ ( self role), ': ', ( self statement asString ).
translation: aString
Hum-Language -- HumMarkupLine
checkSyntaxWithOntology: aHumOntology
"Syntax errors in mark-up mainly have to do with widgets that won't work.
compileLineToOntology: aHumOntology
generateCodeOfType: aSymbol fromTokens: tokens at: xToken
"Generate code of the given type HTML/Seaside/JavaScript based on token stream."
generateHtmlTableFor: aNoun withOntology: anOntology
getWidgetArgument: aWidgetString
"Parse the widget string to get verb`s argument, if any."
getWidgetNoun: aWidgetString
"Parse the widget-string to get the widget`s noun (blackboard entity-attribute-name), if any."
getWidgetVerb: aWidgetString
"Parse the widget-string to get the widget`s verb, if any."
widgets
"Scan the source matching pairs of [. . .] or [[. . .]]."
Hum-Language -- HumOntologyTranslator
asJava
"This is crude version.
attachAction: aMethodName toActorClass: aClassName fromSource: aSource
"Attach the given method source
attachPrologToActorClass: aClassName fromSource: aSourceString
"Attach the given prologue source code to the named class."
contextEntity: aString
countLeading: aCharacter inString: line
"Count leading"
genHTML: generatedCodeString
"Append generated code to 'html' instance variable. (YIKES!)"
generateErlangDocumentation
generateErlangForActionCall: aString
"Translate a Hum Action call into an Erlang OTP call."
generateErlangForActionHeader: aString
"Then: The do header looks like 'do( { action-statement, noun-values } )' "
generateErlangForEntity: anEntity
"Translate entity into an Erlang record data structure. <<< OBSOLETE
generateErlangForInstruction: aHumInstructionLine
"Generate self-call or RPC for given instruction."
generateErlangForPlanFrame: aHumFrame4Plan
"Translate the plan frame into an Erlang data structure.
generateErlangForRole: aRoleName
"Generate Erlang code for the given role-name."
generateErlangForRoles
"Generate a Erlang module file for each Hum role."
generateErlangForSelfCall: aString
"Translate a Hum Self call into an Erlang self call."
generateErlangNounValuesForStatement: aStatementString
generateHTMLforMarkupLines: aListOfFrameLines blackboard: aBlackboard
"Build HTML for the given list of frame-lines"
generateHTMLforMarkupString: aMarkupString blackboard: aBlackBoard
"Build output until we see a substring matching aStopString."
generateHTMLforViewFrame: aHumFrame4View blackboard: aHumBlackBoard
"Wrap viewframe lines with HTML form and submit logic."
generateJavaCallForFrameLine: aHumInstructionLine
generateJavaCallForStatement: aHumStatement
generateJavaConditionalForStatement: aHumStatement
generateJavaForFrame: aHumFrame4Action
"Translate frame to Java using the nouns given in the ontology."
generateJavaForFrameLine: aHumInstructionLine
generateJavaForPlanFrame: aHumFrame4Plan
"The plan is data, so translation involves translating each goal frame into a series of Java setters.
generateJavaForStatement: aHumStatement
generateJavaIterationForStatement: aHumStatement
"Given a Hum for-statement, generate a Java for-statement."
generateJavaMethodDeclarationForStatement: aHumStatement
generateJavaScriptAngularReadMe
"Angular is a JavaScript user interface framework."
generateSeasideForView: aHumFrame4View
"Implement the view frame via Seaside components.
generateSeasideForViewMarkup: aHumMarkupLine
"Generate Seaside code to implement a view mark-up line."
generateSeasideHeadingFor: source
"Generate Seaside heading code for the given heading line."
generateSeasideWidgetForField: fieldName
generateSeasideWidgetsForSource: aSourceString
"Generate Seaside calls for the widgets found in this mark-up line."
generateSmalltalk
"This is crude version.
generateSmalltalkActionFor: aHumFrame4Action
"Translate frame to Smalltalk using the nouns given in the ontology."
generateSmalltalkForConditional: aHumStatement
generateSmalltalkForFrame: aHumFrame
"Translate frame to Smalltalk using the nouns given in the ontology."
generateSmalltalkForFrameLine: anInstructionLine
generateSmalltalkForStatement: aHumStatement
generateSmalltalkIfFor: aHumStatement
"Translate a Hum if-statement into a Smalltalk ( ) ifTrue: [] expression."
generateSmalltalkIterationFor: aHumStatement
generateSmalltalkOnFile: aFileName
"Open file and produce File-Out / File-In format."
generateXamarinReadMe
"Xamarin runs on Windows, iOS, and Android devices. (client side)
getMethodsForClass: aClassName
"Get the methods colletion (a Dictionary) for the given Class"
html
^html ifNil: [html := ReadWriteStream on: ''.].
humParserError: aComplaint inCodeFragment: aCodeFragment
methodsForClasses
^ methodsForClasses ifNil: [ methodsForClasses := Dictionary new ].
moveCodeGenerator
nounAsCamelCase: aNoun
"Generate camel-case string the the given noun."
nounsAsJava
"Emit java code that implements noun relations."
ontology
^ ontology ifNil: [ontology := HumOntology new.]
ontology: aHumOntology
prologues
^ prologues ifNil: [ prologues := Dictionary new ].
rolesAsJava
when: aSource matchesPattern: aPattern produce: aBlock
Hum-Language -- HumOntologyViewer
asHTML5
"Render the ontology as an HTML5 page.
asHTML5withCritique
"Render the ontology as an HTML5 page.
asHTML5withCritique: withCritique withBase: withBase
"Render the ontology as an HTML5 page.
asHTML5withCritiqueSkippingBaseOntology
"Render the ontology as an HTML5 page.
buildDiagramForNoun: aNoun onDiagram: aDiagram
"Add the noun`s relationships to that diagram."
buildNounTreeForNoun: aNoun indent: anIndentLevel
""
css
"generate HTML Cascading Style Sheet (CSS) code segment"
generateCategoryPullDownFor: aNoun
"Render category noun as a pull-down selection."
generateHtmlTableFor: anEntity
"Generate a dummy table showing the attributes for this entity-name."
initialize
modeStack
"Stack to track list-type modes."
ontology: aHumOntology
render: asSymbol onFileNamed: aNewFile
renderActionFrame: aHumFrame4Action
"Render action frame with indentation.
renderActionFrame: aHumFrame4Action withCritique: aBoolean
"Render source code.
renderActionLine: aHumFrameLine
renderAs: aSymbol
"FUTURE: Render as X -- Currently not needed."
renderAsHTMLonFileNamed: aNewFile
"Render as HTML5 and echo on given file."
renderAsHTMLwithCritique: withCritique withBase: withBase onFileNamed: aNewFile
"Render as HTML5 and echo on given file."
renderAsHTMLwithCritiqueOnFileNamed: aNewFile
"Render as HTML5 and echo on given file."
renderCommentIn: aFrameLine
"Render comment (if any) as HTML"
renderConditionLine: aHumConditionLine
renderCritiqueForFrame: aHumFrame
"Return (HTML5) rendering of the frame`s critique"
renderDictionaryLine: aHumDictionaryLine
renderFrame: aHumFrame withCritique: withCritique
"Render (pretty print) source code.
renderFrame: aHumFrame withCritique: withCritique withBase: withBaseOntology
"Render (pretty print) source code.
renderFrameLine: frameLine
"Dispatch frameLine to rendering specialist."
renderFrameLinesIn: aHumFrame
"Iterate throught the frame lines"
renderInstruction: aHumStatement
"Pretty-print statement as HTML"
renderInstructionLine: aHumInstructionLine
"Pretty-print using HTML5 tags and CSS."
renderMarkupAsHTML5: markupSource
"Render the given mark-up text as HTML headings, lists, emphasis."
renderMarkupEmphasisAsHTML5: aString
"Render bold, italic, underscore emphasis."
renderNounTreeForNoun: aNoun
"Render a noun-tree rooted at the given noun (entity)."
renderNounTreeForNounAsHTML: aNoun
"Render a noun-tree rooted at the given noun (entity)."
renderPlanActionsIn: aHumFrame4Plan
"render precondition lines"
renderPlanFrame: aHumFrame4Plan
"Render source code.
renderPlanPreconditionsIn: aHumFrame4Plan
"render precondition lines"
renderPlanTreeForGoal: aGoal
"Render HTML for a previous created planTree (generated by buildPlanTreeForGoal: )"
renderStatement: aHumStatement keywords: keywords
renderStatement: aHumStatement triggerWords: triggerWords keywords: keywords
renderView: aHumViewFrame
"Views are rendered as HTML forms -- which is different from other frames."
renderWidgetsInMarkup: aSourceString
"Return HTML5 equivalent of the widgets found in this mark-up line."
showPlanTree: aPlanTree
"Display a previous created planTree (generated by buildPlanTreeForGoal: )"
showPlanTreeForGoal: aGoal
"Display a previous created planTree (generated by buildPlanTreeForGoal: )"
Hum-Language -- HumOntology
actionsOf: aRole
"The actions of a role define its public interface. (API).
addEntity: anEntity attribute: anAttribute
"Define these nouns and their relationship."
addEntity: anEntity attributes: anAttributeCollection
"Define these nouns and their relationship."
addNoun: aNoun
"Remember noun."
addNoun: aSubType isA: aSuperType
"Add these nouns and add is-A relation."
addNoun: aNoun isDerivedFrom: anotherNoun
addNoun: aSynonym isSynonymFor: aStandardNoun
"Add these nouns and add is-A relation."
addNoun: aNounString reference: aFrameLine
"Remember where nouns are referenced."
addNouns: anArrayOfNouns
addPlanFrame: aPlanFrame ForGoal: aGoalString
"Store frame as a plan frame - index as needed."
addRole: aRole
addViewFrame: aHumFrame4View
addVignette: aFrame4Vignette toContext: aContext
"Add to store"
allAttributesOfEntity: anEntity
"Get the attributes, the attributes of the attributes, and the attributes of the supertypes."
allSubtypesOf: aSuperType
"Get the subtypes (if any) of this noun and the subtypes of the subtypes all the way down"
allSupertypesOf: aSubType
"Get the Supertypes (if any) of this noun and the Supertypes of the Supertypes all the way down"
appendInstruction: aHumInstruction toRole: aRole action: anAction
"Append the given instruction to the action's sequence of instructions."
appendRole: aRole action: actionStatement
"Add role and action statement."
asString
attributeChain
^attributeChain ifNil: [ attributeChain := Stack new.]
attributeChainPop: anAttribute
attributeChainPush: anAttribute
buildPlanTreeForGoal: aGoal indent: anIndentLevel
"Build a list of associations: ( goalStatement -> { anIndentLevel. precondition statement.} )"
categoriesOf: anAttributeName
categoriesOf: anAttributeName include: anArrayOfCategoryNames
"Add this noun in case it is not already added;"
checkPlanTreeForGoal: aGoal
cleanKey: aString
"Assure that the string will be a clean key -- convert to lower-case, trim blanks."
codeGenerator
"Return a translator."
collectPlanFramesForGoal: aGoalStatement
"| goalStatement planTree subTree rootFrame |
compileAllFrames
"Compile the dictionary frames first, then the others."
contextVignettes
"This list holds the (1:M) relation (context -> vignette)."
contexts
^ contexts ifNil: [ contexts := Set new. ]
critiqueRole: aRole action: anAction
"Critique the instructions for this role action."
debug
"Am I in debug mode?"
entityAttributes
"This instance variable is a map, a set of associations ( anEntity -> anAttribute )"
fetchFrameByIdentifier: aPrimaryKey
"Fetch the frame with this identifier."
fetchFrameByName: aString
file
^ fromFile ifNil: [ fromFile := 'HumOntologyFile.ontology' ].
file: aString
findBestMatchingVignetteForInput: aString inContextStack: aStack
"Search the vignette frames for the one whose pattern is the best match
frameRelations
"The cross index collection tracks relationships between frames."
frameRelationsWhere: aBlock
"Return frame relations where aBlock evaluates as true"
frames
^ frames ifNil: [ frames := Set new. ].
framesByIdentifier
"Each frame is given a unique identifier.
framesByName
"Enable access to frames by their name (title line string)."
fromFile
"The file name serves as a natural identifier. "
getEntityAttributePhraseFromStatement: aHumStatement
"Return collection of 'entity attribute' pairs when statement contains possessive nouns."
getFrameForRole: aRole action: anAction
"Get the frame that matches given role and action."
getFramesThatDefineContext: aContextName
"Get the vignette frames that define the given context."
getFramesThatInvokeAction: anActionString
"Lookup the frames where action is invoked."
getFramesThatInvokeContext: aContextName
"Get frames with 'Push context <aContextName>.' instructions."
getFramesThatInvokePrecondition: aStatementString
"Lookup the frames where precondition is invoked."
getFramesThatInvokeView: aViewName
"A view may be invoked by another view or by a vignette."
getFramesWithRelation: aSymbol object: aName
"Get frames that are indexed with given relation and object."
getPlanFrameForGoal: aGoalString
getRole: aRole action: aStringOrStatement
"Get the action if it already exists."
getViewFrame: nameString
"Get the view frame with the given name."
hasNoVignetteMatchFor: aString
immediateAttributesOfEntity: anEntity
^ self projectValuesOf: (self entityAttributes) from: anEntity.
immediateSubtypesOf: aSuperType
"Get the subtypes (if any) of this noun."
immediateSupertypesOf: aNoun
"Get the immedate supertypes (if any) for this noun."
indexFrame: aHumFrame relation: aSymbol object: aKeyString
"Add the given frame to the index"
indexRole: aRole action: actionStatement
"Index role and action statement."
instructionsForRole: aRole action: anAction
isActionDefined: anInstructionLine inRole: aRole
"Has the given statement been defined as an action for the given role?"
isActionDefinedV01: anInstructionLine
"See if we have a definition for the given action."
isAttribute: aNameString
"Does the string name an attribute? (An attribute has no attributes of its own.)"
isCategory: aNameString
"Does the string name an attribute? (An attribute has no attributes of its own.)"
isEntity: aNameString
"Does the string name an entity?"
isEntity: entityName attribute: attributeName
"Does this combination make sense? "
isNoun: aNounString
"Is the given string a noun?"
isPluralNoun: aNoun
"Return true if the noun is plural."
isViewName: aString
"Does the string name a view frame?"
nounAsCamelCase: aString
nounCategories
"(self nounCategories) at: attribute put: setOfCategories."
nounReferences
"(self nounReferences ) add: ( aNounString -> aFrameLine )."
nounSubtypes
"This instance variable is a map, a set of associations ( aSuperType -> aSubType )."
nounSynonyms
"(self nounSynonyms) add: ( theSynonym -> theNoun)."
nouns
"This instance variable is the set of all nouns that have been defined so far."
nounsInStatement: aHumStatement
"Return the (known) nouns found in the statement."
parseFrameLine: frameLine keywords: keywords
"Parse the frameLine -- Return a list of token-type pairs: ( token -> tokenType ).
parseStatement: aHumStatement triggerWords: triggerWords keywords: keywords
"Parse the statement -- Return a list of token-type pairs: ( token -> tokenType ).
planFrames
printOn: aStream
projectValuesOf: aSetOfAssociations from: aKey
"encapsulate a bit of recurring code"
roleActions
"This instance variable is a map, a set of associations ( role -> actionStatement ) "
roles
"This instance variable contains the set of all roles that have been defined so far."
setAutomaticSupertypeForNoun: aNoun
"If a hyphenated nouns ends with the name of another noun,
singularFormOfNoun: aNoun
"If noun ends in 's' remove the 's'. Crude."
storeFrame: aFrame
"Store this frame in the ontology.
title
^ title ifNil: [ title := (self fromFile), ' -- No title yet.'. ].
title: aString
view
^viewer ifNil: [ viewer := HumOntologyViewer ontology: self. ].
vignettesForContext: aRequestedContext
xparseString: aStatementString keywords: keywords
"Coding experiment to see if I can tweak existing code to handle quoted strings."
yesNoun: aSubtype isAKindOf: aSuperType
"Is the noun a subtype of the given supertype? Used when matching action statements."
yesRole: aRole hasAction: aSource
"Is the given action defined for the given role?"
Hum-Language -- HumParser2
alphanumeric: aString
"Match that part of the string that is alpha-numeric"
checkbox: aSource
"Does the current source start with a check box widget?"
checkbox: aSource produce: aProductionBlock
"Does the current source start with a check box widget?"
digits: source
"Match leading part of source that is digits"
generateChoicesFor: anAttributeName inOntology: aHumOntology
"Generate HTML choice tags"
generatedCode
""
ignoreNext
^ignoreNext ifNil: [ ignoreNext := false. ].
ignoreNext: aBoolean
markupSyntax
"Experimental BNF syntax"
markupSyntaxWithOntology: anOntology
"Experimental BNF syntax"
markupSyntaxWithOntology: anOntology blackBoard: aBlackBoard
"Experimental BNF syntax"
match: source oneOf: anArrayOfSyntaxThings
match: source oneOf: anArrayOfSyntaxThings produce: productionBlock
"Does current source match array? If so, run the production."
match: source repeat: anArrayOfSyntaxThings
"Does current source match array?"
match: source sequence: anArrayOfSyntaxThings
"Does current source match array?"
match: source sequence: anArrayOfSyntaxThings produce: productionBlock
"Does current source match array? If so, run the production."
match: aString with: syntaxThing
"Does aString match with syntaxThing?"
noun: source
"Match that part of the string that might name a Hum noun"
ontology: aHumOntology blackBoard: aBlackBoard produceView: aViewName
"Produce the HTML for the given view frame."
ontology: aHumOntology isAttribute: aSource
"Does the current source, upto some delimiter, match an ontology attribute name?"
ontology: aHumOntology isCategory: aSource
"Does the current source, upto some delimiter, match an ontology category name?"
ontology: aHumOntology isEntity: aSource
"Does the current source, upto some delimiter, match an ontology entity name?"
ontology: aHumOntology isViewName: aSource
"Does the current source, upto some delimiter, match an ontology view name?"
ontology: aHumOntology isViewName: aSource produce: productionBlock
"Does the current source, upto some delimiter, match an ontology view name?
ontology: aHumOntology produceView: aViewName
"Produce the HTML for the given view frame."
pop: aSmallInteger
push: aString
pushIgnore: aString
radioButton: aSource produce: aProductionBlock
"Does the current source start with a radio button widget?"
spaces: source
"Match leading part of source that is digits"
stack
^stack ifNil: [ stack := OrderedCollection new.]
text: aString
"Return that part of string that contains no mark-up."
top
url: source
"Does current source match a URL pattern?"
Hum-Language -- HumStatement
= aStatement
asCamelCase
"Convert this statement to camelCase."
asCamelCaseWithOntology: aHumOntology
"Convert this statement to camelCase."
asString
^ self source asString.
delegateToTranslator
errors
^errors ifNil: [ errors := Set new.].
hash
"This HACK (which may be a bad idea) makes HumStatement hash the same as a matching string.
isConditional
isSatisfied: aBoolean
matchesCandidateStatement: aCandidate inOntology: aHumOntology
"Does the candidate match me? (Candidate nouns might be subtypes of my nouns.)"
matchesTemplateStatement: aStatementTemplate inOntology: aHumOntology
"Do I match the given template? (My nouns may be subtypes of template nouns)"
noun: aNoun value: aValueObject
"Noun values are set at run-time just prior to executing the statement.
nounAsCamelCase: aString
"Delegate to ontology class"
nounValues
"Noun values are set at run-time.
onMatch: aPatternString do: aBlockClosure
"When my source matches pattern, execute the block with matching arguments.
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
role
^role ifNil: [ Error signal: 'role was not set in HumStatement']
role: aString
"What role is meant to execute this statement?
sameAs: aHumStatement
"Return true if receiver is semantically equivalent to (argument) aHumStatement."
source
^ source ifNil: [ source := '' ].
source: aSource
"Set and check the source string."
stripRole
"Source should not contain a role prefix in this context.
syntaxError: anErrorMessage
"Error signal: anErrorMessage."
tokens
"Return the tokens in the statement as an array of strings."
translation
"How might the statement be translated into another programming language?"
translation: aString
"How might the statement be translated into another programming language?"
Hum-Language -- HumVignettePatternLine
checkSyntaxWithOntology: aHumOntology
"TODO: Look for [noun]. Is the noun defined in the ontology?"
Hum-Language -- HumVignetteResponseLine
checkSyntaxWithOntology: aHumOntology
"TODO: Look for [noun]. Is the noun defined in the ontology?"
Hum-RunTime -- HumActor
blackboard
^ blackboard ifNil: [ blackboard := HumBlackBoard new. ].
blackboard: aHumBlackBoard
checkIn
checkOut
"Tell the Dispather that this actor is no longer available for assignments."
completedAction: anAction inRole: aRoleString onJob: aHumJobTicket
"Following is first-cut direct call.
completedInstruction: aHumInstructionLine inRole: aRoleString onJob: aHumJobTicket
"Following is first-cut direct call.
delegateAction: anAction toRole: aRole onJob: aJobTicket
"Delegate action to another role."
dispatcherID
^self configuration dispatcherID.
ontology
^self configuration ontology.
roles
roles: anArray
runAction: anAction inRole: aRole onJob: aHumJobTicket
"Run the action frame named ..."
runInstruction: anInstruction inRole: aRole onJob: aJobTicket
"Execute, simulate, or log the given statement"
updateBlackBoardFromBlackBoard: aHumBlackBoard
"Update my blackboard with entries from callers blackboard."
zrunInstruction: anInstruction inRole: aRole onJob: aJobTicket
"Execute, simulate, or log the given statement"
Hum-RunTime -- HumBase
entitiesOfType
^ entitiesOfType ifNil: [ entitiesOfType := Dictionary new ].
entitiesWithValue
"A dictionary of sets. The set of entities with the given { attribute value }."
entityAttributeValue
"A dictionary holding a temporal stack of {value event} for each {entity attribute}.
entityID: anID entityType: aType attribute: anAttribute value: aValue event: anEvent
"Create a record of entity-attribute-value from event."
eventWho: aWho what: aWhat where: aWhere why: aWhy
events
^ events ifNil: [ events := Dictionary new].
findEntitiesOfType: anEntityType
findEntitiesWhereAttribute: anAttributeType satisfies: aBlockClosure
"Get collections of entities where current attribute value satisfies condition"
getEntityID: anEntityID attribute: anAttributeType
"Get the current value for given entityID attributeType"
insert: anItem at: aKey into: aDictionaryOfSets
"Insert the item into a set at the given key."
push: anItem at: aKey onto: aDictionaryOfStacks
"Insert the item into a list at the given key."
remove: anEntityID at: aKey from: aDictionaryOfSets
"Remove the entityID from the set associated with the key."
Hum-RunTime -- HumBlackBoard
appendEntity: childEntityID toEntity: parentEntityID list: anAttributeName
"Append the given child entity to the named list attribute"
businessEvent
"What business event is in progress?"
businessEvent: aString
"What business event is in progress?"
cleanAttribute: anAttributeNameString
cleanEntity: anEntityTypeString
"Assure that the type-name is properly-trimmed, lowercase string"
clearEntity: anEntityType
"Clear all data for the given entity-name / entity-type."
entityIdentifiers
"What identifier is associated with a entity type noun (entity name)?"
generateNewIdentifierForEntityName: anEntityName
"Create a unique identifier for an instance of the given entity-name noun."
getEntityID: entityID attribute: anAttributeName
" Get requested value (if any) from the blackboard instance "
getEntityName: anEntityName attribute: anAttributeName
"Get the entityID for that entity-name and fetch the requested attribute."
identifierForEntityName: anEntityName
"Do I already have an entity of that name?
makeEntityOfType: anEntityType
"Add a new entity ID for the given entity type. (entity name)."
quads
"a dictionary of { aValue. tau. } keyed by ( entityID -> attribute )"
setEntityID: entityID attribute: anAttributeName toValue: aValue
"Store given value in the blackboard with a time-stamp.
setEntityName: anEntityName attribute: anAttributeName toValue: aValue
"for now -- same as:"
updateBlackBoardFromBlackBoard: aHumBlackBoard
"Update myself from entries in the other blackboard."
worldbase
^ worldbase ifNil: [Error signal: 'Blackboard configured without a world base.']
worldbase: aHumWorldBase
Hum-RunTime -- HumBookkeeper
chargesBy: attribute
"Produce dictionary of sums for given subdivision type."
chargesByAction
"Produce dictionary of sums keyed by action."
chargesByActor
"Produce dictionary of sums keyed by actor."
chargesByJob
"Produce dictionary of sums keyed by job."
chargesByMetric
"Produce dictionary of sums keyed by unit of measure. "
chargesByRole
"Produce dictionary of sums keyed by role-name.."
jobTickets
^ jobTickets ifNil: [ jobTickets := OrderedCollection new. ].
recordJobTicket: aHumJobTicket
"Add the given job ticket to my collection of job tickets."
Hum-RunTime -- HumBusinessEvent
what: aString
"What is the cause/actor doing in the business event?"
when: aTimeStamp
"When (at what date-time) is business event happening?"
where: aString
"Where (at what location/context) is business event happening?"
who: aString
"Who is the cause/actor in the business event"
who: aWho what: aWhat when: aTimeStamp where: aWhere why: aJobTicket
"Set the business event attributes."
why: aJobTicket
"Why (job-ticket) is business event happening?"
Hum-RunTime -- HumCalculator
cases
"Initialize case cascade.
doTokensIn: input at: xInput matchPatternTokensIn: pattern at: xPattern
exdent
"Remove a tab from the global indent string."
fillTemplate: template fromDictionary: dictionary
"Create a String based on the given template and parameters."
given: sourceString extractAfter: stringA
"Return the substring in the sourceString between the two."
given: input extractAfterSecond: marker
"Parse cases like matching quotes or markup emphasis."
given: sourceString extractBetween: stringA and: stringB
"Return the substring in the sourceString between the two."
given: sourceString extractUpto: stringA
"Return the substring in the sourceString between the two."
given: inputString onMatch: aPatternString do: aBlockClosure
"When the inputString matches pattern, execute the block with matching arguments.
given: input replaceAll: old with: new
given: s topic: aTopic doOnce: aBlock
"Use this to produce subheadings."
indent
"Append a tab to the global indent string."
indentLevel: n
"Reset the indent level. Produce indent string (tabs)."
initialize
justTheWordsIn: aString
^self class justTheWordsIn: aString.
on: aValue do: aBlockClosure
otherwise: thenBlock
"If a prior case was true, ignore this case.
parse: aString
"Parse into { token. type. start. stop. }"
priorCaseIsTrue
^ priorCaseIsTrue ifNil: [priorCaseIsTrue := false ].
scoreCandidate: candidateString againstPattern: patternString
"Return a score indicating the number of tokens that match."
string: stringA isLike: stringB
"Compare ignoring differences in whitespace."
string: aString isLike: aString2 ignore: aString3
^self class string: aString isLike: aString2 ignore: aString3.
switch: aCharacter
testValue: anObject
when: whenBlock then: thenBlock
"If the whenBlock evaluated to true, execute the thenBlock."
xml: aTagString dictionary: aDictionaryOrList
"Create a stand-alone tag (ending with '/>') with the given attribute values."
xml: aTagString dictionary: aDictionary with: aBlockClosure
"Generate the front tag and the end tag with block to produce the middle"
xml: tagString list: anArray
"Iterate: Enclose each item with given tagString"
xml: aTag with: aBlock
"Fix up the indent after we get this working."
xmlOpen: aTagString dictionary: aDictionary
"Create an opening tag ( NOT ending with '/>' ) with the given attribute values."
Hum-RunTime -- HumConfiguration
bookkeeperID
^ bookkeeperID
bookkeeperID: anObject
clock
"What object is providing time-keeping?"
clock: anObjectThatImplementsNow
"Clock must be an object that imlements >>now as a number of seconds (an Integer)."
configuration: aHumConfiguration
"Copy configuration."
debug
"Am I in debug mode?"
dispatcherID
^ dispatcherID ifNil: [ Error signal: 'A configuration must have a Dispatcher.' ].
dispatcherID: anObject
getWorldBase
"Get this configuration`s worldbase instance."
isTest
"Are we running in TEST mode?"
isTest: aBoolean
"Are we running in TEST mode?"
messenger
^ messengerProxy
messenger: aHumMessenger
"Set the messenger -- Use to configure mocks when needed."
messengerID
^ messengerID
messengerID: aString
messengerID: idMessenger dispatcherID: idDispatcher bookkeeperID: idBookkeeper worldbaseID: idWorldbase
now
"What time is it in configured world (may be simulation)?"
ontology
^ ontology ifNil: [ Error signal: 'ontology is missing from configuration'].
ontology: aHumOntology
openWorldBase
"Create world base instance and register with messenger."
worldbaseID
^ worldbaseID
worldbaseID: anObject
Hum-RunTime -- HumCoordinator
conditionIsSatisfied: precondition
"Note that condition is satisfied.
context: aHumActor
coordinatorID: anID uri: aURI goal: aGoalStatementString dialog: aHumDialogAgent configuration: aHumConfiguration
dialogAgent: aHumDialogAgent
"Concept: The dialog agent provides noun values
getActionSequence
"Parse the job ticket to show the sequence of actions."
goal: aStatement
goalStatement
"Translate goal string to goal statement"
isPlanFrameRunnable: aHumFrame4Plan
"Determine if the given plan frame is runnable.
jobTicket
^ jobTicket ifNil: [ jobTicket := HumJobTicket title: goal ].
planIsRunnable
"TODO: ADD NEEDED CHECKS TO THIS STUB."
remainingConditions
^ remainingConditions ifNil: [ remainingConditions := Set new.] .
runAction: anInstructionLine
"Run the given action statement."
runPlan
"Run my plan.
runPlanFrameForCondition: aGoalString
"This visits the subtree and runs each frame that is ready to run.
runPlanSetup
"Setup to run a plan:
Hum-RunTime -- HumDecimal
fromString: aString
"Count the digits in the string to estimate accuracy."
nDecimal
"How many decimal places should we display."
nDecimal: anInteger
"How many decimal places should we display."
printOn: aStream
Hum-RunTime -- HumDialogAgent
askView: aViewName
buildDialogAgentOntology
"Return ontology with Dialog Agent actions defined and executable in Smalltalk."
clearEntity: entityType
"Clear prior data in my blackboard for the given entity type."
client: aString
clientSays: aString
"Match user utterance to vignette patterns in the ontology
contextStack
^ contextStack ifNil: [ contextStack := Stack new. self pushContext: 'Start.'. contextStack ].
dialogAgentOntology
"Return ontology with Dialog Agent actions defined and executable in Smalltalk."
dialogOntologySourceStream
"Return a stream of frames defining Dialog Agent actions."
extractFieldValuesFromUserInput: inputString pattern: patternString
"Extract values from user input and post to my blackboard.
fillInSlotIn: aMarkupString
" Fill-in first [entity attribute] dialog-response-slot with data from blackboard.
interpretVignette: aHumFrame4Vignette withInput: aUserInput
"Send response lines. Execute response instructions."
newEntity: anEntityType
"Create a new entity to be associated with the given entity-type/entity-name."
pushContext: aString
runAction: anAction inRole: aRole onJob: aHumJobTicket
"Dialog Agent knows: 'Ask view', 'Show view', 'Push context ...'"
sayToClient: aHumMarkupLine
"Say something to the client.
scribeProxy
"Return an instance that understands #systemSays:
showView: aViewName
Hum-RunTime -- HumDispatcher
actor: anActor completedAction: aHumStatement
"Dispatcher is informed that the actor completed the assigned action.
assignAction: aHumInstructionLine toRole: aByteString forJob: aHumJobTicket
assignRole: roleString action: actionInstruction
"Assign the given action to an actor advertising the given role."
availableActors
^ availableActors ifNil: [ availableActors := Set new. ].
busyActors
^ busyActors ifNil: [ busyActors := Set new ].
checkInActor: actorID at: aURI withRoles: actorKnowsRoles
"The Dispatcher should delegate finding the URI to messenger."
checkOutActor: anActorID at: anActorURI
"Actor is no longer available for assignments."
roleActor
"Return the role->actor map set."
runAction: anAction inRole: aRole onJob: aHumJobTicket
"Dispatch the action to an actor in the given role."
sendMessage: aMessageObject to: recipientID.
"TODO: HumActor does not need to know that delegating a statement is a message send.
Hum-RunTime -- HumEntity
asString
^self title.
debug
"Am I in debug mode?"
id
"Return a unique identifier."
id: aString
"Set the entity`s identifier."
printOn: aStream
title
"a display string describing this entity"
title: aString
"a display string describing this entity"
Hum-RunTime -- HumFuzzy
* aHumFuzzy
+ aHumFuzzy
- aHumFuzzy
/ aHumFuzzy
asCrudeMorph
asCrudeMorph2
asCrudeMorphInRectangle: aRectangle
"Display a plot in a Morph with the origin and extent indicated by the given Rectangle."
atP: aFloat
"Return the appropriate value from the distribution.
correctInterceptInDistribution: aDistribution
"-- Use slope-intercept to get a better estimate of the S-curve value at probability 0.
distribution: aDictionary
"Distribution is an S-curve that maps probability to value.
distributionDo: pvBlock
"Vist the key->value (probability->value) entries in the distribution."
fromScaledDecimal: aScaledDecimal
"Set the distribution from the given string.
fromString: aString
"Set the distribution from the given string.
initialize
interpolate: aProbability
"Return the predicted value at aProbability using linear interpolation."
mean
median
"find the point that represents the median"
op: aSymbol with: aHumFuzzy
"Add two fuzzy distibutions using Monte Carlo sampling"
sampleSize: anInteger
"Reset the sample size used in Monte Carlo sampling of input distributions.
sampleSize: aSampleSize resultDivisions: aDivisionCount
"Reset the sample size used in Monte Carlo sampling of input distributions.
sampleWithBlock: aBlock
"Operate on fuzzy distibution using Monte Carlo sampling"
Hum-RunTime -- HumHttpRequest
atField: aKey put: aValue
"The Http Request form included this input name:value pair."
fields
Hum-RunTime -- HumIdentifier
< aHumIdentifier
<= aHumIdentifier
asString
entityName
"Return entity name -- force nil to string if needed."
generateForEntityName: anEntityName inContext: aBusinessEvent
"Make self a unique identifier for given entity context."
initialize
"This UUID represents the run-time.
printOn: aStream
uuid: aUUID
Hum-RunTime -- HumJobTicket
appendCharge: aHumMeasure forAction: action byActor: anID inRole: aRoleName onJob: aJobID
charges
^charges ifNil: [ charges := OrderedCollection new.]
getActionSequence
"Parse the job ticket to show the sequence of actions."
printOn: aStream
Hum-RunTime -- HumMeasure
* multiplier
+ operand
- operand
/ aDivisor
< operand
= operand
> operand
@ aHumMeasure
abs
adaptToCollection: aCollection andSend: aSymbol
arcTan: aDenominator
"Return the arc-tangent (angle) for self divided by aDenominator"
as: aSymbol
"Convert to the unit of measure indicated by aSymbol, and renders as String"
asFloat
asMillimeter
"Convert pixel dimensions to millimeter dimensions"
asMillimeters
^self asMillimeter.
asPercent
asString
compareAngle: aRadianMeasure
"Handle special arithmetic for comparing angles."
cos
cubed
dimensions
"Tracks units and powers of units -- "
dimensions: aDictionary
displayUnits
incrementDimensionsAt: aUnit by: anIncrement
"Increment / Decrement dimension exponent by given increment (negative when decrementing).
isDimensionless
"Is the current measure dimensionless?"
isPixels
isRadian
negated
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
quantity
"Return the quantity that was observed for this instance."
quantity: aNumber
quantity: aNumber per: denominatorUnits
"Set instance denominator units.
quantity: aNumber units: numeratorUnits
"Set instance numerator units
quantity: aNumber units: numeratorUnits per: denominatorUnits
"Set instance numerator and denominator units.
quantityAsString
"Return the quantity that was observed for this instance."
quantityAsString: q
"Return the quantity that was observed for this instance."
sin
sqrt
standardNameFor: aString
"Fix up names of units to assure consistency."
units
"Render dimensions as a string"
unitsSynonyms
^ self class unitsSynonyms
Hum-RunTime -- HumMessage
nounValues: associations
"TODO: Consider: a HumStatement also has nounValues. Which noun values are which?"
receiver: aString
sender: aString
statement: aHumStatement
whenSent: aTimeStamp
" "
Hum-RunTime -- HumMessenger
getActorInstanceFromID: actorID
"*** Backdoor *** during debug to bypass the messenger"
logInstruction: aHumStatement sentFrom: senderURI to: recipientURI
network
"Return the chosen physical implementation of network service."
nodeIDtoURI
"actorURI contains (actor->URI) maps"
ping: aURI
"MOCK: Return the ID of the given URI"
playbackLog
^playbackLog ifNil: [ playbackLog := Dictionary new].
playbackLogFromActor: aHumActor
"Extract/Get log entries sent to/from a specific actor.
playbackLogFromURI: aURI
"Extract/Get log entries sent to/from a specific actor.
playbackLogToURI: aURI
"Extract/Get log entries sent to/from a specific actor.
registerActor: anActor atURI: aURI
"Track actor."
registerNode: aNode atURI: aURI
"Track actor."
sendAction: anInstructionLine toID: recipientID fromID: senderID
"Transmit action request between actors."
sendAction: anInstruction toURI: recipientURI fromURI: senderURI
"Send the (action) statement to the given actor."
sendInstruction: anInstruction toURI: recipientURI fromURI: senderURI
"Send the (action) statement to the given actor."
uriToNodeID
"What actor ID is associated with URI?"
Hum-RunTime -- HumNetwork
sendAction: anInstruction toURI: recipientURI fromURI: senderURI
"Send the (action) statement to the given actor."
uriToNode
"Return dictionary that maps a URI to an actual actor instance"
Hum-RunTime -- HumNode
asString
^ self id ifNil: [ 'no ID'].
checkIn
clock
^ clock ifNil: [clock := DateAndTime "class singleton"].
clock: anObjectThatImplementsNow
configuration
^ configuration ifNil: [Error signal: 'Node has not been configured.'].
configuration: aHumConfiguration
htmlAgent
"Return http/html agent implementation.
id
^myID
id: aString
log
^ log ifNil: [ log := OrderedCollection new ].
messenger
^self configuration messenger.
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
sendHTML: htmlString
"This is a dummy/mock for testing."
sendHTML: htmlString to: aURL
"This is a dummy/mock for testing. TODO: Make this real."
stepLog
^ stepLog ifNil: [ stepLog := OrderedCollection new.].
stepLogDisplay
"Display the step log"
uri
^myURI.
uri: aURI
Hum-RunTime -- HumNumberParser
nDigits
^nDigits.
Hum-RunTime -- HumScribe
about
"See also: HumRunTimeTests>>testS100ScribeReadMe"
askView: viewFrame withBlackBoard: aBlackBoard
"Current implementation assumes user interface is a HTML browser."
askViewCompleted
"Inform caller that the 'Ask viewName' task
blackboard
"This instance variable should be set by the instance-creation logic. "
client: aClientConection
"synonym"
clientConnection
^ clientConnection ifNil:[ clientConnection := myURI ].
clientConnection: aConnectionOfSomeKind
"How does the Scribe connect to the user/client sensors?"
clientSays: aString
"After a client sensor input is interpreted,
dialogAgent
"Returns the Dialog Agent that was attached to this Scribe when the Scribe was instantiated."
dialogAgent: aHumDialogAgent
dialogAgentURI
"Returns an instance of HumDialogAgent."
dialogAgentURI: aHumDialogAgentURI
handleHttpPostRequest: aHumHttpRequest
"The scribe handles the post request by
htmlStyle
"Return CSS style element."
initialize
"DEBUG Check: Scribe should be initialized with a dialogAgent at creation."
mockDataEntry: userData
"Mock the user entering given data into view.
runAction: anAction inRole: aRole onJob: aHumJobTicket
"Over-ride HumActor to handle Scribe actions."
runInstruction: anInstruction inRole: aRole onJob: aJobID
"Override the HumActor -- (Why?)"
sendToDialogAgent: aClientSpeechString
"Send the string to my Dialog Agent."
sendView: htmlView
"Wrap the view element with HTML header, navigation, epilog, etc."
systemSays: aString
"The Dialog Agent has responded with this String.
zdialogAgent: aHumDialogAgent
Hum-RunTime -- HumSimulator
after: aDuration sendSpeech: aString from: aClientID
"Put this event into my queue."
buildDialogAgentNamed: clientID
"Build a dialog agent configured for our simulation."
clientScribes
^clientScribes ifNil: [ clientScribes := Dictionary new.]
dialogAgents
^ dialogAgents ifNil: [ dialogAgents := Dictionary new ].
dialogSequence: anArrayOfString
"Identify the sequence of dialog responses to be sent during this simulation."
getDialogAgentNamed: aClientID
getScribeForClient: aClientID
"Get the Scribe instance corresponding to the client ID."
initialize
log4Dialog
^ log4Dialog ifNil: [ log4Dialog := OrderedCollection new. ].
logDialogWhen: aDuration who: aClientID why: clientSaid what: systemSaid
now
^ self simulatedClockSecond.
now: aDuration
numberOfDialogs: aSmallInteger
"How many dialogs are to be run simulataneously?"
queue
^ queue
randomStartingIntervals: aDistribution
"Express the distribution as an S-curve in seconds."
simulatedClockSecond
^ simulatedClockSecond ifNil: [simulatedClockSecond := 0 seconds].
step
"Send all events with timing that matches the top event."
stepUntilDone
Hum-RunTime -- HumText
= anotherHumText
"Does this text have same content as the other"
Hum-RunTime -- HumTextLine
copy
indentLevel
"The indent level indicates the level of indentation,
indentLevel: aSmallInteger
size
^ self string size
string
string: aByteString
Hum-RunTime -- HumText
addLine: aString
"Append given line at bottom of text."
copy
insertEmptyLineAfter: lineIndex
lines
"Return the HumText list of HumTextLine instances"
lines: anOrderedCollection
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
string
"Return self as a string. (Lines with CR inserted as needed.)"
Hum-RunTime -- HumVMInstruction
opCodeName
operand
^ operand ifNil: [ Error signal: 'operand not set in HumInstruction'. operand := 000].
operand: objectIndex
operation
^ operation ifNil: [ Error signal: 'op code not set in HumInstruction'. operation := 000].
operation: opCode
slotName
Hum-RunTime -- HumVM
measureRegister
^ measure ifNil: [ measure := HumMeasure new. ].
runInstruction: aHumInstruction
setSlot: slotIndex to: aHumObject
"The slots allow objects to be referenced by byte-code indices."
slots
"slots allow objects to be referenced by byte-code indices."
transferVector
Hum-RunTime -- HumVector
asString
"render my value as a string"
at: index
at: k put: aValue
cross: anotherHumVector
"Return the 3-dimensional vector cross product U x V
dot: aHumVector
length
lengthSquared
pitch: anAngleInRadians
"Transform receiver by a rotation about x (East pointing) axis."
pitch: anAngleInRadians aboutPivot: pivot
"Transform receiver by a rotation about X (side pointing) axis."
quantityAsString
roll: anAngleInRadians
"Transform receiver by a rotation about y (North pointing) axis."
roll: anAngleInRadians aboutPivot: pivot
"Transform receiver by a rotation about Y (forward pointing) axis."
size
"compatibility"
x
^(self at: 1).
x: xValue y: yValue z: zValue
"Hum coordinates are plan-view. x points East. y North. z Up."
y
^self at: 2.
yaw: anAngleInRadians
"Transform receiver by a rotation about z (Up pointing) axis."
yaw: anAngleInRadians aboutPivot: pivot
"Transform receiver by a rotation about Z (Up pointing) axis."
z
^z := self at: 3.
Hum-RunTime -- HumWorldBase
checkTau: aTau
getEntityID: entityID attribute: attributeType
" Get requested value (if any) from the world base instance "
history
^ history ifNil: [ history := Dictionary new. ].
initialize
quads
"For quad internal structure see
setEntityID: entityID attribute: attributeType toValue: aValue
"Put attribute-value (if any) into the world base instance. "
title
^ title ifNil: [ Error signal: 'A world base instance must have a title.'].
title: aWorldBaseName
whereAttribute: attributeType satisfies: aBlockClosure
"Return a set of entity identifiers where the attribute value satisfies the block"
Hum-Seaside -- HumApplication
bookkeeper: aHumBookkeeper
"This application instance will be served by this bookkeeper instance."
dispatcher: aHumResourceManager
"This application instance will be served by this Dispatcher instance."
messenger: aHumMessenger
"This application instance will be served by this messenger instance."
ontology: aHumOntology
"This application a run-time manifestation of that ontology."
worldBase: aHumWorldBase
"This application instance will be served by this world-base instance."
Hum-Seaside -- HumBrowserEditFrame
critic
^ critic ifNil: [ critic := '*** No frame critique yet ***' ].
critic: aTextString
"This is a dummy to accomodate a side-effect of using a TextArea to display the critique.
fetchCodeForTitle: aString
firstLine
frameCode
^ frameCode ifNil: [ frameCode := '*** No frame code yet. ***']
frameCode: aTextString
initialize
lastSaved
^ lastSaved ifNil: [ lastSaved := '*** NOT SAVED YET ***' ].
lastSaved: anObject
layoutFrameAsColumnsOnCanvas: aWAHtmlCanvas
"Generate the column style layout"
layoutFrameAsRowsOnCanvas: aWAHtmlCanvas
"Generate the row style layout."
renderContentOn: html
runCritic
"Run the ontology critic that is appropriate to this type of frame."
setCritique: aTextString
"Set the critique value.
title
^ title ifNil: [ title := 'TBD']
title: aString
trace: aString
Hum-Seaside -- HumBrowserSession
currentFrame
"What frame is currently being editted?"
Hum-Seaside -- HumBrowser
blackboard
^ blackboard ifNil: [blackboard := HumBlackBoard worldbase: 'none'.]
clearOntology
contextDiagram
^ contextDiagram ifNil: [ contextDiagram := HumDiagram new title: 'Context Diagram '].
currentFrame
"What frame is currently being editted?"
dialog
^ dialog ifNil: [ dialog := HumSeasideComponentThingy new. ].
editActionFrame: aTitleString forRole: aRoleString
"Create / View / Edit the frame with the given title."
editDialogFrame: aString
"Create / View / Edit the frame with the given title."
editDictionaryFrame: aString
"Create / View / Edit the frame with the given title."
editPlanFrame: aString
"Create / View / Edit the frame with the given title. (Use goal statement as title.)"
editViewFrame: aString
"Create / View / Edit the frame with the given title."
hideDiagrams
^ hideDiagrams ifNil: [ hideDiagrams = False ].
hideDiagrams: aBoolean
^ hideDiagrams := aBoolean.
initialize
layout
"What style of browser layout (#rows or #columns)?
layout: aSymbol
"What style of browser layout (#rows or #columns)?
layoutDiagramsAsColumnOnCanvas: aWAHtmlhtml
layoutDiagramsAsRowOnCanvas: aWAHtmlCanvas
layoutMenuActionsAsColumnOnCanvas: html
"Identify the actions that the user may invoke via menu navigation."
layoutWindowAsColumns
"*** This is a design document defining layout in Hum markup. ***
layoutWindowAsColumnsOnCanvas: aWAHtmlCanvas
"This layout is visually two columns with editor on left and diagrams on right."
layoutWindowAsRows
"This layout is visually two rows with editor on bottom row and diagrams on top row."
layoutWindowAsRowsOnCanvas: aWAHtmlCanvas
"This layout is visually two Rows with diagrams in top row and editor in lower row."
loadOntologyFile: aFileSpec
loadOntologyInstance: ontologyTitle
log: aString
"Use #logUserAction instead."
logUserAction: aString
"Log the user action for potential analysis / diagnosis."
menuActions
"Identify the actions that the user may invoke via menu navigation."
newOntology
"Start with a fresh new ontology and clear any related views."
nounDiagram
^ nounDiagram ifNil: [ nounDiagram := HumDiagram new title: 'Noun Diagram '].
ontology
^ ontology ifNil: [ ontology := HumOntology new. ].
openOntology
"Clear all views and load an ontology from a save file."
openOntologyDialog
planDiagram
^ planDiagram ifNil: [ planDiagram := HumDiagram new title: 'Plan Diagram '].
printOntology
"Document the current ontology in a HTML document"
programmersAssistant
^ programmersAssistant ifNil: [ programmersAssistant := HumProgrammersAssistant new ].
renderContentOn: html
roleDiagram
^ roleDiagram ifNil: [ roleDiagram := HumDiagram new title: 'Role Diagram '].
saveOntology
"Write the current ontology into a save file."
showSubMenu: aMenu title: aString onCanvas: html
"aMenu is an OrderedCollection of ( name -> action ).
toggleDiagramView
toggleFullScreen
transposeLayout
userActions
^ userActions ifNil: [ userActions := OrderedCollection new.].
Hum-Seaside -- HumSeasideComponentThingy
ask: aSymbol
"Ask, set, and return the requested attrbute."
ask: aString choice: anArrayOfSymbol
"The array of symbols liimits the user's choices"
askFile: aString
"Initiate a file spec dialog."
askV00: aSymbol
"Ask, set, and return the requested attrbute."
attributes
^ attributes ifNil: [ attributes := Dictionary new. ].
logDialogAction: aString
renderView: anEntityID onCanvas: html
"**** Check generated code by pasting it below. ****"
valueOfAttribute: aSymbol
"Return the requested attrbute."
Hum-Tests -- GivenWhenThen4Seaside
assert: aBlock match: aPatternString
"This is a utility function to improve readability."
assert: aBlock matches: aPatternString
"This is a utility function to improve readability."
assertString: stringA includesSubstring: stringB
" stringB should be a substring in stringA "
expect: expectedValue actual: actualValue
given: aDescriptionString code: aBlock
"Given in a given-when-then triplet
givenWhenThenComment
"The #given:code: and #when:code: and #then:code: methods are designed to be cascaded.
log
^ log ifNil: [ log := OrderedCollection new. ].
log: aString
test105GivenWhenThenSuccess
"Test the test utility - In this situation the test assertion is true."
test106GivenWhenThenFail
"Test the test utility - In this situation the test assertion is true."
test110BasicLog
"Test the testcase`s own log"
test120GivenWhenThenLogging
"Test the testcase`s own log"
then: aDescriptionString code: aBlock
"*Then* in a given-when-then triplet
when: aDescriptionString code: whenBlock
"*When* in a given-when-then triplet
Hum-Tests -- GivenWhenThen
assertString: stringA includesSubstring: stringB
" stringB should be a substring in stringA "
given: aDescriptionString code: aBlock
"Given in a given-when-then triplet
givenWhenThenComment
"The #given:code: and #when:code: and #then:code: methods are designed to be cascaded.
log
^ log ifNil: [ log := OrderedCollection new. ].
log: aString
test105GivenWhenThenSuccess
"Test the test utility - In this situation the test assertion is true."
test106GivenWhenThenFail
"Test the test utility - In this situation the test assertion is true."
test110BasicLog
"Test the testcase`s own log"
test120GivenWhenThenLogging
"Test the testcase`s own log"
then: aDescriptionString code: aBlock
"*Then* in a given-when-then triplet
when: aDescriptionString code: whenBlock
"*When* in a given-when-then triplet
Hum-Tests -- Hum000RefactoringTests
givenOntology
humClassResponsiblityCollaboration
^'Collaborative Roles and Responsibilities
strategyForSeaside
^'TBD -- Currently considering subtyping HumWidgets as WAComponents
test110addFrame
"Add frame to ontology"
test121getFrameForGoal
"Get the plan frame that defines a goal."
test122getFrameForAction
"Get frame where action statement is defined."
test123getFrameForView
"Get frame where view is defined."
test131getFramesInvokingPrecondition
"Get the goal frames that invoke a given precondition."
test132getFramesInvokingAction
"Get the frames that invoke a given action."
test133getFramesInvokingView
"Get views frames and vignettes that invoke a view."
test134getFramesDefiningContext
"Get vignettes that define a context."
test135getFramesInvokingContext
"Get vignettes that define a context."
test210prettyPrintOntologyAsHTML
"Refactor so that this function is view OntologyViewer"
test211prettyPrintOntologyAsHTMLonFile
"Pretty print the given ontology on an HTML file."
test220renderCollectionAsHtmlTable
"A plural noun indicates a collection.
test221renderCollectionAsHtmlTableOnFile
"A plural noun indicates a collection.
test230renderEmphasisAsHTML
"Render emphasis in the markup as underscore, italic, bold.
Hum-Tests -- Hum000TestPlanOverview
aReadMe
"See the class description for the intended (future) tests."
givenWhenThenInHTML
"HTML GivenWhenThen frames."
progress
^ '
Hum-Tests -- HumBaseTest
test110putGetValue
"Save entity-attribute-value and fetch."
test120updateGetValue
"Save entity-attribute-value and fetch."
test130putGetEvent
"put get event"
Hum-Tests -- HumByteCodeTests
setUp
"For convenience, create a Hum VM instance for all of the tests to use."
test110EachInstructionHasTwoBytes
"A Hum byte code instruction has two bytes -- one for operation and one for operand."
test120OpCode000IsHalt
"An opCode of 000 is a halt instruction. (operand is ignored)"
test130Operand000IsNone
"An operand index of zero is treated as None.
test210MeasureLoad
"Load measure into measure-arithmetic register."
test220MeasureAdd
"Add measure into measure-arithmetic register."
test230MeasureMinus
"Add measure into measure-arithmetic register."
Hum-Tests -- HumCalculatorTests
test110substringAfter
"Test helper method that finds a substring between two given substrings."
test115substringBefore
"Test helper method that finds a substring between two given substrings."
test120substringBetween
"Test helper method that finds a substring between two given substrings."
test130substringBetweenBrackets
"Test helper method that finds a substring between a pair of brackets or similar pairs."
test210templateFill
test305parse
"Test the simple parser."
test310parse
"calc parse: s - recognizes quoted strings as single tokens."
test311parse
"What if string ends with quoted text?"
test312parse
"Test parse with quote within string."
test313parse
"calc parse: s - recognizes quoted strings as single tokens."
test314parse
"Test parse with quote within string."
test510measurePlusSameUnits
"Measures may be added if same units."
test520measureMinusSameUnits
"Measures may be added if same units."
test540CommonUnits
test542UnitsShouldCancel
test545Conversions
test546ConvertVolumeMeasures
test550CasualMeasures
"Work with non-KMS measures. Develop HumMeasure2"
test552CasualMeasuresAdd
"Work with non-KMS measures. Develop HumMeasure2"
test553CasualMeasuresSubtract
"Work with non-KMS measures. Develop HumMeasure2"
test554AsPercent
"Work with non-KMS measures. Develop HumMeasure2"
test555CasualMeasuresAsString
"Test asString"
test556CasualMeasuresSquares
"Test asString"
test557CasualMeasuresCubics
"Test asString"
test560coefficientOfExpansion
"Sometimes the exponents are all negative."
test570CreateMeasureFromString
"Create a measure from a sting of the form: -999 units"
test580exampleBussardRamJet
test581megaWattToAcceleration
"What kind of acceleration does a megaWatt per tonne give?"
test582exampleBussardRamJet
test582megaWattToAcceleration
"What level of acceleration does a megaWatt give to 100 tonnes of ship mass?"
test590examples
"Class-side examples should not fail"
testV110VectorCrossProduct
"Check the vector cross product"
testV111VectorCrossProduct
"Check the vector cross product"
testV112VectorCrossProduct
"Check the vector cross product"
testV113VectorCrossProduct
"Check the vector cross product"
testV115VectorCrossProduct
"Check the vector cross product"
testV117VectorCrossProduct
"Check the vector cross product"
testV210IdentityVector
"Creat a identity vector I * V = V.
ztest530measureTimesPercent
"Percent times percent produces percent"
Hum-Tests -- HumCodeBaseTests
test110MyPackages
test120MyClasses
test130GetPackageClassTuples
test140GetPackageClassMethodTuples
test146CountTestModules
test147CountLongModules
test148CountLongModules
"Count modules whose listing will exceed one page. "
test150gatherSources
test160LinesOfCode
test161LinesOfCodePerModule
test170FindToDoLines
test171FindCommentLines
test175FindAssertLines
test180listOnHTML
test182listOnHTML2Lines
test183listOnHTMLcomments
Hum-Tests -- HumFuzzyTests
testF100FuzzyArithmeticReadMe
"
testF110CreateFuzzyWithDistribution
"Create a fuzzy quantity from a given distribution."
testF112CheckEdgeCases
"Create a fuzzy quantity from a given distribution."
testF120Interpolation
"Create a fuzzy quantity from a given distribution."
testF125Mean
"Create a fuzzy quantity from a given distribution."
testF130Plus
"Add fuzzy distributions.
testF140Op
"Test op:with:"
testF150MinusOp
"Subtract fuzzy distributions."
testF155Minus
"Subtract fuzzy distributions."
testF160Division
"Divide fuzzy distributions."
testF170Product
"Multiply fuzzy distributions."
testF210PlusOrMinus
"A measure stated as plus-or-minus
testF230Plus
"Add fuzzy distributions."
testF310Mode
"Estimate the mode of a distribution by calculating expected value."
testF410Plot
"Estimate the mode of a distribution by calculating expected value."
testF430PlotPlus
"Add fuzzy distributions.
testF431PlotPlus
"Add fuzzy distributions.
ztestF410LearnToPlot
"Estimate the mode of a distribution by calculating expected value."
Hum-Tests -- HumOntologyTests
test001newOntology
"create a new Ontology"
test100nounTypes
"An entity noun will have attributes."
test102addOneNoun
"Add one noun to current set."
test103addTwoNouns
"Add two nouns to current set."
test104addArrayOfNouns
"Add array of nouns to current set."
test110addEntityAttribute
"Add an entity-attribute relation."
test111getAllAttributesOfNoun
"Add an is-A relation."
test120addSubtype
"Add an is-A relation."
test121automaticSubtype
"Add an is-A relation."
test122getAllSubtypesOfNoun
"Get all subtypes of a noun -- Use at run-time for polymorphism."
test123getImmediateSupertypesOfNoun
"Get immediate super types of a noun -- Use when translating to another language ."
test124getAllSupertypesOfNoun
"Get immediate super types of a noun -- Use when translating to another language ."
test130getSingularFormOfPluralNoun
"Return the singular form of a plural noun."
test220addOneRole
"Add one role to current set."
test230addTwoRoles
"Add two roles to current set."
test310statementTokens
"A statement is made up of tokens."
test320statementEndsWithPeriodOrColon
"A statement must end with a period or a colon."
test330statementHasNouns
"A statement has nouns."
test340statementParsing
"The parser recognizes that tokens are nouns, punctuation, keywords, or just words."
test342statementParsingConsolidatesStrings
"A string is delimited by double quotes."
test350frameLineSeparateLabelStatementCommentAnnotation
"Generic frameline = ( indent ) ( label : ) ( statement '.' ) ( '(' comment ')' ) ( '[' annotation ']' )
test351frameLineParsingRemovesComments
"The parser recognizes that tokens are nouns, punctuation, keywords, or just words."
test353frameLineParsingSeparatesAnnotation
"The parser recognizes that tokens are nouns, punctuation, keywords, or just words."

test420actionInstructions
"An action statement is defined by a sequence of instructions."
test430createInstructionsInline
"Create instructions in-line using Class methods"
test440getRoleActionStatement
"An action belongs to a role."
test441matchActionStatementAgainstCandidate
"Retrieve statement object from ontology when given a similar string."
test442matchActionStatementPolymorphic
"Retrieve appropriate statement with supertype
test450instructionNounAntecedents
"Nouns in instructions should have antecedants in the action statement.
test461Frame4ActionCrossReferences
"Given: An action instruction delegates to another role (or same role).
test510CreatePlanFrame
"Make one plan frame. (TDD to drive basic parts)"
test520CheckPlanFrame
"A plan frame SHOULD have a goal and at least two preconditions.
test530AddPlanFrame
"Make one plan frame. (TDD to drive basic parts)"
test540GetPlanTree
"Make several plan frames. Get the resulting plan tree."
test545DrawPlanTree
"Make several plan frames. Get the resulting plan tree."
test550CheckPlanTree
"Check for an incomplete plan."
test610renderStatementAsHTML
"In the HTML rendering, statement nouns are enclosed in <n>...</n> to enable style sheet rendering."
test611renderInstructionLines
"Create instructions in-line using Class methods"
test620renderFrame4PlanAsHTML
"The frame editor instance knows what kind of frame it is editing.
test625renderPlanTreeAsHTML
"Make several plan frames. Get the resulting plan tree."
test626renderNounTreeAsHTML
"Define a dictionary with more than one level. Render as a noun tree."
test630renderFrame4ActionAsHTML
"Given: The frame editor contains a role-action frame.
test640renderFrame4ViewAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
test641renderRadioButtonAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
test642renderCheckBoxAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
test643renderTextAsHTML
"Given: The frame editor instance knows what kind of frame it is editing.
test650renderFrame4DictionaryAsHTML
"The frame editor instance knows what kind of frame it is editing.
test680renderOntologyAsHTML
"Render an ontology object in HTML and store on given filename."
test690renderOntologyAsHTMLonFile
"Render an ontology object in HTML and store on given filename."
test900checkUsability
"Test the pattern matching.
test910lineMatchesPattern
"Test the pattern matching.
test911lineDoesNotMatchPattern
"Test the pattern matching.
test912lineMatchesFloatingPattern
"Test the pattern matching.
test913lineMatchesFloatingPattern
"Test the pattern matching.
test914lineMatchesFloatingPattern
"Test the pattern matching.
test915lineFailsFloatingPattern
"Test the pattern matching.
test920lineMatchesPatternParameters
"Test the pattern matching.
test922lineMatchesFloatingPatternParameters
"Test the pattern matching.
test923lineMatchesFloatingPatternParameters
"Test the pattern matching.
test930generateCode
"Generate some code that does not require that we find a singular noun.
Hum-Tests -- HumOntologyTranslatorTests
assertExpectedTokensIn: expected matchesTokensIn: actual
"Compare the two strings as a stream of tokens.
bakeThePanInTheOvenForTheTimeGivenInTheRecipeQpan: aPan oven: aOven time: aTime recipe: aRecipe
fulfillOrderQorder: aOrder
"For each order-item in the order: "
test010AssertExpectedTokensInAMatchesTokensInB
"Test the utility with the cases that matter to me."
test110AttachMethodToClass
"Attach a method to a class."
test111GetMethodsForClass
"Attach a method and get it back."

testE230translateInstructionToErlang
"Translate Hum instruction (invoke) to Erlang do()."
testE310translatePlanFramesToErlang
"TODO: Decide how to do this.
testE311translatePreconditionsToErlangList
"Translate a plan-frame`s preconditions to an Erlang list.
testE400ReadMe
testE410translateEntityToErlang
"An entity is translated into an Erlang record structure.
testE500RoleReadMe
"Strategy: Each each role becomes an Erlang module."
testE510RoleModuleHeader
"A role becomes a module. Here we check the module declaration."
testE520RoleModuleHeaderExport
"A role becomes a module. Here we check the module header export declarations."
testE525RoleModuleHeaderMacros
"When a role delegates an action, a ?CALL macro is invoked. "
testE530RoleModuleActionFrames
"A role becomes a module. Here we check the module header export declarations."
testH110tranlateEmphasis
"*text* becomes bold, ~text~ becomes italic, _text_ becomes underline, ^text^ becomes superscript"
testH115tranlateEmphasisAtEnd
"*text* becomes bold, ~text~ becomes italic, _text_ becomes underline, ^text^ becomes superscript"
testH120tranlatePageWidget
"Translate [page:text] into HTML anchor element"
testH125tranlatePageWidgetAtEnd
"Translate [page:text] into HTML anchor element - test for bug when widget is at line end."
testH130tranlateLinkWidget
"Translate [link: text | URL ] into HTML anchor element"
testH140tranlateImageWidget
"Translate [link: text | URL ] into HTML anchor element"
testH210tranlateButtonWidget
"Translate [[label]] into HTML button element"
testH215tranlateButtonWidgetAtLineEnd
"Translate [[label]] into HTML button element -- Test for bug when widget is at end of line."
testH216tranlateButtonWidgetAtLineEnd
"Translate [[label]] into HTML button element -- Test for bug when widget is at end of line."
testH220tranlateCheckBox
"Translate [z] into HTML checkbox element."
testH230tranlateRadioButtons
"Translate (a) into HTML radio-button element."
testH310tranlateTableRow
"Translate | ... | ... | into table elements."
testH320tranlateTableRowWithEmphasis
"Translate | ... | ... | into table elements."
testH330tranlateHeading
"Translate !!! into HTML heading"
testH340tranlateHeadingWithEmphasis
"Translate !!! into HTML heading"
testH350tranlateListItem
"Translate !!! into HTML heading"
testH360tranlateListItemWithEmphasis
"Translate !!! into HTML heading"
testH410tranlateAttributeWidget
"Translate [attribute] into input tag."
testH420tranlateTextAreaWidget
"Translate [attribute 9] into textarea tag."
testH430tranlateEntityAttributeWidget
"Translate [entity`s attribute] into input tag."
testJ805translateStatementToCamelcase
"A statement is translated directly to CamelCase."
testJ806translateStatementToCamelcase
"A statement is translated directly to CamelCase, but articles are dropped."
testJ810translateFrame4ActionToJava
"Given: a Hum action frame.
testJ811translateFrame4ActionToJava
"Given: a Hum action frame with a hyphenated noun.
testJ820translateDictionaryToJava
"Entity becomes class. Attribute becomes String, Category, ..."
testJ825translateCollectionNounToJava
"Test a more complicated dictionary with a collection and recursive structure."
testJ830translateFrame4ActionToJavaExdentToBlockEnd
"Given: a Hum action frame.
testJ840translatePlanFrameToJava
"The plan is data, so translation involves translating each goal frame into a series of Java setters.
Hum-Tests -- HumProgrammersAssistantTests
aReadMe
"See the class description for the intended (future) tests."
storeInOntology: aHumOntology fromFrameUpdater: frameUpdater1
test110newOntology
"PA initializes (re-initializes) to an empty ontology."
test120saveOntology
"PA saves (writes) the ontology to a file."
test130loadOntology
"PA loads (reads) the ontology fram a file where it was saved previously."
test200createFrame
"There are seven types of frame: (See HumFrame hierarchy)
test220createFrame4Plan
"Test a plan frame (goal frame).
test230createFrame4Action
"The frame editor instance knows what kind of frame it is editing.
test231formatFrame4Action
"The frame editor instance knows what kind of frame it is editing.
test240createFrame4View
"The frame editor instance knows what kind of frame it is editing.
test250createFrame4Dictionary
"The frame editor instance knows what kind of frame it is editing.
test260createFrame4Vignette
"Create a dialog vignette..
test261updateFrame4Vignette
"Create a dialog vignette.
test270createFrame4Comment
"Create with a comment frame..
test300codeCriticFeatures
"The code critic generates errors and warnings for each type of frame."
test320critiqueFrame4Plan
"Check plan frame - no known nouns - no plans
test321critiqueFrame4Plan
"Detect: Every precondition has a noun that traces back to the goal statement.
test322critiqueFrame4PlanMissingAntecedant
"Detect: One or more preconditions have a noun with no antecedant in the goal statement.
test330critiqueFrame4Action
"Detect: No known nouns.
test331critiqueFrame4Action
"Detect: Some nouns, but still not enough.
test332critiqueFrame4ActionForAntecedants
"Detect: 'No known noun' and/or 'no antecedant'
test345critiqueFrame4View
"Detect: No nouns in a view frame.
test346critiqueFrame4View
"When the nouns are defined, there are no complaints. s
test350critiqueFrame4Dictionary
"Critique a dictionary frame.
test351critiqueFrame4Dictionary
"Critique a dictionary frame.
test361critiqueFrame4Vignette
"Critique a dialog vignette.
test421compileFrame4Plan
"In this context, 'compile' means that the plan frame is inserted into the ontology,
test431compileFrame4Action
"In this case, 'compile' means adding the frame to the ontology,
test446compileFrame4View
"Compile a view frame.
test450compileFrame4Dictionary
"In this context,
test461compileFrame4Vignette
"Compile a dialog vignette.
test510storeFrame
"Store the frame in the given ontology.
test520fetchFrameByID
"Store a dictionary frame and then get it back using its uniqueIdentifier.
test531fetchFrame4PlanByID
"Create a plan frame in editor; store it; get it back via its ID.
test532fetchFrame4PlanByTitle
"Create a plan frame in editor; store it; get it back via its title.
test540fetchFrame4DictionaryByID
test541fetchFrame4DictionaryByTitle
"Ontology will fetch a dictionary frame given its title."
test551fetchFrame4ActionByTitle
"The title of an action includes the role and the statement."
test561fetchFrame4ViewByTitle
"This should be easy."
test571fetchFrame4VignetteByTitle
"TODO: Think about how vignettes would be identified to users.
test620storeFrame4Plan
"Store plan frame.
test630storeFrame4Action
"Store an action frame.
test640storeFrame4View
"Store a view frame.
test650storeFrame4Dictionary
"Store a dictionary frame.
test660storeFrame4Vignette
"Store a dictionary frame.
test700parseSourceLineReadMe
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test701parseInstructionLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test702parseInstructionLineWithComment
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test703parseInstructionLineWithString
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test704parseInstructionLineWithTwoComments
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test705parseActionLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test706parseActionLineWithComment
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test707parseActionLineWithAnnotation
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test708parseActionLineWithCommentAndAnnotation
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test710getLabel
"Some framelines have labels. Some don't."
test711parseDictionaryLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test712parseDictionaryLineWithComment
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test713parseDictionaryCategoriesLine
"An instruction looks like: <role> : <statement> . (comment) [annotation]"
test720getComment
"Some framelines have comments. Some don't."
test725noComment
"Some framelines have comments. Some don't."
test730getAnnotation
"Some framelines have annotations. Some don't."
test735noAnnotation
"Some framelines have annotations. Some don't."
test741getOneWidget
"Markup-line class includes own parser.
test742getTwoWidgets
"Markup-line includes a parser."
test743getTwoWidgetsAndButton
"Markup-line includes a parser."
test751parseOneWidget
"Parse a markup-line containing a widget."
test752parseMultipleWidgets
"Parse a markup line containing multiple widgets."
test753parseRadioButtons
"Parse a line containing radio button widgets."
test754parseActionButton
"Parse a line containing an action button."
test755parseLinkWidget
"Parse a mark-up line with a link widget."
test760parseEmphasisMarkup
"Parse a mark-up line with emphasis markup."
test770parseHeadingMarkup
"Parse a mark-up line with emphasis markup."
test772parseBulletListMarkup
"Parse a mark-up line with bullet list markup."
test773parseNumberListMarkup
"Parse a mark-up line with emphasis markup."
test800LoadFileReadMe
"The Programmers Assistant may load and parse a text file.
test810FramesAreSeparatedByFrameDelimiter
"Frames are separated by lines beginning with ===.
test811StreamStartsWithFrameDelimiter
"Test where file starts with a frame-delimiter."
test812StreamEndsWithEndOfFile
"Test where frame ends on end-of-file"
test813StreamStartsWithFrameDelimiterEndsWithEOF
"Test where file starts with a frame-delimiter and ends on end-of-file."
test814StreamHasViewAndDictionaryFrames
"Load two frames: a view frame and a dictionary frame."
test815StreamHasViewDictionaryAndPlanFrame
"Load three frames: a view, a dictionary, and a plan frame."
test816StreamHasViewDictionaryPlanAndCommentFrames
"Load four frames: a view, a dictionary, a plan, and a comment frame."

test820StreamHasVignettes
"Test that vignettes are properly parsed, loaded, and indexed."
test830LoadActionFrame
"Load, parse, and render a slightly tricky action frame."
test910LoadFromTextFile
"Load from pizza-ontology.txt"
test912LoadDonutShop
"Load from pizza-ontology.txt"
test913LoadBarista
"Load from pizza-ontology.txt"
test914LoadClubMech
"Load from pizza-ontology.txt"
test920LoadFromTextFileAndRenderAsHTML
"Load from pizza-ontology.txt"
test922LoadDonutShopAndRenderAsHTML
"Load from some-ontology.txt"
test923LoadBaristaAndRenderAsHTML
"Load from some-ontology.txt"
test924LoadClubMechAndRenderAsHTML
"Load from some-ontology.txt"
test925LoadClubMechAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test926LoadDonutShopAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test927LoadBaseOntologyAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test928LoadVROntologyAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test929LoadMarkupViewAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test930LoadToDoListAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test931LoadBootStrapOntologyAndRenderAsHTMLwithCritique
"Load from some-ontology.txt"
test944LoadClubMechSaveReload
"Load from some-ontology.txt, save it, reload it."
test945LoadDonutShopSaveReload
"Load from some-ontology.txt, save it, reload it."
test954LoadClubMechSaveReload
"Load from some-ontology.txt, save it, reload it."
test971CreateNounTreeGraph
"Create a graph of the base ontology noun tree."
testU000UserInitiatedEvents
"Plan for user-initiated events."
testU100KeyBoardEvents
"KeyboardEvents:
testU200NewRelationEvents
"NewRelationEvents:
testU300RenameEvents
"RenameEvents:
text930expected
^'<html>
Hum-Tests -- HumRunTimeTests
aReadMe
"See the class description for the intended (future) tests."
expect: actualValue is: expectedValue
""
expected: expectedValue actual: actualValue
""
setUp
"This setup is used by many run-time tests.
setUpKnockKnockOnOntology: anOntology
tearDown
"Transcript cr; show: 'completed: ', (testSelector asString)."
test000ApplicationConfigurationReadMe
"An application has a run-time configuration."
test005ApplicationConfigurationSetup
"This setup is used by several tests. "
test100ActorReadMe
"
test100ReadMe
"Network is a wrapper on whatever technology is used to communicate between Actors."
test105actorConfiguration
"A Hum Actor is configured with the address of a messenger node.
test110workerChecksIn
"Worker checks-in, announcing roles."
test120workerCheckInMessage
"Worker checks-in, announcing roles."
test130workerChecksInViaMessenger
"Worker checks-in, announcing roles."
test135workerChecksOutViaMessenger
"Worker checks-in, announcing roles."
test200DispatcherReadMe
"The Dispatcher (RM) - assigns tasks to actors.
test210DispatcherAssignsAction
"Some actor delegates a task to a role.
test300CoordinatorReadMe
"Coordinator - controls execution of plans and dialogs.
test310coordinatorRunsPlan
"Dialog:
test320coordinatorInvokesAction
"Goal: Plan has one frame with no preconditions.
test330twoPlanFrames
"Test with two plan frames.
test340planTreeBranches
"Test a plan tree with several levels and significant branching.
test400BookkeeperReadMe
"A Bookkeeper tracks resource utilization.
test410BookkeeperRecordsJobTickets
"If we ask the bookkeeper to 'run' a jobTicket, it stores it in its jobTickets collection.'"
test420BookkeeperSums
"The bookkeeper tracks utilization of an actor by action, actor, role, job.
test600WorldBaseReadMe
"
test610CreateWorldBaseInstance
"Create an instance of a Hum World Base (a database to be shared by multiple actors)."
test615CreateUniqueIdentifier
"Create an instance of a Hum World Base (a database to be shared by multiple actors)."
test616CreateUniqueIdentifierDoesNotBreak
"Create an instance of a Hum World Base (a database to be shared by multiple actors)."
test620setAndGet
"set entity-attribute value"
test630setGetReplace
"set entity-attribute value"
test640FindWhere
"set entity-attribute value"
test700BlackBoardReadMe
"
test710setAndGet
"set entity-attribute value"
test720setGetReplace
"Update entity-attribute value"
test730clearEntity
"Update entity-attribute value"
test800DialogAgentReadMe
"
test810createSimpleVignette
"Create a vignette frame."
test820createDialogAgent
"Create a dialog agent."
test825DialogAgentHasScribe
"When a dialog agent is activated, a Scribe is already present."
test830dialogAgentMatchesInputToVignette
"Pattern 'Hello *.' matches 'Hello.'.
test832dialogAgentMatchesInputToVignette2
"Pattern 'Hello *.' matches 'Hello Ms. Robot.'
test833dialogAgentMatchesInputToVignette3
"Pattern ('Hello *.' 'Hi *.') matches 'Hi there.'.
test834dialogAgentMatchesInputWithAlternatePunctuations
"Pattern ('Hello *.' 'Hi *.' 'Hi *!' 'Hello * ?') matches 'Hi there.'.
test840dialogAgentSorry
"Stimulus 'Help' returns 'Sorry ...'
test850dialogAgentMatchesInputWithAlternatePunctuations
"Pattern ('Hello *.' 'Hi *.') matches 'Hi!'.
test860dialogAgentMatchesInputWithNounSlot
"Pattern ('My name is [full-name].') matches 'My name is Tessie Tester.'.
testM110MessengerRemembersActors
testM120MessageAttributes
"The components of a message include sender, receiver, when sent, statement, and noun-values. "
testS100ScribeReadMe
"These Scribe tests generally involve a Scribe that is independent of Seaside.
testS110SetupScribe
"A scribe is attached to a dialogAgent Agent.
testS131ScribeHandlesHttpPostRequest
"Scribe: Captures data from Http Response and returns data to Dialog Agent in task-completion message. "
testS132ScribeHandlesViewReturn
"Scribe: Captures data from Http Response and returns data to Dialog Agent in task-completion message. "
testS134ScribeMocksViewDataEntry
"Scribe: Captures data from Http Response and returns data to Dialog Agent in task-completion message. "
testV100ReadMe
"Test HumVector - which is a subclass of FloatArray"
testV105GetPutXYZ
"Test HumVector - which is a subclass of HumMeasure"
testV110TestVplusV
"Test HumVector - which is a subclass of . . ."
testV120TestVminusV
"Test HumVector - which is a subclass of . . ."
testV130TestVdotV
"Test HumVector - which is a subclass of . . ."
testV140TestVcrossV
"Test HumVector - which is a subclass of . . ."
testV150TestVtimesScalar
"Test HumVector - which is a subclass of . . ."
testV160TestVdividedByScalar
"Test HumVector - which is a subclass of . . ."
Hum-Tests -- HumSeasideProgrammersAssistantTests
aReadMe
"
test110newOntology
"Browser initializes (re-initializes) to an empty ontology."
test121loadOntologyInstance
"Browser saves (writes) the ontology to a file."
test130saveOntology
"Browser saves (writes) the ontology to a file."
test222OpenOntologyInstance
"Test the dialog that asks the user for the file name."
Hum-Tests -- HumSeasideUserInterfaceTests
checkGeneratedCode
"This is a place to see if generated code will compile."
setUpViewFrameInOntology: aHumOntology
"Generate a view frame and dictionary entries for several tests.
test310ViewBecomesForm
"A Hum view frame is rendered as a Seaside Form.
test311ViewHasMultipleLines
"A Hum view frame is rendered as a Seaside Form.
test312ViewHeader
"A Hum view frame is rendered as a Seaside Form.
test313ViewField
"A Hum view frame is rendered as a Seaside Form.
test314CheckGeneratedCode
"This is a place to see if generated code will compile and run."
Hum-Tests -- HumSeasideWidgetTests
setUpViewFrameInOntology: aHumOntology
"Generate a view frame and dictionary entries for several tests.
test010GivenWhenThen
"Test the test frame"
test011GivenWhenThenFail
"Dry test the test frame"
test100BasicWiring
"A Hum view frame is rendered as a Seaside Form."
test102BasicWiring2
"A Hum view frame is rendered as a Seaside Form."
test105BindWidgetToBlackboard
"A widget may be bound to blackboard"
test107BindWidgetToCategory
"A widget may be bound to blackboard"
test110ViewHasViewTag
"A Hum view frame is rendered as a Seaside Form. "
test120ViewHasFormTag
"A Hum view frame is rendered as a Seaside Form. "
test130ViewHasMarkupLines
"A Hum view frame is rendered as a Seaside Form ...
test132ViewHasHeadingLine
"A Hum view frame is rendered as a Seaside Form ...
test134ViewHasStringWidget
"A Hum view frame is rendered as a Seaside Form ...
test135ViewUptoWidget
"A Hum view frame is rendered as a Seaside Form ...
test136ViewHasTextWidget
"A Hum view frame is rendered as a Seaside Form ...
test138ViewHasDateWidget
"A Hum view frame is rendered as a Seaside Form ...
test139ViewHasCategoryWidget
"A Hum view frame is rendered as a Seaside Form ...
test140ViewHasMeasureWidget
"A Hum view frame is rendered as a Seaside Form ...
test150ViewLineHasSeveralWidgets
"A Hum view frame is rendered as a Seaside Form ...
Hum-Tests -- HumSimulatorTests
aDesignNoteEventQueue
"The Simulator provides the means for 'regression testing'.
setUpBasicConfigurationOn: aHumSimulator
setUpDogAndPonyConfigurationOn: aHumSimulator
setUpDogAndPonyOntology
"When this ontology runs,
setUpHotelOntology
setUpKnockKnockOnOntology: anOntology
testX100SimulatorReadMe
"The Simulator provides the means for 'regression testing'.
testX101RepresentDialogSequence
"Simulations 'load' the system under test by starting dialog sequences
testX102RepresentRandomIntervals
"Simulations 'load' the system under test by starting dialog sequences
testX103RepresentNumberOfDialogs
"Simulations 'load' the system under test by starting dialog sequences
testX110AddEventToQueue
"A simulation loads client speech-acts into a queue with a specified delay.
testX112AddTwoEventsToQueue
"A simulation loads client speech-acts into a queue with a specified delay.
testX120Step
"A simulation loads client speech-acts into a queue with a specified delay.
testX122StepStep
"A simulation loads client speech-acts into a queue with a specified delay.
testX124StepUntilDone
"A simulation loads client speech-acts into a queue with a specified delay.
testX130DialogUsesScribe
"There should be a Scribe in the chain.
testX140VignetteTriggersGoal
"A vignette may trigger a goal."
testX142RunClubMech
"A vignette may trigger a goal."
testX143RunBarista
"A vignette may trigger a goal."
testX144RunDonutShop
"A vignette may trigger a goal."
testX150RunParallel
"A vignette may trigger a goal."
Hum-Tests -- HumTestCase
assert: stringA sameAs: stringB
assertPattern: stringPattern matches: string
ensure
"I think this belongs under HClientServerTests"
ensureBlock: aBlock
"I think this belongs under HClientServerTests"
eventSeen
^ eventSeen ifNil: [ eventSeen := 'No value was preset.' ]
eventSeen: anObject
"Set my one-shot memory of the last event seen."
expect: expectedValue actual: actualValue
expect: expectedValue actual: actualValue description: aDescription
pattern: stringPattern matches: string
signal
"I think method this belongs under HClientServerTests"
update: anObject
"This is called by event handler."
Hum-Tests -- HumTextEditorTests
test110ArrowKeys
test120NormalKeys
test130BreakLine
test140DeleteKey
"If cursor column > 1, delete character to the left of cursor and decrement column position."
test150DeleteLine
"If cursor column = 1, append current line to prior line and move remaining lines up."
test208CharacterizeStringDraw
"Tinker until we learn what we need to know about canvas, form, font integration."
test209CharacterizeStringDraw
"Tinker until we learn what we need to know about canvas, form, font integration."
test226DrawSeveralTextLinesOnPane
"TextEditor draws its lines on a HumPane -- ???"
Hum-Tests -- HumUserInterfaceTests
aReadMe
"See the class description for the intended (future) tests."
aReadMe2
"
aReadMe3
^'
aReadMe4
^'Test Driven Design (Decide if the following cascade makes sense.)
assert: x equals: a or: b
buildAvatar
"Create example to indicate development idea/s."
buildTrailerAssembly
"Build trailer - to be used in other tests."
buildTrailerNoseCurve
"Return curve of #(x y) where x = 0 is front-most point, y is offset from centerline"
buildTrailerScene
"Build trailer scene - to be used in other tests."
checkViewPortMorph
^ checkViewPortMorph ifNil: [ checkViewPortMorph := false ].
checkViewPortMorph: aBoolean
expect: actualValue is: expectedValue
"syntax sugar"
for: someExpression expect: someResult
lastChange
^ lastChange
showViewPort: aHumViewPort
test110surfaceHasOrigin
"A surface is initialized with a origin object which is zerosized and at 0,0."
test120surfaceSizeIsDurable
"A surface is initialized with a origin object which is zero-sized and at 0,0."
test130surfaceLayers
"An Surface Assembly has multiple shapes in one or more layers ."
test135surfaceBoundingBox
"An pane has a bounding box determined by the min/max of its collection of shapes."
test140surfaceLayout
"A surface is initialized with a origin shape which is zero-sized and at 0,0."
test150surfaceLayoutForPA
"Test for API usability -- Consider a layout like the PA."
test210boxHasOrigin
"A box is initialized with a origin object which is zero-sized and at 0,0."
test210surfaceAsSVG
"Test for usability -- Consider a layout like the PA."
test220boxSizeIsDurable
"When we move an edge, the width, height, and length are not affected."
test220surfaceAsSvgViewBox
"Test for usability -- Consider a layout like the PA."
test230boxIsAContainer
"HumAssembly (subtype of HumBox) may contain other boxes/spaces. "
test240boxLayout
"We can position boxes using absolute position values and relative positions."
test250boxCentering
"Center one box on top of another."
test255surfaceAssemblyAsSVG
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
test260surfaceAssemblyAsSvgPercent
"Test for usability -- Consider a layout like the PA."
test270surfaceAssemblyAsSvgInch
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
test310spaceHasOrigin
"A space is initialized with a origin object which is zero-sized and at 0,0."
test310surfaceAsXML
"First principle: Express a hum surface as XML.
test320spaceSizeIsDurable
"When an edge is moved, the opposite edge is also moved."
test320surfaceAssemblyAsXML
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
test330spaceContainer
"We can specify a box position in terms of its centroid."
test340spaceLayout
"HumAssembly may position its parts relative to itself and each other."
test350assemblyDimensions
"A HumAssembly dimensions enclose whatever is inside the assembly"
test410surfaceAsHTML
"Test for usability -- Consider a layout like the PA."
test470surfaceAssemblyAsHTML
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
test510surfaceAsHumScript
"Test first principle: Produce a Hum action call.
test570surfaceAssemblyAsHumScript
"Test for usability -- Consider a layout like the PA -- This time use inches as the unit of measure."
testA110addPart
"Add a part to an assembly. Check content and event handling"
testA210assembleAvatar
"Create example to indicate development idea/s."
testA220colorAvatar
"Create example to indicate development idea/s."
testA410x3dAssembly
"render the objects in HumAssembly"
testA420trailerExample
"Test DSL usability - No code is generated by this test."
testA425trailerExample2
"Test DSL usability -- change #depth to #length -- No code is generated."
testA430showTrailerLayoutTable
"Display a table of the trailer parts edges.
testA530assemblyAsThreeJS
"Render a box as a ThreeJS cube"
testA540sceneAsThreeJS
"Render a box as a ThreeJS cube"
testA550sceneAsThreeJSinHTML
"Render a box as a ThreeJS cube"
testA600VPythonReadMe
"I started this when my VPython environment started working again.
testA625VPythonTrailer
testC210CreateHumCanvas
"HumCanvas provides a wrapper on actual implementation."
testC211CreateHumCanvas
"HumCanvas provides a wrapper on actual implementation."
testC220DrawRawPolygon
"HumCanvas provides a wrapper on actual implementation."
testC222DrawHumPolygon
"HumCanvas provides a wrapper on actual implementation."
testD110CreateDiagram
"Create a diagram with three nodes and two connections."
testD210LayoutDiagram
"Create a diagram with three nodes and two connections."
testD220LayoutDiagram
"Create a diagram with four nodes and three connections."
testD230LayoutDiagram
"Create a diagram with five nodes and four connections."
testD310DistanceBetweenNodes
"Calculate the (layout) distance between two nodes."
testD321EnergyBetweenNodes
"Calculate the (layout) force between two nodes."
testE110EditorPosition
"The editor owns a (cursor) position."
testE120EditorInsertCharacterAtEndOfLine
"When we insert a character, the cursor advances and the character is in the text string."
testE121EditorInsertCharacterAtFrontOfLine
"When we insert a character, the cursor advances and the character is in the text string."
testE130EditorInsertLine
"When we insert a line, the cursor advances to the beginning of the new line."
testE131EditorInsertTwoLines
"When we insert a line, the cursor advances to the beginning of the new line."
testE140EditorDeleteCharacterAtEndOfLine
"When we delete a character, the cursor decrements
testE141EditorDeleteCharacterAtStartOfLine
"When we delete a character, the cursor decrements
testE142EditorIgnoresDeleteWhenCursorAtStartOfLine
"When we delete a character, the cursor decrements
testE143EditorDeleteCharactersWillNotBackOverBeginningOfLine
"When we delete a character, the cursor decrements
testE210InterpretArrowKeys
"The arrow keys move the cursor and forget the selection.
testE220InterpretAltArrowKeys
"The arrow keys move the cursor and forget the selection.
testE230InterpretShiftArrowKeys
"The shift arrow keys move the cursor and update the selection.
testE310EditorSupportsUnDo
"Editor supports multiple levels of undo."
testE315EditorSupportsUnDoAtBottom
"Editor supports multiple levels of undo - tolerates too many pops."
testE320EditorSupportsReDo
"Editor supports multiple levels of undo and redo."
testE325EditorSupportsReDoToBottom
"Editor supports multiple levels of undo and redo."
testS110boxFacesAsPolygons
testS120boxVolumeMassWeight
testS200x3dReadMe
" TODO: X3D is my preferred target language for 3D visualization.
testS210x3dColor
"HumSolid x3dColor should produce a X3D color string"
testS220x3dExtent
"Produce a x3d box extent from my length width height"
testS230x3dCenter
"Produce a x3d box position from my length width height (and default position)"
testS310x3dMaterial
"HumSolid x3dMaterial should produce a X3D xml string"
testS320x3dShape
"Produce a x3d box extent from my length width height"
testS330changed
"#changed is propagated to parent, dependents."
testS500ThreeJSReadMe
"The advantage of ThreeJS is that it runs WebGL in a relatively straight-forward manner.
testS505ThreeJSColor
"HumSolid three.js needs HTML color string"
testS520ThreeJSBox
"Produce a Three.js cube with my length width height and position"
testS610VPythonThing
"Produce a VPython Thing.py box with my length width height and position"
testS615VPythonSpace
"Produce a VPython Thing.py box with my length width height and position, but not visible"
testS620VPythonPreamble
"Produce a general purpose VPython scene preamble "
testT110initialTextHasOneEmptyLine
"When it is initialized, there is one empty line.
testT115initialTextCopyHasOneEmptyLine
"When it is initialized, there is one empty line.
testT210TurtleCreation
"Create a new turtle and check initial state."
testT220TurtleHeading
"Test methods that change the heading."
testT230TurtleStepping
"Test methods that change the heading."
testT240TurtleSpeeding
"Test methods that change the heading."
testV100ReadMe
"The current viewport uses low-level graphics functions rather than Morph.
testV105CreateCamera
"The camera is modeled by a pin-hole box camera."
testV110PositionCameraFacingBillboard
"The default/initial viewport frustrum is laid directly onto the surface.
testV115PanCameraUpDownLeftRight
"Move the camera in the scene to effect pan motion."
testV116CameraRotateSlideForward
"Move the camera in the scene to effect pan motion."
testV117CameraRotateSlideSideways
"Move the camera in the scene to effect pan motion."
testV118CameraRotateSlideUpDown
"Move the camera in the scene to effect pan motion."
testV120MapPointsFromSceneToViewport
"In an orthographic projection,
testV200ReadMe
"This group characterizes the low level drawing infrastructure
testV300checkViewPortMorph
"This group characterizes the low level drawing infrastructure
testV310ConnectViewPortToHumCanvas
"HumCanvas provides a wrapper on actual implementation."
testV320DrawPolygonOnBillboard
"Draw a 2D polygon on the viewport canvas."
testV330DrawABox
"Draw a 3D box on the viewport - use perspective projection."
testV331PaintABox
"Draw a 3D box on the viewport - use perspective projection."
testV332PaintAPyramid
"Draw a 3D box on the viewport - use perspective projection."
testV333PaintARotation
"Draw a 3D box on the viewport - use perspective projection."
testV334PaintACylinder
"Draw a 3D box on the viewport - use perspective projection."
testV334PaintAnElipsoid
"Draw a 3D box on the viewport - use perspective projection."
testV335PaintAThing
"Draw a 3D thing on the viewport - use perspective projection."
testV335PaintATorus
"Draw a 3D thing on the viewport - use perspective projection."
testV335PaintExtrusion
"Draw a 3D thing on the viewport - use perspective projection."
testV336DrawAThing
"Draw a 3D thing on the viewport - use perspective projection."
testV336WireframeATorus
"Draw a 3D thing on the viewport - use perspective projection."
testV337DrawAThingWireFrame
"Draw a 3D box on the viewport - use perspective projection."
testV338DrawABoxAsTriangles
"Draw a 3D box on the viewport - use perspective projection."
testV345DrawASolidRotated
"Draw a 3D box on the viewport - use perspective projection."
testV346DrawASolidTilted
"Draw a 3D box on the viewport - use perspective projection."
testV347DrawASolidRotatedAndTilted
"Draw a 3D box on the viewport - use perspective projection."
testV350paintAvatar
testW100ReadMe
"Hum Widgets are wrappers on various presentation layer technologies.
testW110LayoutContainsOtherWidgets
"A layout widget contains one or more other widgets."
testW120RowLayout
"A row layout arranges child widgets in a row."
testW130ColumnLayout
"A column layout arranges child widgets in a column."
testW220RowLayoutHTML
"A row layout arranges child widgets in a row."
testW230ColumnLayoutHTML
"A row layout arranges child widgets in a row."
testW320RowLayoutAsMorph
"A row layout arranges child widgets in a row."
testW330ColumnLayoutAsMorph
"A row layout arranges child widgets in a row."
update: someObject
"Record fact that someObject was updated by a test.
Hum-Tests -- HumVRTests
test100CreateVRwith2scenes
"A virtual reality has one or more scenes."
Hum-UI -- HumAssembly
addPart: aHumBox
"Add the component to my parts list"
addParts: aCollection
"Add the component to my parts list"
advance: aBox by: anArray
"Move the box by the given increments.
asPolygons
"Return polygons for my parts."
asPolygonsColorCoded
"Return polygons for my parts."
asThreeJS
"render the parts contained in this assembly"
asVPython
"Render my parts via Visual Python Things"
asX3D
"Return a string representing this assembly as a X3D element and scene.
bbBottomEdge
"Find my bounding box edge."
bbDepth
"Depth is another name for length."
bbEastEdge
"Find my bounding box edge."
bbHeight
"height of my bounding box"
bbLength
"length of my bounding box"
bbNorthEdge
"Find my bounding box edge."
bbSouthEdge
"Find my bounding box edge."
bbTopEdge
"Find my bounding box edge."
bbWestEdge
"Find my bounding box edge."
bbWidth
"width of my bounding box"
center: aHumBox above: aHumBox2
"synonym"
center: aBox at: a3Vector
"Center the part (aBox) at the given coordinates. { east. north. up. }
center: boxB below: boxA
"Center boxB over boxA"
center: boxB eastOf: boxA
"Center boxB over boxA"
center: boxB northOf: boxA
"Center boxB over boxA"
center: boxB onTopOf: boxA
"Center boxB over boxA"
center: aHumBox over: aHumBox2
"synonym"
center: boxB southOf: boxA
"Center boxB over boxA"
center: boxB westOf: boxA
"Center boxB over boxA"
changed
exploded
"Explode assemblies so that all the parts of parts become visible."
parts
^ parts ifNil: [ parts := Set new ].
position: boxA above: boxB
"synonym"
position: boxA below: boxB
"synonym"
position: boxA eastOf: boxB
"Position A on East edge of B."
position: boxA northOf: boxB
"Position A on North edge of B."
position: boxA onBottomOf: boxB
"Position A on bottom of B."
position: boxA onTopOf: boxB
"Position A on top of B."
position: boxA over: boxB
"synonym"
position: boxA southOf: boxB
"Position A on South edge of B."
position: boxA under: boxB
"synonym"
position: boxA westOf: boxB
"Position A on West edge of B."
update: anObject
"TBD"
update: anAspect with: anObject
"TBD"
x3DOM
"TODO: Generate HTML to enable X3DOM viewing in Browser."
x3dBackground
"Provide (default) X3D background element (skybox)"
x3dBoilerPlate
"Provide boilerplate attributes for X3D element"
x3dObjects
"Render each of the objects in my collection"
x3dScene
"Return a string representing this assembly as a X3D scene.
zcenter: aBox at: anArray
"Center the part (aBox) at the given coordinates. { east. north. up. }
zcenter: boxB onTopOf: boxA
"Center boxB over boxA"
Hum-UI -- HumBox
aboutEdges
^'WARNING: The set/get methods for edges assume a default orientation.'.
addPolygon: aHumPolygon
asCamelCase
"Return identifier as a camelcase string."
asMeasure: aQuantity
"Convert string/number/measure to a measure. (default unit is meter)"
asThreeJS
"Render this as a box in Three.js"
asX3D
"Return a string in X3D notation representing this box / thing.
bottomEdge
^ bottomEdge
bottomEdge: aQuantity
"WARNING: Assumes the box has default orientation."
center
"Center of box (and/or center of bounding box) -- { x y z } = { east north up }"
centerAt: a3Vector
"Center myself at the given coordinates. { east. north. up. }
centerX
"X axis points East"
centerY
"Y dimension points North"
centerZ
"Z dimension points up."
changed
"Notify my rendering engine that I am changed."
depth
"synonym"
depth: aHumMeasure
"synonym"
eastEdge
^ eastEdge
eastEdge: aQuantity
equationOfMotion
"The equation-of-motion should be a block with args: box and time"
equationOfMotion: fcSelfAndTime
"The equation-of-motion should be a block with args: box and time"
exploded
^{ self }.
height
"Get the height. By convention, height runs up and down."
height: aQuantity
"Reset the up-down dimension."
id
"Identifier used in rendering context"
id: aString
"Identifier used in rendering contexts"
id: aString height: aHeight width: aWidth depth: aDepth
"synonym"
id: aString height: aHeight width: aWidth length: aLength
initialize
"Set dimensions to zero."
jump: aTime
length
"Get the length. By convention, length runs North and South."
length: aQuantity
"set North-South dimension"
mm: aMeasure
"Format this measure to 3 digits accuracy - i.e. millimeter accuracy"
mmShave: aMeasure
"Format this measure to 3 digits accuracy - i.e. millimeter accuracy.
nextColor
"Select from a sequence of colors. Enables reproducable result."
northEdge
^ northEdge
northEdge: aQuantity
origin
"Origin is always a zero-sized object at (0 0 0)."
polygons
"TODO: DANGER -- asPolygons is not defined in this supertype."
polygons: aCollection
"Computed polygons *may* be stored here."
printOn: aStream
"Append to the argument, aStream, a sequence of characters that
rSquared
"How far am I from the origin? Use R-squared of my centroid as metric."
resetColoring
rotateLeft: angleInDegrees
"Set rotation (yaw) in scene coordinates - Note: This is not additive."
rotatePolygons: inputPolygons
"Correct the polygons for my rotation (yaw)."
rotateRight: angleInDegrees
"Set rotation (yaw) in scene coordinates - Note: This is not additive."
rotation
"Get my rotation (yaw) in scene coordinates as a value expressed in radians "
rotation: angle
"Set my rotation (yaw) in scene coordinates as a value expressed in radians "
rotationDegrees: angle
"Set my rotation (yaw) angle in scene coordinates. "
slideBackward: aHumMeasure
"Slide in the South direction - TODO: adjust for camera rotation."
slideDown: aHumMeasure
"Move box (e.g. camera) up or down in the scene coordinates."
slideForward: aHumMeasure
"Slide in the North direction - TODO: adjust for camera rotation."
slideLeft: aHumMeasure
^self slideRight: (aHumMeasure negated).
slideRight: aHumMeasure
"Move camera left or right --- TODO: Correct this for camera orientation."
slideUp: aHumMeasure
^self slideDown: (aHumMeasure negated).
solidColor: aColor
"What color should be used to render box or bounding-box in a view?"
southEdge
^ southEdge
southEdge: aQuantity
tilt
"Get my tilt (pitch) in scene coordinates as a value expressed in radians.
tilt: tiltInRadians
"Set my tilt (pitch) in scene coordinates as a value expressed in radians.
tiltDegrees: angleInDegrees
"Set my tilt (pitch) angle in scene coordinates. "
tiltDown: angleInDegrees
"Set tilt (pitch) in scene coordinates - Note: This is not additive."
tiltPolygons: inputPolygons
"Correct the polygons for my tilt (pitch)."
tiltUp: angleInDegrees
"Set tilt (pitch) in scene coordinates - Note: This is not additive."
topEdge
^ topEdge
topEdge: aQuantity
velocity: aHumVector
"What is the 3D object`s current velocity?"
volume
"Calculate the volume"
westEdge
^ westEdge
westEdge: aQuantity
width
"Get the width. By convention, the width runs East and West."
width: aQuantity
"Reset the East-West dimension"
x3dCenter
"Center of box (and/or center of bounding box) -- { x y z }
x3dExtent
"Return x y z extents as a string
xyzString
zslideRight: aHumMeasure
"Move camera left or right --- TODO: Correct this for camera orientation."
Hum-UI -- HumCamera
eyeX
"Eye in scene coordinates.
eyeY
"Eye in scene coordinates."
eyeZ
"Eye in scene coordinates."
isPointInFieldOfView: a3Dpoint
"Is the given 3D point within my field of view.
slideBackward: aDistance
slideForward: aDistance
"Move in the direction the camera is pointing."
slideLeft: aDistance
^self slideRight: (aDistance negated).
slideRight: aDistance
"Move in the direction the camera is pointing."
slideUpward: aDistance
"Move in the direction the camera is pointing."
unitForward
"Return unit vector pointing along my internal y axis due to my rotation and tilt."
unitSideways
"Return unit vector pointing along my internal x axis due to my rotation and tilt."
unitUpDown
"Return unit vector pointing along my internal x axis due to my rotation and tilt."
Hum-UI -- HumCanvas
about
"
asMorph
borderWidth: aWidth borderColor: aColor
brushColor
"Get my brush color."
brushColor: aColor
"Set my brush color."
brushPosition
"Get my latest brush position."
brushPosition: aPoint
"Remember my latest brush position."
drawHumPolygon: aHumPolygon
"The HumPolygon contains 3D points and specifies fill and border colors.
drawPolygon: aHumPolygon scale: pxPerMeter
drawTextLines: textLines withFont: aFont
extent
"What is my height and width?"
fillBackground
formCanvas
"What form should I draw on."
formCanvas: aFormCanvas
"What form should I draw on."
height
"What is my height?"
moveBrushTo: aCanvasPoint
"Position the brush, but do not paint yet."
paintTo: aCanvasPoint
projectScenePoint: aScenePoint cameraDepth: aCameraDepth
"Translate from scene coordinates (meters) to canvas coordinates (px)"
scalePixelsPerMillimeter
"How many pixels per millimeter of camera viewbox?"
scalePixelsPerMillimeter: aNumber
"How many pixels per millimeter of viewbox?"
scalePoint: aScenePoint scaleRatio: pxPerMeter
"Return a x@y point by scaling the given scene point"
skyColor
"What color to use for background fill?"
skyColor: aColor
"What color to use for background fill?"
width
"What is my width?"
Hum-UI -- HumCategoryWidget
categories
^categories ifNil: [Error signal: 'categories have not been initialized']
categories: anArrayOfCategoryNames
renderContentOn: aWAHtmlCanvas
"render self via a simple input tag"
Hum-UI -- HumColumnLayoutWidget
asHTML
"Generate a div containing child widget renderings."
asMorph
Hum-UI -- HumDateWidget
renderContentOn: aWAHtmlCanvas
"render self via a simple input tag"
Hum-UI -- HumDiagram
addConnection: anAssociation
"anAssociation := ( fromNode -> toNode )"
addConnection: anAssociation label: aString
"anAssociation := ( fromNode -> toNode )"
addNode: anObject
"A node object should have a title.
asSVGonHtml: html width: aWidth height: aHeight
"TODO: REFACTOR to render as HTML string."
asSVGonHtmlCanvas: html width: aWidth height: aHeight
"Render this diagram on the given Seaside canvas.
asSVGonSeasideCanvas: html width: aWidth height: aHeight
"Render this diagram on the given Seaside canvas.
connections
"Model connections as a set of associations."
countNeighborsOfNode: aNode
"Return the number of neighbors of this node.
getNodesDownstreamFromNode: thisNode
"Return nodes that are connected downstream from this node."
getNodesUpstreamFromNode: thisNode
"Return nodes that are connected upstream from this node."
getPositionForNode: aNodeObject
^ self mapNodePosition at: aNodeObject ifAbsent: [ ^nil ].
graph
^graph ifNil: [ graph := HumGraph new. ].
initialize
"Set up the graph instance that backs this diagram."
layoutDiagramWithNodeExtent: extentPoint nodeSpacing: spacingPoint
"Layout the diagram using the given node extent and spacing between node edges."
layoutDistanceFromNode: nodeA toNode: nodeB
"Calculate the length of the connection between the nodes."
layoutEnergyOnNode: nodeA fromNode: nodeB
"Calculate a energy scalar.
layoutNode: aNode from: aPosition by: anIncrement
"Find a place for the given node starting from the given position.
layoutRecursiveWithNode: node relativePosition: relativePosition seenBefore: priorNodes
"Assign initial position to this node, and then, using recursion, to its neighbors.
mapNodePosition
^ mapNodePosition ifNil: [ mapNodePosition := Dictionary new. ].
mapPositionNode
" What node is at a position"
nodeExtent: aPoint
nodeSpacing: aPoint
nodes
"Model nodes as a set of objects."
setNode: aNodeObject position: aPosition
"Node should also be in nodes collection for internal consistency."
title
^ title ifNil: [ title := '** Diagram has no title! **'].
title: aString
Hum-UI -- HumEditor
addLine: aString
"Delegate to HumText instance."
beep
"If sound is enabled, beep."
characterIndex
"Character index is equal to the number of charactes to the left of the cursor."
characterIndex: aSmallInteger
"character index ranges from 0 (left of line) to ()"
currentLine
deletePriorCharacter
"Insert a character into the text at the current (cursor) position"
emptySelection
"The selection is empty.
initialize
"Set up undo stack and notification."
insertCharacter: aCharacter
"Insert a character into the text at the current (cursor) position"
insertLine
"Delegate to our HumText instance"
interpretKey: aSymbol
"Interpret various keyboard gestures."
lineIndex
^ lineIndex ifNil: [ lineIndex := 1 ].
lineIndex: aSmallInteger
lines
^ self text lines.
redo
"Replace text with text that was replaced at last undo."
redoStack
^ redoStack ifNil: [ redoStack := OrderedCollection new ].
selectedText
"Return selected text as a string with CR inserted as needed at ends of lines."
selectionAnchor
"Return selection anchor."
text
^ text ifNil: [ text := HumText new ].
undo
"Replace text with last item from undo stack."
undoStack
update: aText
"When text is updated, we are informed. Put on undo stack."
updateSelection
"Selection extends from an anchor-point to current cursor position.
Hum-UI -- HumElipsoid
asPolygons
^ self asPolygonsColoredBy: [ self solidColor ].
asPolygonsColorCoded
^ self asPolygonsColoredBy: [ self nextColor ].
asPolygonsColoredBy: aBlockRule
"Produce polygons from the xyList points and the rotation nWedges."
asVPython
Hum-UI -- HumExtrusion
asPolygonsColoredBy: aColorRule
"Translate the moldLoop`s points
asVPython
centerX
"centerX = average value of x from polygon vertices"
centerY
"centerY = average value of Y values from polygon vertices"
centerZ
"centerZ = average value of Z values from polygon vertices"
changed
"Force recalculation of geometry when next asked."
extrusionPath
"The moldLoop origin is translated along this path to outline the extrusion."
extrusionPath: a3Dpath
"The moldLoop origin is translated along this path to outline the extrusion."
moldLoop
"This loop defines the edges of the extrusion. See also: #extrusionPath:"
moldLoop: a3Dpath
"This loop defines the edges of the extrusion. See also: #extrusionPath:"
volume
Hum-UI -- HumFormWidget
renderContentOn: aWAHtmlCanvas
renderOn: aWAHtmlCanvas
view
"Return my view"
view: aHumView
Hum-UI -- HumLayoutWidget
addWidget: aHumWidget
reorder: aSortBlock
"Re-order the widgets according to the given sort criteria."
widgets
^ widgets ifNil: [ widgets := OrderedCollection new. ]
Hum-UI -- HumMeasureWidget
renderContentOn: aWAHtmlCanvas
"render self via a simple input tag"
Hum-UI -- HumPane
drawTextLines: textLines onCanvas: aCanvas font: aFont
textChanged: aHumTextEditor
"Text to be displayed in this pane has changed."
Hum-UI -- HumPolygon
<= aHumPolygon
"Z-ordering: Is my north-most point more northerly than the other."
> aHumPolygon
"Is my north-most point more northerly than the other."
addVertex: aScenePoint
"The convention is to list vertices in a counter-clockwise direction as seen from the 'outside' of a solid."
asTriangles
borderColor
^ borderColor ifNil: [ borderColor := Color blue ].
borderColor: aColor
bottom
"If points are 2D, Return min y or zero."
centroid
"Compute the centroid of the vertices."
color: aColor
"Specify border-color or fll-color instead."
drawOn: aHumCanvas
fillColor
^ fillColor ifNil: [ fillColor := Color gray. ].
fillColor: aColor
inFrontOfCamera
"Return true if at least one y-value is positive."
left
maxRsquared
"Compute the centroid of the vertices."
meanRsquared
"Compute the centroid of the vertices."
minRsquared
"Compute the centroid of the vertices."
northMostPoint
"Find the value of the point that is furtherest North (z-Ordering)"
parentSolid
"Remember where I came from."
parentSolid: aHumSolid
"Remember where I came from."
path
^self vertices.
pitch: pitchAngle
"Return a new polygon with my points adjusted by pitch about origin."
rSquared
right
roll: rollAngle
"Return a new polygon with my points adjusted by roll about origin."
top
"If points are 2D, Return max y."
vertices
"The convention is to list vertices in a counter-clockwise direction as seen from the 'outside' of a solid."
verticesDo: aBlockClosure
xyPoints
"Flatten my 3D points to 2D points in X-Y (floor plan) plane"
xzPoints
"Flatten my 3D points to 2D points in X-Z (viewport/billboard) plane. "
yaw: yawAngle
"Return a new polygon with my points adjusted by yaw about origin."
yaw: yawAngle aboutPivot: pivot
"Return a new polygon with my points adjusted by yaw about origin."
Hum-UI -- HumRotation
asPolygonsColoredBy: aColorRule
"Produce polygons from the xyList points and the rotation nWedges."
asVPython
nWedges: numberOfWedges
xyList: aCollection
"List of XY (XZ) points that define surface of revolution."
Hum-UI -- HumRowLayoutWidget
asHTML
"Generate a div containing child widget renderings."
asMorph
Hum-UI -- HumScene
asThreeJS
"Render the scene as ThreeJS"
asThreeJSGeometry
"Render the assembly as ThreeJS geometry"
asThreeJSinHTML
"Wrap ThreeJS rendering with HTML5."
asVPython
"render scene and the objects in it via VPython."
asVPythonPreamble
jump: aTime
"TODO: Is this consistent with HumSimulator?"
setupFloor4ThreeJS
"Provide boilerplate that creates a visible floor."
setupScene4ThreeJS
""
Hum-UI -- HumSolid
asPolygons