1 XWindows apps: emacs, xkwic LING 5200 Computational Corpus Linguistics Martha Palmer February 9, 2006.

Slides:



Advertisements
Similar presentations
LIS651 lecture 5 direct use of wotan Thomas Krichel
Advertisements

Customizing the MOSS 2007 Search Results November 2007 Rafael Perez.
Introduction to the gedit editor. gedit: the Gnome editor Gnome: Gnome is a freely available (i.e., no cost) desktop environment for the UNIX system The.
EMT 2390L Lecture 4 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
Editing with vi Or more fun than you thought you’d have without a mouse Prof. Chris GauthierDickey.
1 Regular Expressions: grep LING 5200 Computational Corpus Linguistics Martha Palmer.
VIM: The basics Tang Wai-Chung, Matthew (MaFai) 29/12/2006.
1 More Xkwic and Tgrep LING 5200 Computational Corpus Linguistics Martha Palmer March 2, 2006.
Linux+ Guide to Linux Certification, Second Edition
CIS392 Sp 03Assign#11 CIS392 Text Processing, Retrieval, and Mining Spring 03 Instructor: Dr. Y. F. Brook Wu BOW toolkit:
Python and Web Programming
Inventory Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic or Figure.
Word Processing. ► This is using a computer for:  Writing  EditingTEXT  Printing  Used to write letters, books, memos and produce posters etc.  A.
Using Linux Commands 2 Lab#5
Introduction to Linux and Shell Scripting Jacob Chan.
Using Linux Commands 2 Lab#5. Sort command Sort the lines of text files. $ sort fileName by default it will sort in normal order(alphabetical 0-9 A-Z.
Website Tutorial. Administration  Log on by clicking Login on the footer of almost any page  Your Username is.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Unix Tutorial for FreeSurfer Users Allison Stevens.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lecture 2 Unix Basics Corpus Linguistics Fall 2004 © Kevin Cohen.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Overview of the grep Command Alex Dukhovny CS 265 Spring 2011.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
Unix Talk #2 (sed). 2 You have learned…  Regular expressions, grep, & egrep  grep & egrep are tools used to search for text in a file  AWK -- powerful.
Title Slide CSS 404/504 The UNIX Operating System (2) By Ralph B. Bisland, Jr.
WDV 331 Dreamweaver Applications Find and Replace Dreamweaver CS6 Chapter 20.
Using Harlequin LispWorks. Using LispWorks On BURKS 5, the file is lwper410.exe Start up LispWorks; you get two windows –Listener 1 –LispWorks Personal.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
1 Working with MS SQL Server Textbook Chapter 14.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
1 © 2014 John Urrutia. All rights reserved. Chapter 7 The “ Emacs “ Editor.
Introduction to Unix – CS 21 Lecture 8. Lecture Overview More detail on emacs and vi Regular expression matching in emacs and vi.
HTML Concepts and Techniques Fifth Edition Chapter 6 Using Frames in a Web Site.
1 Regular Expressions: grep LING 5200 Computational Corpus Linguistics Martha Palmer.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
Next Unix Topics Tuesday, 2/11 & 18/2014. Change Password (by 2/14/14) ssh to account on – faclinux.cse.ohio-state.edu – stdlinux.cse.ohio-state.edu passwd.
Building Your Web Site ATS 315. Your Project Make a web site that shows plots that YOU generated! Plots should regenerate every hour!
Using Commands Unix / Linux Preparation Course May 6, 2012 Serrekunda, The Gambia.
Unix Editors. u Editors in Unix come in two general flavours: –modal editors have "modes" v generally input mode and command mode –input mode allows entry.
Unix Session IV.
WRA 210: MODULE 3 &PORTFOLIO SESSION 2: STUFF TO REMEMBER Do the readings. It helps, seriously. Ask questions. It’s OK to interrupt me (not others).
When I want to work with SQL, I start off as if I am doing a regular query.
Text Editing February 2 nd, 2004 Class Meeting 3.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
Files Tutor: You will need ….
1 Introduction to Python LING 5200 Computational Corpus Linguistics Martha Palmer.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Creating and Editing a Web Page Using Inline Styles
 Go to menu Window>Show Quiz Manager  Select the first icon (Create New Quiz)  Can also view, edit and delete existing quizzes from this window.
