Changeset 2674 for trunk/gsdl/src
- Timestamp:
- 2001-07-27T11:29:15+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/phind/generate
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/phind/generate/phrase.cpp
r2487 r2674 44 44 #include "phrase.h" 45 45 46 46 47 // Phrase constructor functions 48 47 49 48 50 Phrase::Phrase(symbol *words, cellcount size, int direction) { … … 59 61 } 60 62 63 61 64 Phrase::Phrase() { 62 65 empty(); … … 119 122 return 0; 120 123 } 124 125 // Shorten a phrase by one symbol 126 int Phrase::shortenByOneAtSuffix() { 127 --length; 128 --back; 129 clearSuffix(); 130 clearPrefix(); 131 return 0; 132 } 133 134 int Phrase::shortenByOneAtPrefix() { 135 --length; 136 ++forward; 137 clearSuffix(); 138 clearPrefix(); 139 return 0; 140 } 141 121 142 122 143 … … 705 726 int Phrase::expandWhileUniqueSuffixExtension() { 706 727 assert(forward); 707 assert(suffixFound);728 ensureSuffixFound(); 708 729 709 730 // if the phrase occurs only once, do nothing … … 745 766 746 767 int Phrase::expandWhileUniquePrefixExtension() { 747 assert(prefixFound); 768 assert(forward); 769 ensurePrefixFound(); 748 770 749 771 // if the phrase occurs only once, do nothing -
trunk/gsdl/src/phind/generate/phrase.h
r2498 r2674 75 75 cellcount prefixFrequency; 76 76 77 // Constructor function 77 // Constructor functions 78 78 // First argument is an array of words, second is the length of 79 79 // the phrase, third is the direction (SUFFIX of PREFIX) in … … 100 100 int expandUniquePrefixExtensionByOne(); 101 101 int expandUniqueSuffixExtensionByOne(); 102 103 // Extend a phrase until it no longer has a unique extanesion 104 int expandWhileUniqueSuffixExtension(); 105 int expandWhileUniquePrefixExtension(); 106 107 // Shorten a phrase by one symbol 108 int shortenByOneAtSuffix(); 109 int shortenByOneAtPrefix(); 102 110 103 111 // Find the phrase in the suffix/prefix array … … 137 145 Phrase Phrase::newPhraseShortestPrefixExpansion(cellindex i); 138 146 139 // Extend a phrase until it no longer has a unique extanesion140 int expandWhileUniqueSuffixExtension();141 int expandWhileUniquePrefixExtension();142 147 }; 143 148
Note:
See TracChangeset
for help on using the changeset viewer.