Tools Home : HTML Tools : Find Text — Co-occurrence

Click here to show HTML tools HTML Tools

Click here to expand XML tools XML tools

Click here to expand plain text tools Plain Text Tools

Click here to expand other tools Other tools

 Beta tools
 Add Tools Demo

Find Text — Co-occurrence

This tool searches for two words at a user-defined distance of words, sentences, lines or paragraphs apart from one another, within an HTML document located either at a user-specified web address or uploaded from the user’s files. If desired, the results can be narrowed to include words only found within certain tags.

Note: When 'Paragraphs' is selected as context, any element name entered by the user will be overwritten by the 'p' (<p></p>) tag. As not all HTML texts use the paragraph tag to identify paragraphs, this may cause some problems with the tool’s results. If so, use a context of word, line or sentence instead.

Please click the ? buttons at the bottom right of each set of options for more information on that set.

For further information on this tool, please see the TADA Wiki's Co-ocurrance entry here. A glossary of terms is also available here.


To generate co-occurrences for text found within; extract text found between the <body> and </body> tags, limit the results to strings of text that contain both 'web' and 'W3C' within ten words of one another, and display the results as HTML:
  1. Source text
    1. Enter ‘’ into the ‘URL’ field.
  2. Subtext limited to
    1. Enter ‘body’ in the ‘Elements’ field.
  3. What to find
    1. Enter ‘web’ into the ‘Primary pattern’ field.
    2. Enter ‘W3C’ into the ‘Co-pattern’ field.
  4. Context for concordance
    1. Set the ‘Context’ drop list to ‘Words’.
    2. Enter ‘10’ into the ‘Context length’ field.
  5. Results
    1. Set the ‘Display as’ field to ‘HTML’.
  6. Click the ‘Submit’ button to process the text.
» Source text


This section determines the source of the document you wish the tool to process. HTML can be obtained either from a web address or by uploading a file.


Source URL
To use content from a web page, enter a full web address (URL) in the field provided. Copy and paste from your browser’s address bar for best results.

Local file
To upload an HTML (.html) file from your computer, choose ‘Local file,’ click ‘Browse,’ and select the file you wish to use from your directory.
» Subtext limited to
(separate multiple elements with a `,')

This section determines which HTML tags to extract text from.


Use this field to specify which HTML tag(s) to extract text from. Multiple tags must be separated by commas (ex: 'p, h1, h2'). This field defaults to 'body'.
» What to find

This section defines the primary and secondary words or patterns to search for within the source text. A pattern may be a string of characters or a regular expression. The tool will search for the primary and secondary words or patterns within a set distance of one another.


Primary pattern
Enter the first word or pattern here.

Enter the second word or pattern here.
» Context for concordance

This section allows the user to define the context type (words, lines, sentences or paragraphs), and how many of that type (context length) to show on either side of each instance of the word or pattern.



Context can be set to one of four options from the drop menu: words, lines, sentences and paragraphs.

This option places the search term or pattern in context by a specified number of words.

This option places the search term or pattern in context by a specified number of lines.

This option places the search term or pattern in context by a specified number of sentences.

This option places the search term or pattern in context by a specified number of paragraphs.

Context Length
This drop menu allows users to enter how many words, lines, sentences or paragraphs to show before and after the word or pattern. For example, if the context length is 5 words, every instance of the search term or pattern will be shown surrounded by a total of ten words - the five that precede it, and the five that follow it.
» Results

This section allows the user to choose the format of the aggregated text.


Display as
This drop-down lists enables users to choose from several output formats: HTML, XML text in HTML, XML tree, and Tab delimited text. Note: XML outputs are not available for the Find Dates tool.

Display words before and after the pattern
Check this box to show the words that appear before and after the pattern in the results Note: Concordance only.

Open results in new window
Check this box to display the results in a new window or browser tab. This option is selected by default. Some pop-up blockers may prevent a new window from being opened; if so, un-check the box to open the results in the same window instead.
`*' indicates a required field



TAPoRware Project, McMaster University,