LING/C SC/PSYC 438/538 Lecture 2 Sandiway Fong. Today’s Topics Did you read Chapter 1 of JM? – Short Homework 1 (submit by midnight Saturday) Some slides.

Slides:



Advertisements
Similar presentations
Coding and Debugging. Requirements and Specification Recall the four steps of problem solving: Orient, Plan, Execute, Test Before you start the implementation.
Advertisements

LING 388: Language and Computers Sandiway Fong Lecture 2.
LING 388: Language and Computers Sandiway Fong Lecture 2: 8/24.
CSE S. Tanimoto Perl Introduction 1 Perl Practical Extraction and Report Language Perl: Developed by Larry Wall in the late 1980s. Builds on...
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 1: 8/21.
Class 1: What this course is about. Assignments Reading: Chapter 1, pp 1-33 Do in Class 1: –Exercises on pages 13, 14, 22, 28 To hand in in Class 2: –Exercises.
Computational Intelligence 696i Language Lecture 4 Sandiway Fong.
COMP 110 Introduction to Programming Mr. Joshua Stough August 22, 2007 Monday/Wednesday/Friday 3:00-4:15 Gardner Hall 307.
Introduction to a Programming Environment
LING 388: Language and Computers Sandiway Fong Lecture 1: 8/23.
LING 388: Language and Computers Sandiway Fong Lecture 1: 8/22.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Chapter 6: Hostile Code Guide to Computer Network Security.
Linux & Shell Scripting Small Group Lecture 4 How to Learn to Code Workshop group/ Erin.
LING/C SC/PSYC 438/538 Lecture 5 9/8 Sandiway Fong.
CS61A Lecture 2 Functions and Applicative Model of Computation Tom Magrino and Jon Kotker UC Berkeley EECS June 19, 2012.
Chapter 1 Introduction to Visual Basic Programming and Applications 1 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta.
1 Programming Concepts Module Code : CMV6107 Class Contact Hours: 45 hours (Lecture 15 hours) (Laboratory/Tutorial 30 hours) Module Value: 1 Textbook:
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
LING/C SC/PSYC 438/538 Lecture 5 Sandiway Fong. Today’s Topics File input/output – open, References Perl modules Homework 2: due next Monday by midnight.
Lesson 6. GCSE Computing – programming languages Candidates should be able to:  describe common tools and facilities available in an integrated development.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 4: 8/30.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
LING 388: Language and Computers Sandiway Fong Lecture 3.
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong. Continuing with Perl Homework 3: first Perl homework – due Sunday by midnight – one PDF file, by .
CS 105 Perl: Course Introduction Nathan Clement 13 May 2014.
LING/C SC/PSYC 438/538 Lecture 2 Sandiway Fong. Today’s Topics Did you read Chapter 1 of JM? – Short Homework 2 (submit by midnight Friday) Today is Perl.
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 9 Basic Scripting.
Chapter 1 Object Orientation: Objects and Classes.
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
LING/C SC/PSYC 438/538 Lecture 3 8/30 Sandiway Fong.
Course Information Sarah Diesburg Operating Systems COP 4610.
Course Information Andy Wang Operating Systems COP 4610 / CGS 5765.
LING 388: Language and Computers Sandiway Fong Lecture 1: 8/23.
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong. Administrivia Homework 2 graded.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Programming Errors. Errors of different types Syntax errors – easiest to fix, found by compiler or interpreter Semantic errors – logic errors, found by.
LING/C SC/PSYC 438/538 Lecture 6 Sandiway Fong. Homework 4 Submit one PDF file Your submission should include code and sample runs Due date Monday 21.
 History  Ease of use  Portability  Standard  Security & Privacy  User support  Application &Popularity Today  Ten Most Popular Programming Languages.
Programming Objectives What is a programming language? Difference between source code and machine code What is python? – Where to get it from – How to.
LING/C SC/PSYC 438/538 Online Lecture 7 Sandiway Fong.
Programming Languages Meeting 12 November 18/19, 2014.
Chapter 1 Object Orientation: Objects and Classes.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
The full name of PERL is Practical extraction and report language. It is similar to shell script and lot easier & powerful language. Perl is free to download.
LING/C SC/PSYC 438/538 Lecture 5 Sandiway Fong.
Development Environment
PERL.
PERL.
Cory Redmond Zachary Trim Jeffery Dumas
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Guide To UNIX Using Linux Third Edition
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
Introduction to C Topics Compilation Using the gcc Compiler
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 2 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Lecturer: Mukhtar Mohamed Ali “Hakaale”
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong.
Andy Wang Operating Systems COP 4610 / CGS 5765
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
Introduction to Algorithm Design
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
Accelerated Introduction to Computer Science
L161: Inferring meaning How can readers make use of all the clues at their disposal in order to figure out the meaning of written signs and texts in a.
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
LING/C SC/PSYC 438/538 Lecture 4 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
Presentation transcript:

