Skip to content

Commit 1fce6ed

Browse files
authored
Merge pull request #8 from StephanEggermont/patch-1
Typos
2 parents 708c256 + 95f2f6b commit 1fce6ed

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Containers-Trie/CTOptimizedTrieNode.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
I am the node of a optimized Trie node, I have the children in an array as pairs.
33
I am used inside a CTOptimizedTrie
44
The first element is the key and the second the node.
5-
This nodes have a string as a key, not a single character.
5+
These nodes have a string as a key, not a single character.
66
77
My users should use:
88
9-
- #findChildWithString: to get my subnode that aplies to the given string, nil if there is not node.
10-
- #findChildWithString:storingAncestors:adding: to get my subnode that aplies to the given string, nil if there is not node. If the node does not exists, it will be added depending of the adding parameter. Also it will store the ancestors passed to reach the final node.
9+
- #findChildWithString: to get my subnode that applies to the given string, nil if there is no node.
10+
- #findChildWithString:storingAncestors:adding: to get my subnode that applies to the given string, nil if there is no node. If the node does not exist, it will be added depending on the adding parameter. Also it will store the ancestors passed to reach the final node.
1111
- #removeNode: Removes a node from my self.
1212
- #withAllChildrenDo: iterates over me and my children.
1313

src/Containers-Trie/CTTrie.class.st

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"
2-
A tree for storing strings in which there is one node for every common prefix. The strings (words) are *usually* stored in extra leaf nodes. The root of a Trie can be recognized by the fact that its character instance variable is <nil>. Words can be determined by the fact that the node completing the word has a nodeValue. Note that a word does not have to be found at a leaf node (e.g. the word ""in"", see Wipidedia example at link given below).
2+
A tree for storing strings in which there is one node for every common prefix. The strings (words) are *usually* stored in extra leaf nodes. The root of a Trie can be recognized by the fact that its character instance variable is <nil>. Words can be determined by the fact that the node completing the word has a nodeValue. Note that a word does not have to be found at a leaf node (e.g. the word ""in"", see Wikipedia example at link given below).
33
44
See <http://en.wikipedia.org/wiki/Trie> for more details.
55
@@ -30,7 +30,7 @@ CTTrie class >> readFromFile: anObject [
3030
{ #category : #'instance creation - bulk' }
3131
CTTrie class >> readFromFile: anObject withLineTransformer: aBlock [
3232
"A utility method that allows to bulk load a file containing one word per line and add them all to a trie structure.
33-
aBlock allows one to convert the line before inserting it in the trie (for example one can convert it as lowercase)."
33+
aBlock allows one to convert the line before inserting it in the trie (for example one can convert it to lowercase)."
3434

3535
| aTrie fileReference |
3636

@@ -85,11 +85,11 @@ CTTrie >> add: aString value: anObject [
8585
]
8686

8787
{ #category : #accessing }
88-
CTTrie >> at: aString update: updateBlock initial: initBlocktOrValue [
88+
CTTrie >> at: aString update: updateBlock initial: initBlockOrValue [
8989
"I am used to update the value at a given key. The updateBlock is passed
9090
the existing value, and the result of the block is stored back.
91-
If the key does not exist, store the value of the initBlocktOrValue.
92-
initBlocktOrValue can be a block in case the initial value is expencive to compute."
91+
If the key does not exist, store the value of the initBlockOrValue.
92+
initBlockOrValue can be a block in case the initial value is expensive to compute."
9393

9494
| currentNode ancestors |
9595
currentNode := root.
@@ -105,7 +105,7 @@ CTTrie >> at: aString update: updateBlock initial: initBlocktOrValue [
105105
ifFalse: [ currentNode addChildWithLetter: each ] ].
106106

107107
[currentNode nodeValue: (currentNode nodeValue
108-
ifNil: [ initBlocktOrValue value ]
108+
ifNil: [ initBlockOrValue value ]
109109
ifNotNil: [ :previousValue | updateBlock cull: previousValue])] ensure: [
110110
self compressNode: currentNode ancestors: ancestors].
111111

0 commit comments

Comments
 (0)