Markov chain text generator: Difference between revisions
Content deleted Content added
m →{{header|C++}}: unused pos in createText() removed |
|||
Line 103: | Line 103: | ||
key += w1 + " "; |
key += w1 + " "; |
||
next = fileBuffer.find_first_not_of( 32, pos + 1 ); |
next = fileBuffer.find_first_not_of( 32, pos + 1 ); |
||
if( next == |
if( next == std::string::npos ) return; |
||
wc++; |
wc++; |
||
} |
} |
||
Line 109: | Line 109: | ||
while( true ) { |
while( true ) { |
||
next = fileBuffer.find_first_not_of( 32, pos + 1 ); |
next = fileBuffer.find_first_not_of( 32, pos + 1 ); |
||
if( next == |
if( next == std::string::npos ) return; |
||
pos = fileBuffer.find_first_of( 32, next ); |
pos = fileBuffer.find_first_of( 32, next ); |
||
w1 = fileBuffer.substr( next, pos - next ); |
w1 = fileBuffer.substr( next, pos - next ); |