LING/C SC/PSYC 438/538 Lecture 2 Sandiway Fong

Today’s Topics Did you read Chapter 1 of JM? – Short Homework 1 (submit by midnight Saturday) Some slides from last time Today is Perl Day! – Did you install Perl on your own computer? –

Application of the Day Text summarization service – available on Macs (turned off by default?) – available on Microsoft Word 2008 but not 2010 – Open Text Summarizer (ots) (on Linux)

Application of the Day System Preferences (10.9)

Application of the Day Let’s try it on

Application of the Day Highlight text and control click to bring up contextual menu…

Application of the Day (Optional) Extra Credit for the Curious – (submit with your homework 1) – Discuss whether you think the summarizer did a good job. – How do you think it works? – Do you think it should work on foreign language text? If you have a Mac or OTS on Linux, try it…

From last lecture …

Examples Knowledge – Which report did you file without reading? – (Parasitic gap sentence) We take for granted this process of “filling in” or recovering the missing information

Examples Change in interpretation of embedded subject: John is too stubborn to talk to John is too stubborn to talk to Bill

Examples Ambiguity – where can I see the bus stop? – stop: verb, or – stop: part of the noun-noun compound bus stop – Diambiguate through context (discourse or situation)

Examples Ambiguity – where can I see the bus stop? shutterstock.com

Examples Ungrammaticality – *Which book did you file the report without reading? – * = ungrammatical Colorless green ideas sleep furiously. Furiously sleep ideas green colorless. – ungrammatical vs. incomprehensible

Examples The human parser has quirks Ian told the man that he hired a story Ian told the man that he hired a secretary Garden-pathing: a temporary ambiguity tell: someone something vs. … More subtle differences The reporter who the senator attacked admitted the error The reporter who attacked the senator admitted the error

Short Homework 1 Submit your answers by Saturday midnight submission (one file) to Subject of 538/438 Homework 1 Your NAME Your name at the top of the file (I can’t always tell by the id.) Also whether 538 or 438. Your answers to: 1.Is flying saucer an example of an idiom or compositional in meaning? Explain your answer in terms of your understanding of these two terms. 2.The men saw the boy with a telescope In what way(s) is this sentence structurally ambiguous? Explain. 3.John dislikes nearly everyone he meets In what way(s) is this sentence referentially ambiguous? Explain.

Perl Day Learn Perl – Books… – Online resources we begin with...

Perl History invented by Larry Wall in the mid-1980s Perl = “Practical Extraction and Reporting Language” It pulls together features from many pre-existing Unix tools: – efficient text processing: awk, sed – search: grep (regular expression search) – shell scripting: c-shell and others Interpreted language no compilation phase down to machine code (cf. C) – lends itself to rapid prototyping and the writing of small programs. – (Disadvantage: slower than C.) Huge collection of Perl modules (.pm) already written and freely available on CPAN - Comprehensive Perl Archive Network

Perl Factoid Larry Wall was a linguist (UC Berkeley) from his wikipedia entry

Perl Day Let’s go through – For those who are curious, I use aquamacs as the text editor

Perl Day Reading Perl code (perldata): – The '$' symbol works semantically like the English word "the" in that it indicates a single value is expected. – Entire arrays (and slices of arrays and hashes) are denoted by which works much like the word "these" or "those" does in English, in that it indicates multiple values are expected. – Entire hashes are denoted by '%’… (no translation) – In addition, subroutines are named with an initial '&', though this is optional when unambiguous, just as the word "do" is often redundant in English. – Variable types: Every variable type has its own namespace. This means that $foo are two different variables. It also means that $foo[1] is a part not a part of $foo. This may seem a bit weird, but that's okay, because it is weird.

Perl Day Notes from the tutorial: – whitespace not always necessary, e.g. print"Hello class!\n”; – is fine, but good idea to consistently use spacing (not just for readability) – variable names must not begin with a number (use a letter), so $538students is out $students538 is ok – error messages are frequently completely uninformative (and sometimes misleading), e.g. Bareword found where operator expected at example.prl line 3, near "$538students" (Missing operator before students?) Is the error associated with the variable starting with a number? – so make sure you write code consistently. – semicolon (;) is not always necessary Command separator token semantics vs. end of command (termination) token Best practice is to terminate every command with a semicolon

Exercises Practice using Perl – read the documentation and run the examples! Preparatory reading: – Chapter 2 of the textbook – we’ll be using Perl’s regular expression engine for this