Presentation is loading. Please wait.

Presentation is loading. Please wait.

AntConc Search Wildcards (not Regex)

Similar presentations


Presentation on theme: "AntConc Search Wildcards (not Regex)"— Presentation transcript:

1 Searching with Wildcards and Advanced Searching with Regular Expressions (Regex)

2 AntConc Search Wildcards (not Regex)
* = zero or more characters + = zero or one character ? = exactly one character | = or @ = zero or one word # = any one word and you can use context words through Advanced Search option.

3 Practice 1 (Wildcards) Search for all occurrences of color without excluding the British version colour.

4 Practice 1 (Wildcards) Search for all occurrences of color without excluding the British version colour. Answers: colo+r color|colour

5 Practice 2 You want to know how we use the verb connect with the prepositions to and with. (Wildcards, Untagged Corpus)

6 Practice 2 Find what kind of prepositions come before years.

7 Practice Find what kind of prepositions come before years.
You need to use regular expressions to answer this question.

8 Regular Expressions (RegEx)
Regex enables you to represent a piece of string using special symbols. You can use Regex with AntConc, Monoconc, Wordsmith, and many other programming languages, such as PERL, JAVA, and so on.

9 Regex helps us find patterns in a text
Regex helps us manipulate patterns in a text (with the help of a programming language)

10 Four Important Steps First, think of an example.
Second, know how that would exist in the corpus. Third, convert the example into regex Fourth, refine your regex depending on the problems.

11 Practice 1 You want to search for both color and colour.
(Untagged Corpus)

12 Practice 1 You want to search for both color and colour. Answer:
\bcolou?r \b = word boundary ? = preceding character should happen one or zero times.

13 Practice 2 Find all abbreviations in a text. (Untagged corpus, Regex)
Answer:

14 Practice 2 Find all abbreviations in a text. Answer: \b\p{lu}{2,}

15 Practice 3 Find likely one-word linking adverbials in a corpus. (Untagged Corpus, Regex)

16 Practice 3 Find likely one-word linking adverbials in a corpus.
Answer: \p{Lu}\p{Ll}+,

17 Practice 4 Now do the same thing but restrict the adverbials only to the ones that shows up as the first word in a paragraph. (Untagged Corpus, Regex) For example: (from NYTimes) Still, I’d hear whisperings about stuffing with other ingredients, like wild rice or ground meat. There was a whole other turkey-cavity universe out there. And this year, I felt ready to meet it.

18 Practice 4 Now do the same thing but restrict the adverbials only to the ones that shows up as the first word in a paragraph. Answer: \n\W+\p{Lu}\p{Ll}+,

19 Practice 5 Get the likely linking-adverbials, that occur in the beginning of a sentence, and are composed of 2 to 4 words. (Untagged Corpus, Regex)

20 Practice 5 Get the likely linking-adverbials, that occur in the beginning of a sentence, and are composed of 2 to 4 words. Answer: \p{Lu}\p{Ll}+\s(\p{Ll}+\s){1,2},

21 Practice 6 Search for the verb “write” with all of its inflections: write, writes, wrote, written, writing. (Untagged Corpus, Regex)

22 Practice 7 Find all occurrences of “as” (subordinator)
(Tagged Corpus, Regex) 1. As they watched, a flash of fire appeared.

23 Practice 7 Find all occurrences of “as” (subordinator)
(Tagged Corpus, Regex) 1. As they watched, a flash of fire appeared. As_LLLthey_LLLwatched_LLL,_,

24 Practice 7 Find all occurrences of “as” (subordinator)
(Tagged Corpus, Regex) 1. As they watched, a flash of fire appeared. As_LLLthey_LLLwatched_LLL,_, \bas_\p{Lu}+\s(\w+_\p{Lu}+\s){2,6},

25 Practice 8 Find the prepositions come before years. (Tagged Corpus)

26 Practice 8 Find the prepositions come before years. Answer:
_IN\s\d\d\d\d

27 Practice 9 Find all adjectives ending in –ly (Tagged corpus)

28 Practice 9 Find all adjectives ending in –ly and followed by a noun (Tagged Corpus, Regex) Answer: \b*ly_JJ\b\s*_NN\w?\b


Download ppt "AntConc Search Wildcards (not Regex)"

Similar presentations


Ads by Google