CS 330 Programming Languages 09 / 30 / 2008 Instructor: Michael Eckmann.
Page 1 of 13 Beginner’s Tutorial – The Monalog Sanitizer What data does Monalog collect from you?  Monalog collects what you type on the command line.
Tomcat Setup BCIS 3680 Enterprise Programming. One-Click Tomcat Setup 2  This semester we’ll try to set up Tomcat with a PowerShell script.  Preparation.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Adding a Picture in ArcGIS. Getting Started Open ArcMap in ArcGIS Add shape files Find pictures on the web save in folder with shape files you added to.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
1 Regular Expressions and Xkwic LING 5200 Computational Corpus Linguistics Martha Palmer February 28, 2006.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
Introduction to Unix for FreeSurfer Users
Development Environment Basics
Dreamweaver MX Lesson 14: Using Find and Replace.
Andy Wang Object Oriented Programming in C++ COP 3330
Basic UNIX OLC Training.
T. Jumana Abu Shmais – AOU - Riyadh
Andy Wang Object Oriented Programming in C++ COP 3330
The Emacs Editor Read: Forouzan, Appendix C
Day 5 Emacs Editor David A. Gaitros Department of Computer Science
Presentation transcript:

1 XWindows apps: emacs, xkwic LING 5200 Computational Corpus Linguistics Martha Palmer February 9, 2006

LING 5200, 2006 BASED on Kevin Cohen’s LING Emacs emacs –nw Control x, control c – exit (C-x,C-c) Control x, control s – save (C-x, C-s) Control x, control v – visit (C-x, C-v) Appropos

LING 5200, 2006 BASED on Kevin Cohen’s LING Emacs – Hour 12 in book emacs –nw Control x, b – switch to a new buffer, Control x, Control b – show all buffers, Control x, 1 – just show one window, Control g – ignore the last command, Control h – help (works on verbs?)

LING 5200, 2006 BASED on Kevin Cohen’s LING Preparing to run xkwic: modifying your.cshrc Don't forget to make a back-up copy of your.cshrc file before editing it.

LING 5200, 2006 BASED on Kevin Cohen’s LING Preparing to run xkwic: modifying your.cshrc ls –a Create an alias for cp to make it prompt you before blowing away a file alias cp 'cp –i'

LING 5200, 2006 BASED on Kevin Cohen’s LING Echo command Don't forget to make a back-up copy of your.cshrc file before editing it. You can check the value of an environment variable by using the echo command. Try it now: Enter echo $TGREP_CORPUS. What do you see? You shouldn't see anything, because you haven't defined the TGREP_CORPUS variable. If you do see something, ask for help.

LING 5200, 2006 BASED on Kevin Cohen’s LING Add to.cshrc – See Lab 4 # xkwic stuff setenv CWBHOME /corpora2/imscorpus setenv CORPUS_REGISTRY $CWBHOME/registry setenv MANPATH $CWBHOME/man:$MANPATH setenv UIDPATH "/usr/local/ims-cwb/lib/ X11/uid/ %N/%U" # tgrep stuff #setenv TGREP_CORPUS /corpora/treebank2/tbl_075/tgrepabl/brwn_cmb.c rp setenv TGREP_CORPUS /corpora/treebank2/tgrepabl/wsj_mrg.crp

LING 5200, 2006 BASED on Kevin Cohen’s LING The PATH variable One very important environment variable is the PATH variable. You can view the current value of your path variable by typing echo $PATH. As you can see, you already have a value defined. We're going to change it. Open your.cshrc file with a text editor ( emacs.cshrc or pico -w.cshrc. Find a line that looks something like this:

LING 5200, 2006 BASED on Kevin Cohen’s LING The PATH variable (cont.) set path=($HOME/bin /usr/local/bin /usr/local/etc /usr/local/lang/bin /usr/ucb /bin /usr/bin /usr/sbin /usr/local/ssh/bin /usr/local/TeX/bin /usr/local/mh/bin /usr/local/elm/bin /usr/local/metamail/bin /usr/local/gnu/bin /usr/ucb /usr/openwin/bin /usr/local/X11/bin /usr/ccs/bin /etc. )

LING 5200, 2006 BASED on Kevin Cohen’s LING Adding PATH’s Now you'll define some new environment variables in your.cshrc file. There are two ways to do it. One would be to copy the following lines into your.cshrc file, either by hand or by copying and pasting off of this web page. The other would be by tailing my.cshrc ( /home/mpalmer/.cshrc ), and appending the output to your.cshrc (hint: >> ). Don't forget to make a back-up copy of it first, and don't forget to source.cshrc afterwards!

LING 5200, 2006 BASED on Kevin Cohen’s LING A PATH for xkwic Now enter the string /usr/local/ims-cwb/bin before the period that precedes the closing parenthesis, so that it looks something like this: set path=($HOME/bin /usr/local/bin /usr/local/etc /usr/local/lang/bin /usr/ucb /bin /usr/bin /usr/sbin /usr/local/ssh/bin /usr/local/TeX/bin /usr/local/mh/bin /usr/local/elm/bin /usr/local/metamail/bin /usr/local/gnu/bin /usr/ucb /usr/openwin/bin /usr/local/X11/bin /usr/ccs/bin /etc /usr/local/ims- cwb/bin. )

