title: Separate a sentence into words and endmarks
body: <p>I want to break a sentence apart into words and end marks (assume all other punctuation has been removed).  I've written a working function to break string(s) apart as described but I think the part:</p>
  
  <pre><code>unlist(c(strsplit(x, "[^[:alnum:]'\"]", perl = T), substring(x, nchar(x), nchar(x))))
  </code></pre>
  
  <p>is a cob job that can be better achieved without using the substring and just splitting on spaces and between the endmark with an or | statement of sorts but don't know how I'd achieve this.  Any direction with this would be appreciated.</p>
  
  <pre><code>breaker &lt;- function(string) {
      FUN &lt;- function(x) {
          unlist(c(strsplit(x, "[^[:alnum:]'\"]", perl = T), substring(x, 
              nchar(x), nchar(x))))
      }
      lapply(string, FUN)
  } 
  
  #EXAMPLES
  
  x &lt;- "I'm liking it!"                                                          
  breaker(x)                                                                     
  
  y &lt;- c("I'm liking it!", "How much do you like it?",  "I'd say it's awesome.") 
  breaker(y)  
  </code></pre>