LING 408/508: Programming for Linguists Lecture 15 October 21 th.

Slides:



Advertisements
Similar presentations
MY NCBI (module 4.5). MODULE 4.5 PubMed/How to Use MY NCBI Instructions - This part of the: course is a PowerPoint demonstration intended to introduce.
Advertisements

WELCOME to an Introduction of the Monitoring the end-to-end Transport/Distribution Chain B2B Version V.
Training Course: Task List. Agenda Overview of the Task List Screen Icons across the top Making Appointments Viewing Appointments & Filters Working Your.
LING/C SC/PSYC 438/538 Lecture 11 Sandiway Fong. Administrivia Homework 3 graded.
LING 408/508: Programming for Linguists Lecture 13 October 7 th.
Current Assignments Homework 5 will be available tomorrow and is due on Sunday. Arrays and Pointers Project 2 due tonight by midnight. Exam 2 on Monday.
LING 581: Advanced Computational Linguistics Lecture Notes February 2nd.
1 NewSouth HR Inquiries Global Search. 2 Select New South HR by a left mouse click once on NewSouth HR icon.
Yims Finance Project update DCOs Forum 22 nd October 2003.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Read Lecturer.
Getting started with for students before you register Make sure you have: an active account Internet browser installed on your computer Student.
Regular Expressions Week 07 TCNJ Web 2 Jean Chu. Regular Expressions Regular Expressions are a powerful way to validate and format text strings that may.
Regular Expressions Dr. Ralph D. Westfall May, 2011.
Luke Rowan The Super bowl is going to be there. Vacations Water parks.
Do Now 1)Solve to calculate the year of the first Super Bowl. January 15 (85 – 70) )The Green Bay.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 4: 8/30.
More Events and Validation CS Page/window events CS380 2.
ROSS Project Presentation CIIMT Workshop April 8, 2009.
Lecture 5: AIRPORT SECURITY
Player Numbers (Under 15 & 17) SeasonUnder 15Under 17Total
CIS 451: Regular Expressions Dr. Ralph D. Westfall January, 2009.
Suppose, hypothetically, that inflation is 3% per year and suppose that the graph of your salary in constant dollars looks like the graph below: Is your.
Regular Expressions. 2 3 Using Regular Expressions Regular expressions give you much more power to handle strings in a script. They allow you to form.
Post-Module JavaScript BTM 395: Internet Programming.
Javascript’s RegExp. RegExp object Javascript has an Object which compiles Regular Expressions into a Finite State Machine The F.S.M. is internal, and.
CS346 Regular Expressions1 Pattern Matching Regular Expression.
Copyright © Curt Hill Regular Expressions Providing a Search Pattern.
LING/C SC/PSYC 438/538 Lecture 8 Sandiway Fong. Adminstrivia Homework 4 not yet graded …
10 – Java Script (3) Informatics Department Parahyangan Catholic University.
LING 408/508: Programming for Linguists Lecture 14 October 19 th.
Online Catalog Tutorial. Introduction Welcome to the Online Catalog Tutorial. This is the place to find answers to all of your online shopping questions.
1 Introduction to Python LING 5200 Computational Corpus Linguistics Martha Palmer.
LING 408/508: Programming for Linguists Lecture 26 December 7 th.
LING 408/508: Programming for Linguists
Agenda Using vi Editor Starting vi Session Command / Input Modes Entering Text Editing Text Saving Edited File Aborting Editing Session.
LING 408/508: Programming for Linguists Lecture 16 October 26 th.
Unit 11 –Reglar Expressions Instructor: Brent Presley.
LING/C SC/PSYC 438/538 Lecture 11 Sandiway Fong. Administrivia Homework 5 graded.
LING 408/508: Programming for Linguists Lecture 12 October 7 th.
INT222 – Internet Fundamentals Week 11: RegExp Object and HTML5 Form Validation 1.
Regular Expressions /^Hel{2}o\s*World\n$/ SoftUni Team Technical Trainers Software University
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
LING 408/508: Programming for Linguists Lecture 11 October 5 th.
Dynamic Programming & Memoization. When to use? Problem has a recursive formulation Solutions are “ordered” –Earlier vs. later recursions.
LING/C SC/PSYC 438/538 Lecture 9 Sandiway Fong. Adminstrivia Homework 4 graded Homework 5 out today – Due Saturday night by midnight – (Gives me Sunday.
Chapter 4 © 2009 by Addison Wesley Longman, Inc Pattern Matching - JavaScript provides two ways to do pattern matching: 1. Using RegExp objects.
LING/C SC/PSYC 438/538 Lecture 10 Sandiway Fong. Today's Topics A note on the UIUC POS Tagger Fun with POS Tagging Perl regex wrap-up.
Variable Variables A variable variable has as its value the name of another variable without $ prefix E.g., if we have $addr, might have a statement $tmp.
Module 3 My First Ride on a Train. train ferry plane bus.
Introduction to Programming the WWW I CMSC Winter 2004 Lecture 8.
Regular Expressions In Javascript cosc What Do They Do? Does pattern matching on text We use the term “string” to indicate the text that the regular.
ELMO 101: Data Collection ELMO Observer Training.
MIS 3200 – C# (C Sharp)
Regular Expressions 'RegEx'.
Screeners and the Screener Organisation
CO4301 – Advanced Games Development Week 2 Introduction to Parsing
SEEM4570 Tutorial 05: JavaScript as OOP
LING 388: Computers and Language
LING 388: Computers and Language
Registering on the SITE is a MULTI-STEP process:
LING 408/508: Computational Techniques for Linguists
LING 388: Computers and Language
LING 408/508: Computational Techniques for Linguists
LING 408/508: Computational Techniques for Linguists
LING 408/508: Computational Techniques for Linguists
Compiler Design Second Lecture.
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong.
LING/C SC 581: Advanced Computational Linguistics
Programming Techniques :: String Manipulation
LING 388: Computers and Language
Presentation transcript:

LING 408/508: Programming for Linguists Lecture 15 October 21 th

Adminstrivia Homework 6 out today – due Saturday night (by midnight)

Last Time

Homework 6 From UIUC POS Tagger demo: sample.txt Helicopters will patrol the temporary no-fly zone around New Jersey's MetLife Stadium Sunday, with F-16s based in Atlantic City ready to be scrambled if an unauthorized aircraft does enter the restricted airspace. Down below, bomb-sniffing dogs will patrol the trains and buses that are expected to take approximately 30,000 of the 80,000-plus spectators to Sunday's Super Bowl between the Denver Broncos and Seattle Seahawks. The Transportation Security Administration said it has added about two dozen dogs to monitor passengers coming in and out of the airport around the Super Bowl. On Saturday, TSA agents demonstrated how the dogs can sniff out many different types of explosives. Once they do, they're trained to sit rather than attack, so as not to raise suspicion or create a panic. TSA spokeswoman Lisa Farbstein said the dogs undergo 12 weeks of training, which costs about $200,000, factoring in food, vehicles and salaries for trainers. Dogs have been used in cargo areas for some time, but have just been introduced recently in passenger areas at Newark and JFK airports. JFK has one dog and Newark has a handful, Farbstein said.

Homework 6 For each question, provide the screen snapshot with the regex and results

Homework 6 Question 1: write a regex that finds all the acronyms in the article.

Homework 6 Question 2: write a regex that finds all the numeric items in the article.

Homework 6 Question 3: write a regex that finds all Noun- Noun compounds Overeager matching: allow these two… Overeager matching: allow these two…

Homework 6 Question 4: write a regex that finds all the main verbs (exclude auxiliaries) in the article. Note: search may return an array with submatches: ok if main verb is a submatch, e.g. will patrol, will, patrol [match] [submatches]

Homework 6 Question 5: write a regex that finds all the passive verbs answer as a submatch ok

Javascript Regexp Tester with Replace

Javascript Regexp Tester with Replace Suppose we want to modify string str => modified_str We'll need the string method replace(): –var regex = new RegExp(re_s,flag_s); –var modified_str = str.replace(regex,replacement) – replacement string can contain $n – (n = group number) developer.mozilla.org

Javascript Regexp Tester with Replace

5. 6.function f(e) { 7. var o = document.getElementById("output"); 8. o.innerHTML = ""; 9. var re_s = e.form.re.value; 10. var s = e.form.str.value; 11. var r = e.form.rp.value; 12. if (re_s != "") { 13.var flag_s = ""; 14.if (e.form.g.checked) { 15. flag_s += "g" 16.} 17.var regex = new RegExp(re_s,flag_s); 18.o.innerHTML = s.replace(regex,r).toString() 19. } 20.} 21. e.form.re.value e.form.str.value e.form.rp.value e.form.g.checked

Example with HTML replace Example: replacement containing HTML code – string to be modified: [c_Q[q[q][who]][c_Q[c_Q][Tpast[q[q][who]][Tpast[v_unerg][Tpast[Tpa st][v_unerg[q[q][who]][v_unerg[v_unerg][laugh]]]]]]]] – regex: _(.+?)([\[\]]) – replacement string: $1 $2 spans as many characters as possible.+? minimum # chars (non-greedy) $1 1 st set of (..) $2 2 nd set of (..)

Javascript Regexp Tester with Replace [c_Q[q[q][who]][c_Q[c_Q][Tpast[q[q][who]][Tpast[v_unerg][Tpast[Tpast][v_unerg[q[q][who]][ v_unerg[v_unerg][laugh]]]]]]]]