in reply to Re: Why doesn't the whole line print?
in thread Why doesn't the whole line print?
Then I push additional words onto the array as I find them with this:push @current_sentence, "<s> $current_word ";
Finally the last word of a sentence gets pushed like so:push @current_sentence, "$current_word ";
Another interesting comment, I just tried printing the string outside the if statement and the whole thing printed! But earlier I tried to get around this by having the if statement set a flag and then printing from another if statement that checked the flag... and it still printed truncated. So I still can't print conditionally.push @current_sentence, "$current_word <\/s>\n";
Thanks for all the help so far.
An update: I have looked at the behavior on some other examples and it seem as though the print statement is printing the array element that was originally pushed onto the array, even though I put the array into a single string. What I mean be this is that if the word starts a sentence, the <s> tag is ahead of it, if it is in the middle there are no other tags, and if it was at the end a </s> tag follows it. Baffeling to me!
|
|---|