desc <- suppressWarnings(readLines("DESCRIPTION")) regex <- "(^Version:\\s+)(\\d+\\.\\d+\\.\\d+)" loc <- grep(regex, desc) ver <- gsub(regex, "\\2", desc[loc]) verbad <- sprintf('<a href="https://img.shields.io/badge/Version-%s-orange.svg"><img src="https://img.shields.io/badge/Version-%s-orange.svg" alt="Version"/></a></p>', ver, ver) ```` [](https://travis-ci.org/trinker/discon) [](https://coveralls.io/r/trinker/discon) [](http://dx.doi.org/10.5281/zenodo.15711) `r verbad` <img src="inst/discon_logo/r_discon.png" width = "300" alt="discon logo"> [discon](http://trinker.github.com/discon_dev) is a collection of R tools to enhance analysis of *discourse connectors* in text. Discourse connectors are cohesive devices that can be used to help identify themes within a text. This package provides computational means of extracting and visualizing various elements from the text that contain discourse connectors. This can assist in qualitative analysis of discourse by identifying categories that may aide analysis (using the computer for efficiency and data coverage) towards generating themes. > Discourse connectors are devices used to bridge between turns (in speech) and sentences, indicating the logical relations among the parts of a the logical relations among the parts of a framework for the listener/reader. There are two major classes of discourse connectors: discourse markers and linking adverbials. Discourse markers – forms like *ok*, *well*, and *now* – are restricted primarily to spoken discourse. These forms have distinct discourse functions, but it is difficult to identify the specific meaning of the word itself. In contrast, linking adverbials – forms like *however*, *thus*, *therefore*, *for example* (*e.g.*), and *that is* (*i.e.*) – are found in both spoken and written registers, and they have greater inherent meaning than discourse markers. (Biber, 2006, p. 66) Please see the following resources for additional information: - Alemany, L. A. (2005). [Representing discourse for automatic text summarization via shallow NLP techniques](http://www.cs.famaf.unc.edu.ar/~laura/shallowdisc4summ/tesi_electronica.pdf) (Unpublished doctoral dissertation). Universitat de Barcelona, Barcelona. - [Web Site](http://russell.famaf.unc.edu.ar/~laura/shallowdisc4summ/discmar) - Biber, D. (2006). *University language: A corpus-based study of spoken and written registers*. Amsterdam: John Benjamins Publishing Company. - Halliday, M. A. K. & Hasan, R. (1976). *Cohesion in English*. English Language Series. London: Longman. - Kalajahi, S. A. R., Abdullah, A. N., Mukundan, J., & Tannacito, D. J. (2012). [Discourse connectors: An overview of the history, definition and classification of the term](http://goo.gl/eS0OwV). *World Applied Sciences Journal, 19*(11), 1659-1673. - Linguistic Data Consortium. (2004) [*Simple metadata annotation specification (MDE)*](http://www.itl.nist.gov/iad/mig/tests/rt/2004-fall/docs/SimpleMDE_V6.2-draft.pdf). University of Pennsylvania. Retrieved from [http://www.itl.nist.gov/iad/mig/tests/rt/2004-fall/docs/SimpleMDE_V6.2-draft.pdf](http://www.itl.nist.gov/iad/mig/tests/rt/2004-fall/docs/SimpleMDE_V6.2-draft.pdf) - Ryan, G. W. & Bernard, H. R. (2003). [Techniques to identify themes](http://goo.gl/KdYxB8). *Field Methods. 15*(1), 85-109. doi:[10.1177/1525822X02239569.](http://fmx.sagepub.com/content/15/1/85) - Schiffrin, D. (1987). *Discourse markers*. London: Cambridge University Press. - Schiffrin, D. (2001). [Discourse markers: Language, meaning, and context](http://goo.gl/KbwG9I). In D. Schiffrin, D., D. Tannen, & H. E. Hamilton, (Eds.) *The handbook of discourse analysis* (pp. 54-75). Malden, MA: Blackwell Publishing. - Ward, N. (2000, October). [Issues in the Transcription of English Conversational Grunts](http://www.aclweb.org/anthology/W00-1004). *Proceedings of the 1st SIGdial Workshop on Discourse and Dialogue* (pp. 29—35). Hong Kong: Association for Computational Linguistics. Retrieved from [http://www.aclweb.org/anthology/W00-1004](http://www.aclweb.org/anthology/W00-1004) ## Installation To download the development version of discon: Download the [zip ball](https://github.com/trinker/discon/zipball/master) or [tar ball](https://github.com/trinker/discon/tarball/master), decompress and run `R CMD INSTALL` on it, or use the **pacman** package to install the development version: ```r if (!require("pacman")) install.packages("pacman") pacman::p_load_gh( "trinker/qdapRegex", "trinker/qdapTools", "trinker/qdapDictionaries", "trinker/qdap", "trinker/discon" )
You are welcome to: submit suggestions and bug-reports at: https://github.com/trinker/discon/issues send a pull request on: https://github.com/trinker/discon/ * compose a friendly e-mail to: tyler.rinker@gmail.com
discourse_connector
& discourse_connector_logical
dc_backchannel
dc_causality
& dc_causality_sub
dc_comparison
dc_connective
& dc_connective_sub
dc_context
& dc_context_sub
dc_equality
& dc_equality_sub
dc_filled_pause
dc_negator
dc_oh
& dc_oh_begin
dc_revision
dc_timing
dc_typology
dc_well
& dc_well_begin
kwic
(Key Words in Context)*Note that all discourse_connector
based functions (incuding functions prefixed with dc_
) have generic plot
method that utilizes qdap::dispersion_plot
to generate a lexical dispersion plot.
if (!require("pacman")) install.packages("pacman") pacman::p_load(discon) knitr::opts_chunk$set(fig.path = "inst/figure/")
Specific discourse connector functions for exploring the context in which such markers are used. Note these functions are prefixed with a dc_
(for discourse connector).
causality_1 <- with(pres_debates2012, dc_causality(dialogue, person)) plot(causality_1)
plot(causality_1[[1]], high = "darkgreen") causality_1[1] head(causality_1[[2]])
causality_2 <- with(pres_debates2012, dc_causality_sub(dialogue, person)) plot(causality_2, bg.color = "grey60", color = "blue", total.color = "grey40", horiz.color="grey20") causality_2[1] head(causality_2[[2]]) head(causality_2[[3]])
revision <- with(pres_debates2012[1:20, ], dc_revision(dialogue, person)) revision[1] revision[2]
typology <- with(pres_debates2012[1:120, ], dc_typology(dialogue, person)) typology[1] typology[2] typology[3]
We will now examine discourse_connector
, the basic root function that all of the other dc_
prefixed functions are based upon. This can be used by the researcher to find specific text elements + surrounding context.
## Marker with one type (just: "I") i_disc <- with(pres_debates2012, discourse_connector(dialogue, person, names = c("I"), regex = "\\bI('[a-z]+)*\\b", terms = list(I = c(" I ", " I'")) )) i_disc[[1]] head(i_disc[[2]]) ## Marker with two types (both: "I" & "you") i_you_disc <- with(pres_debates2012, discourse_connector(dialogue, person, names = c("I", "you"), regex = list( I = "I('[a-z]+)*\\b", you = "(\\b[Yy]ou('[a-z]+)*\\b)" ), terms = list( I = c(" I ", " I'"), you = c(" you ", " you'") ) )) i_you_disc[[1]] head(i_you_disc[[2]]) head(i_you_disc[[3]])
keyWords <- with(pres_debates2012, kwic(dialogue, list(time, person))) plot(keyWords[[1]], high = "red")
with(pres_debates2012, plot(keyWords, grouping.var = person, rm.vars = time, total.color = NULL, bg.color = "black", color = "yellow", horiz.color="grey20")) head(keyWords[[2]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.