trinker/qdapRegex: version 0.7.2
Description
Releases will be numbered with the following semantic versioning format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
- Breaking backward compatibility bumps the major (and resets the minor and patch)
- New additions without breaking backward compatibility bumps the minor (and resets the patch)
- Bug fixes and misc changes bumps the patch
BUG FIXES
rm_dollar's regex now allows for commas in the dollar portion.
NEW FEATURES
as_countadded to convertex_citationinto counts of citations.
MINOR FEATURES
ex_added to compliment therm_function.
IMPROVEMENTS
graband functions that use@rm_xxxnow work onex_xxxas well.
CHANGES
explainis fully functional again as <a href="http://rick.measham.id.au/paste/explain" target="_blank">http://rick.measham.id.au/paste/explain</a> is again functioning.
NEW FEATURES
rm_prefixed functions get an extraction counterpart prefixed withex_.
This means users can useex_functions directly without using therm_form in the less convenient form ofrm_xxx(extract = TRUE).
BUG FIXES
rm_numberincorrectly did not handle multiple comma separated digits (see <a href="https://github.com/trinker/qdapRegex/issues/17">issue #17</a>). This behavior has been fixed and a unit test added to ensure proper handling.
BUG FIXES
rm_betweendid not handle single quotation marks (') as both the left and right boundary whenextract = TRUE. Related to <a href="https://github.com/trinker/qdapRegex/issues/13">issue #13</a>
NEW FEATURES
rm_transcript_timeadded to remove transcript specific style of time stamp tagging. See <a href="http://help-nv10mac.qsrinternational.com/desktop/procedures/import_audio_or_video_transcripts.htm" target="_blank">http://help-nv10mac.qsrinternational.com/desktop/procedures/import_audio_or_video_transcripts.htm</a> for details.as_timeandas_time2added for use withrm_time/rm_time_trnscript.
These are convert to the standard HH:MM:SS.OS format and optionally converts toas.POSIXlt. The former outputs a list of vectors of times while the later wrapsas_timewithunlist.
MINOR FEATURES
except_firstadded toregex_supplementdictionary to provide a means to remove all occurrences of a character except the first appearance. Regex from: <a href="http://stackoverflow.com/a/31458261/1000343" target="_blank">http://stackoverflow.com/a/31458261/1000343</a>rm_betweenandr_between_multiplepick up afixedargument. Previously,leftandrightboundaries containing regular expression special characters were fixed by default (escaped). This did not allow for the powerful use of a regular expression for left/right boundaries. Thefixed = TRUEbehavior is still the default but users can now setfixed = FALSEto work with regular expression boundaries. This new feature was inspired by @Ronak Shah's StackOverflow question: <a href="http://stackoverflow.com/q/31623069/1000343" target="_blank">http://stackoverflow.com/q/31623069/1000343</a>
CHANGES
word_boundary,word_boundary_left,word_boundary_rightregexes in theregex_supplementdid not include apostrophes as a viable word character. Apostrophes are now included as a word character.explainno longer prints the regular expression explanation to the command line. Instead the link to <a href="http://www.regexper.com" target="_blank">http://www.regexper.com</a> is printed. This change is because <a href="http://rick.measham.id.au/paste/explain" target="_blank">http://rick.measham.id.au/paste/explain</a> no longer appears to be working. The text explanation functionality will return if the website becomes operational again or if a suitable substitute can be found.<a href="https://github.com/trinker/qdapRegex" target="_blank">qdapRegex</a> 0.4.0
BUG FIXES
rm_numberdid not extract consecutive digits that aren't comma separated without separating it into multiple strings. For example "12345" became "123" "45". Also 444,44 will not be removed/extracted as it is not a valid comma separated number. These behavior have been corrected and the unit test now include these cases. Thanks to Jason Gray for the rework of the regex. It is simpler and more accurate.rm_betweendid not handle quotation marks (") as both the left and right boundary whenextract = TRUE. Bug reported by Tori Shannon, <a href="http://stackoverflow.com/q/31119989/1000343," target="_blank">http://stackoverflow.com/q/31119989/1000343,</a> and addressed by Jason Gray. See <a href="https://github.com/trinker/qdapRegex/issues/13">issue #13</a>
NEW FEATURES
as_numeric&as_numeric2added for use withrm_number. These are wrappers foras.numeric(gsub(",", "", x)). The former removes commas and converts a list of vectors of strings to numeric. The later wrapsas_numericwithunlist.rm_non_wordsadded to remove every any character that isn't a letter, apostrophe, or single space.The class
extractedhas been added and is the output of arm_xxxfunction whenextract = TRUE. This allows for thec.extractedfunction to easily turn thelistoutput into a character vector.c.extractedadded to provide a quick unlist method forlists of classextracted. The is less typing thanunlistfor an approach that is used often.bind_oradded as a means of quickly wrapping multiple sub-expression elements with left/right boundaries and then concatenate/joins the grouped strings with regular expression or statement ("|").
MINOR FEATURES
punctuationadded toregex_supplementdictionary for easy negation of[:punct:]class.
BUG FIXES
explainusedmessageto print to the console.explainnow returns an object of the classexplainwith its own print method which usescatrather thanmessage. Additionally, the characters+and&were not handled correctly; this has been corrected.Documentation for
TC"there is an incomplete sentence. It is as follows: TC utilizes additional rules for capitalization beyondstri_trans_totitlethat includes..." (found by rmsharp). This has been corrected. See <a href="https://github.com/trinker/qdapRegex/issues/8">issue #8</a>cheat(and accompanyingregex_cheatdictionary) contained misspellings in the words greedy and beginning. This has been corrected.rm_numberincorrectly handled numbers containing leading or trailing zeros. See <a href="https://github.com/trinker/qdapRegex/issues/9">issue #9</a>rm_caps_phrasescould only extract/remove up to two "words" worth of capital letter phrases at a time. See <a href="https://github.com/trinker/qdapRegex/issues/11">issue #11</a>
NEW FEATURES
%+%binary operator version ofpastex(x, y, sep = "")added to join regular expressions together.group_oradded as a means of quickly wrapping multiple sub-expression elements with grouping parenthesis and then concatenate/joins the grouped strings with regular expression or statement ("|").rm_repeated_charactersadded for removing/extracting/replacing words with repeated characters (each repeated > 2 times). Regex pattern comes from: StackOverflow's vks (<a href="http://stackoverflow.com/a/29438461/1000343)." target="_blank">http://stackoverflow.com/a/29438461/1000343).</a>rm_repeated_phrasesadded for removing/extracting/replacing repeating phrases (> 2 times). Regex pattern comes from: StackOverflow's BrodieG (<a href="http://stackoverflow.com/a/28786617/1000343)." target="_blank">http://stackoverflow.com/a/28786617/1000343).</a>rm_repeated_wordsadded for removing/extracting/replacing repeating words (> 2 times).
MINOR FEATURES
run_splitregex added to theregex_supplementdictionary to split runs into chunks.
IMPROVEMENTS
Regular Expression Dictionaries (e.g.,
regex_usaandregex_supplement) are now managed with the regexr package. This enables cleaner updating of the regular expressions with easier to read structure. Longer files will be stored in this format. Files located: https://github.com/trinker/qdapRegex/tree/master/inst/regex_scriptsrm_caps_phrasehas a new regular expression that is more accurate and does not pull trailing white space.
BUG FIXES
pastexwould throw a warning on a vector (e.g.,pastex(letters)). This has been fixed.youtube_idwas documented underqdap_usarather thanqdap_supplementand contained an invalid hyperlink. This has been fixed.rm_citationcontained a bug that would not operate on citations with a comma in multiple authors before the and/& sign. See <a href="https://github.com/trinker/qdapRegex/issues/4">issue #4</a>
NEW FEATURES
is.regexadded as a logical check of a regular expression's validy (conforms to R's regular expression rules).rm_postal_codeadded for removing/extracting/replacing U.S. postal codes.Case wrapper functions,
TC(title case),U(upper case), andL(lower case) added for convenient case manipulation.groupfunction added to allow for convenient wrapping of grouping parenthesis around regular expressions.rm_citation_texadded to remove/extract/replace bibkey citations from a .tex (LaTeX) file.regex_cheatdata set andcheatfunction added to act as a quick reference for common regex task operations such a lookaheads.rm_caps_phraseadded to supplementrm_caps, extending the search to phases.explainadded to view a visual representation of a regular expression using <a href="http://www.regexper.com" target="_blank">http://www.regexper.com</a> and <a href="http://rick.measham.id.au/paste/explain." target="_blank">http://rick.measham.id.au/paste/explain.</a> Also takes named regular expressions from theregex_usaor other supplied dictionary.
MINOR FEATURES
last_occurrenceregex added to theregex_supplementdictionary to find the last occurrence of delimiter.word_boundary,word_boundary_left, andword_boundary_rightadded toregex_supplementdictionary to provide a true word boundary. Regexes adapted from: <a href="http://www.rexegg.com/regex-boundaries.html#real-word-boundary" target="_blank">http://www.rexegg.com/regex-boundaries.html#real-word-boundary</a>rm_time2regex added to theregex_usadictionary to find time + AM/PM
IMPROVEMENTS
The
regex_usadictionary regular expressions:rm_hash,rm_tag,rm_tag2andrm_betweenpick up grouping that allows for replacement of individual sections of the substring. See?rm_hashand?rm_tagfor examples.pastexpicks up asepargument to allow the user to choose what string is used to separate the collapsed expressions.rm_citation,rm_citation2, andrm_citation3now attempt to include last names that contain the lower case particles: von, van, de, da, and du.
CRAN fix for oldrel Windows. Updated to R version 3.1.0 in Description file.
NEW FEATURES
bindadded as a convenience function to add a left and right boundary to each element of a character vector.
First CRAN Release
NEW FEATURES
rm_citationadded for removing/extracting/replacing APA 6 style in-text citations.rm_whiteand accompanying family ofrm_whitefunctions added to remove white space.rm_non_asciiadded to remove non-ASCII characters from a string.around_added to extract word(s) around a given point.pagesandpages2added to theregex_supplementdata set for removing/extracting/validating page numbers.
IMPROVEMENTS
rm_XXXfamily of functions now usestringi::stri_extract_all_regexas this approach is much faster than theregmatches(text.var, gregexpr(pattern, text.var, perl = TRUE))approach.
This package is a collection of regex tools associated with the qdap package that may be useful outside of the context of discourse analysis. Tools include removal/extraction/replacement of abbreviations, dates, dollar amounts, email addresses, hash tags, numbers, percentages, person tags, phone numbers, times, and zip codes.
Files
trinker/qdapRegex-v0.7.2.zip
Files
(509.4 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:b5300c88809cbfaa185d622ae0f91cb1
|
509.4 kB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/trinker/qdapRegex/tree/v0.7.2 (URL)