LING 5200, 2006 BASED on Kevin Cohen’s LING Running xkwic Save your file, source it, and check the value of your path variable again. You should see /usr/local/ims-cwb/bin in it now (in addition to the rest of the stuff that was there before). You're now ready to run xkwic! Start it by entering xkwic at the command line.

LING 5200, 2006 BASED on Kevin Cohen’s LING Fire it up To start xkwic: $babel> xkwic & First step: select a corpus

LING 5200, 2006 BASED on Kevin Cohen’s LING Select a corpus

LING 5200, 2006 BASED on Kevin Cohen’s LING Select a corpus BNC is lemmatized… …Brown and WSJ aren't

LING 5200, 2006 BASED on Kevin Cohen’s LING Select a corpus and a search pattern 1. Select the BNC corpus by clicking on the question-mark next to the Search Space text field. 2. Search for the word research with the query [word = "research"]. How many results do you get?

LING 5200, 2006 BASED on Kevin Cohen’s LING Word attribute

LING 5200, 2006 BASED on Kevin Cohen’s LING Output of a search: KWIC

LING 5200, 2006 BASED on Kevin Cohen’s LING Select a corpus and a search pattern 1. Select the BNC corpus by clicking on the question-mark next to the Search Space text field. 2. Search for the word research with the query [word = "research"]. How many results do you get? 3. Search for the lemma research with the query [lemma = "research"]. How many results do you get? Why the difference?

LING 5200, 2006 BASED on Kevin Cohen’s LING Lemma attribute output Inflected forms Case differences

LING 5200, 2006 BASED on Kevin Cohen’s LING Regular expressions in attributes of a position

LING 5200, 2006 BASED on Kevin Cohen’s LING Searching with POS tags 1. Search for tokens of research that are not verbs with the query [lemma = "research" & pos != "V.*"]. How many results do you get? 2. Modify the display so that you can see the POS of all words: File -> Display Attributes -> Concordance -> Positional Attributes; highlight "word" and "pos", click "update" and "Dismiss". What are two non-verb POS tags that research occurs with?

LING 5200, 2006 BASED on Kevin Cohen’s LING POS attribute

LING 5200, 2006 BASED on Kevin Cohen’s LING

LING 5200, 2006 BASED on Kevin Cohen’s LING I am SOOO frustrated…

LING 5200, 2006 BASED on Kevin Cohen’s LING Basic unit of xkwic: the position Attributes of a position:  Word  POS  Lemma (BNC) Searching for "positions" by attribute…

LING 5200, 2006 BASED on Kevin Cohen’s LING Multiple attributes of a position [word = "research" & pos = "NN1"]

LING 5200, 2006 BASED on Kevin Cohen’s LING Multiple attributes of a position [word = "research" & pos = "NN1"] Ampersand to connect the two attributes

LING 5200, 2006 BASED on Kevin Cohen’s LING Multiple attributes of a position [word = "research" & pos = "NN1"] Single pair of square brackets around all attributes of the single position

LING 5200, 2006 BASED on Kevin Cohen’s LING Negation [word = "research" & pos != "NN1"] = means "is" or "does match" != means "isn't" or "doesn't match"

LING 5200, 2006 BASED on Kevin Cohen’s LING Regular expressions in attributes of a position Wildcard:. Character classes: [word = "[Tt]he"] Grouping Alternation: | Quantifiers: Kleene star, Kleene plus

LING 5200, 2006 BASED on Kevin Cohen’s LING Sequences of positions [lemma = "research"] [word = "the"] Each position gets its own set of square brackets

LING 5200, 2006 BASED on Kevin Cohen’s LING Sequences of positions [lemma = "research"] [word = "the"] A space between the positions

LING 5200, 2006 BASED on Kevin Cohen’s LING Regular expressions over positions Wildcard: []  Any single position Quantifier: *  [lemma = "research"] []* [word = "funding"]

LING 5200, 2006 BASED on Kevin Cohen’s LING Resources – Laura is bugging me to make a CU Corpora page… Like this corpora/cas-home.html corpora/cas-home.html TGREP corpora/cas-tut-tgrep.html

LING 5200, 2006 BASED on Kevin Cohen’s LING Xkwic resources CQP home page: stuttgart.de/projekte/CorpusWorkbench/ stuttgart.de/projekte/CorpusWorkbench/ CQP User's Manual: stuttgart.de/projekte/CorpusWorkbench/ CQPUserManual/HTML/ (html version) stuttgart.de/projekte/CorpusWorkbench/ CQPUserManual/HTML/