LING 388: Computers and Language

Slides:



Advertisements
Similar presentations
Installing JDK Vijayan Sugumaran Department of DIS Oakland University.
Advertisements

Binary Search Trees continued Trees Draw the BST Insert the elements in this order 50, 70, 30, 37, 43, 81, 12, 72, 99 2.
LING 388: Language and Computers Sandiway Fong Lecture 4.
LING 408/508: Programming for Linguists Lecture 3 August 31 st.
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 .
How to Work with Numeric and String Data
A contraction is a word that is made by putting together two separate words and shortening them.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
Chapter 2: Introduction to HyperMesh Process Auomation
Prof. Alfred J Bird, Ph.D., NBCT Door Code for IT441 Students.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
12. MODULES Rocky K. C. Chang November 6, 2015 (Based on from Charles Dierbach. Introduction to Computer Science Using Python and William F. Punch and.
-Joseph Beberman *Some slides are inspired by a PowerPoint presentation used by professor Seikyung Jung, which was derived from Charlie Wiseman.
Introduction to Programming Python Lab 8: Loops 26 February PythonLab8 lecture slides.ppt Ping Brennan
Intelligent Data Systems Lab. Department of Computer Science & Engineering Python Installation guide 컴퓨터의 개념 및 실습.
UNIX Review CS 2204 Class meeting 15. (C) S. S. Gifford, Virginia Tech, Study Hints You should have: Read all required material Finished all labs.
Python: File Directories What is a directory? A hierarchical file system that contains folders and files. Directory (root folder) Sub-directory (folder.
Tips. Iteration On a list: o group = ["Paul","Duncan","Jessica"] for person in group: print(group) On a dictionary: o stock = {'eggs':15, 'milk':3, 'sugar':28}
Nested Loops CS303E: Elements of Computers and Programming.
Software Development Environment
Introduction to Python
Agenda Introduction Computer Programs Python Variables Assignment
Topic: File Input/Output (I/O)
High or Low Level Programming Language? Justify your decision.
Python Lesson 12 Mr. Kalmes.
UNIX Review CS 2204 Class meeting 15.
Introduction to Python
CMSC201 Computer Science I for Majors Lecture 22 – Binary (and More)
Introduction to Programming
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
LING/C SC/PSYC 438/538 Lecture 10 Sandiway Fong.
Corpus Linguistics I ENG 617
Python Lesson 12 Mr. Kalmes.
Bryan Burlingame 26 September 2018
LING 388: Computers and Language
LING 388: Computers and Language
LING 388: Computers and Language
Topics in Linguistics ENG 331
LING 388: Computers and Language
LING 388: Computers and Language
Introduction to Programming
Fill the screen challenge!
LING 388: Computers and Language
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
LING 388: Computers and Language
LING 388: Computers and Language
Lesson Aims Vocabulary In this lesson you are going to:
Winter 2018 CISC101 12/5/2018 CISC101 Reminders
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Friday 9/30 Due today: NA Objectives:
Introduction to Programming
LING 408/508: Computational Techniques for Linguists
Introduction to Programming
LING 388: Computers and Language
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong.
LING 388: Computers and Language
CSE 303 Concepts and Tools for Software Development
Bryan Burlingame 6 March 2019
LING 388: Computers and Language
Introduction to Programming
Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg
Introduction to Programming
Nate Brunelle Today: Regular Expressions
Nate Brunelle Today: Regular Expressions
LING/C SC 581: Advanced Computational Linguistics
Lecture 31 – Practice Exercises 7
LING 388: Computers and Language
LING 388: Computers and Language
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
Presentation transcript:

LING 388: Computers and Language Lecture 15

Today's Topics We didn't finish the exercises from last time … But first the Windows IDLE

Python IDLE on Windows https://docs.python.org/3/faq/windows.html Add path to python executable to environment variable PATH: Control Panel / System / Advanced System Settings / Environmental Variables

Python IDLE on Windows helpdeskgeek.com

Python IDLE on Windows import os os.getcwd() os.chdir(r"..path.. ") Note: raw string (r) because of \ is directory separator in Windows and \ is the escape meta-character for strings.

Slides from last time … Download wordlist.py (Brown Corpus words) to your computer and put in a directory where your Python can see it. Best practice: put it in the same directory as your Python working directory

More Python regex practice Run the following: wordlist.py a variable called wordlist also call it wordlist in the interpreter namespace

More Python regex practice Exercise 1: produce a list of all the words in wordlist that having two a's in a row aa = [word for word in wordlist if re.search('aa',word)] len(aa) Exercise 2: are there more words with two b's in a row? Exercise 3: words with two p's or b's or d's in a row – which is the most frequent?

More Python regex practice Exercise 4: find a word with both bb and dd in it Exercise 5: are there any words with both pp and dd? Exercise 6: find words ending in zac. How many are there? Recall: meta-character for the end of line anchor Exercise 7: find words beginning in anti. How many are there? Hint: some cases may begin with a capital letter

Extra Credit: Python regex (Optional Homework 7) Familiarize yourself with British and American spelling https://en.oxforddictionaries.com/spelling/british-and-spelling Note: The Brown Corpus is an American English corpus Question 1: Find four examples of words spelled both ways but present in the corpus Question 2: Consider the –or vs. –our ending, as in color and colour Write Python code that searches wordlist and finds all examples present with both endings Show your code and the result of your code running

Extra Credit: Python regex New deadline (by next Monday midnight) to TA Patricia Lee