一個段落所以我編碼紅寶石更改每一個字和我有幾句話:在使用Ruby
The sky above the port was the color of television, tuned to a dead channel. "It's not like I'm using," Case heard someone say, as he shouldered his way through the crowd around the door of the Chat. "It's like my body's developed this massive drug deficiency." It was a Sprawl voice and a Sprawl joke. The Chatsubo was a bar for professional expatriates; you could drink there for a week and never hear two words in Japanese.
,我需要修改該段的每一個字不改變結構。我最初的想法是分割空白,然後重新加入它,但問題是你得到標點符號。如果你分裂以便你知道這個詞,很難重新加入,因爲你不知道正確的標點符號。
是否有更好的方法來做到這一點比傳統的拆分,地圖,連接組合?或者,也許只是一個很好的拆分正則表達式,所以它很容易重新加入?
我想這取決於你想要做的每一個字的... – 2011-02-07 21:36:49
你想要的判斷有意義嗎?因爲不然的話,你可以分割空白和所有已知的標點符號並替換所有的令牌並重新加入 – 2011-02-07 21:40:34