week 6. optimality theory and acquisition. grs lx 865 topics in linguistics

50
Week 6. Optimality Theory Week 6. Optimality Theory and acquisition. and acquisition. GRS LX 865 GRS LX 865 Topics in Topics in Linguistics Linguistics

Post on 22-Dec-2015

220 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Week 6. Optimality Theory Week 6. Optimality Theory and acquisition.and acquisition.

GRS LX 865GRS LX 865Topics in Topics in

LinguisticsLinguistics

Page 2: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Optimality TheoryOptimality Theory

Grammar involves Grammar involves constraintsconstraints on the on the representations (e.g., SS, LF, PF, or representations (e.g., SS, LF, PF, or perhaps a combined representation).perhaps a combined representation).

The constraints exist in The constraints exist in all all languageslanguages..

Where languages differ is in how Where languages differ is in how important each constraint is with important each constraint is with respect to each other constraint.respect to each other constraint.

Page 3: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Optimality TheoryOptimality Theory

In our analysis, one constraint is In our analysis, one constraint is Parse-T, which says that tense must Parse-T, which says that tense must be realized in a clause. A structure be realized in a clause. A structure without tense (where TP has been without tense (where TP has been omitted, say) will violate this omitted, say) will violate this constraint.constraint.

Another constraint is *F (“Don’t have Another constraint is *F (“Don’t have a functional category”). A structure a functional category”). A structure withwith TP will violate this constraint. TP will violate this constraint.

Page 4: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Optimality TheoryOptimality Theory

Parse-T and *F are in Parse-T and *F are in conflictconflict—it is —it is impossible to satisfy both at the impossible to satisfy both at the same time.same time.

When constraints conflict, the choice When constraints conflict, the choice made (on a language-particular made (on a language-particular basis) of which constraint is basis) of which constraint is considered to be “more important” considered to be “more important” ((more highly rankedmore highly ranked) determines ) determines which constraint is satisfied and which constraint is satisfied and which must be violated.which must be violated.

Page 5: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Optimality TheoryOptimality Theory

So if *F >> Parse-T, TP will be So if *F >> Parse-T, TP will be omitted.omitted.

and if Parse-T >> *F, TP will be and if Parse-T >> *F, TP will be included.included.

Page 6: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Optimality Theory—big Optimality Theory—big picturepicture

Universal Grammar Universal Grammar isis the constraints the constraints that languages must obey.that languages must obey.

Languages differ only in how those Languages differ only in how those constraints are ranked relative to one constraints are ranked relative to one another. (So, “parameter” = “ranking”)another. (So, “parameter” = “ranking”)

The kid’s job is to re-rank constraints The kid’s job is to re-rank constraints until they match the order which until they match the order which generated the input that s/he hears.generated the input that s/he hears.

Page 7: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

French kid dataFrench kid data

This means if a kid uses 3sg or This means if a kid uses 3sg or present tense, we can’t tell if they present tense, we can’t tell if they are are reallyreally using 3sg (they using 3sg (they mightmight be) be) or if they are not using agreement at or if they are not using agreement at all and just pronouncing the default.all and just pronouncing the default.

So, we looked at non-present tense So, we looked at non-present tense forms and non-3sg forms only to forms and non-3sg forms only to avoid the question of the defaults.avoid the question of the defaults.

Page 8: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

The ideaThe idea

Kids are subject to conflicting Kids are subject to conflicting constraints:constraints: Parse-TParse-T Include a projection for tenseInclude a projection for tense Parse-AgrParse-Agr Include a project for agreementInclude a project for agreement *F*F Don’t complicate your tree withDon’t complicate your tree with

functional projectionsfunctional projections *F*F22 Don’t complicate your tree soDon’t complicate your tree so

much as to have much as to have twotwo functional functionalprojections.projections.

Page 9: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

The ideaThe idea

Sometimes Parse-T beats out *F, and Sometimes Parse-T beats out *F, and then there’s a TP. Or Parse-Agr then there’s a TP. Or Parse-Agr beats out *F, and then there’s an beats out *F, and then there’s an AgrP. Or both Parse-T and Parse-Agr AgrP. Or both Parse-T and Parse-Agr beat out *Fbeat out *F22, and so there’s both a , and so there’s both a TP and an AgrP.TP and an AgrP.

But what does But what does sometimessometimes mean? mean?

Page 10: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Floating constraintsFloating constraints

The innovation in Legendre et al. The innovation in Legendre et al. (2000) that gets us off the ground is the (2000) that gets us off the ground is the idea that as kids re-rank constraints, idea that as kids re-rank constraints, the the positionposition of the constraint in the of the constraint in the hierarchy can get somewhat fuzzy, such hierarchy can get somewhat fuzzy, such that two positions can that two positions can overlapoverlap..

*F*F

Parse-TParse-T

Page 11: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Floating constraintsFloating constraints

*F*F

Parse-TParse-T

When the kid evaluates a form in When the kid evaluates a form in the constraint system, the position the constraint system, the position of Parse-T is fixed somewhere in of Parse-T is fixed somewhere in the range—and winds up the range—and winds up sometimes outranking, and sometimes outranking, and sometimes outranked by, *F.sometimes outranked by, *F.

Page 12: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Floating constraintsFloating constraints

*F*F

Parse-TParse-T

(Under certain assumptions) this (Under certain assumptions) this predicts that we would see TP in predicts that we would see TP in the structure 50% of the time, and the structure 50% of the time, and see structures without TP the see structures without TP the other 50% of the time.other 50% of the time.

Page 13: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

French kid dataFrench kid data

Looked at 3 French kids from CHILDESLooked at 3 French kids from CHILDES Broke development into stages based on a Broke development into stages based on a

modified MLU-type measure based on how modified MLU-type measure based on how long most of their utterances were (2 words, long most of their utterances were (2 words, more than 2 words) and how many of the more than 2 words) and how many of the utterances contain verbs.utterances contain verbs.

Looked at tense and agreement in each of the Looked at tense and agreement in each of the three stages represented in the data.three stages represented in the data.

Page 14: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

French kid dataFrench kid data

Kids start out using 3sg agreement Kids start out using 3sg agreement and present tense for practically and present tense for practically everything (correct or not).everything (correct or not).

We took this to be a “default”We took this to be a “default” (No agreement? Pronounce it as 3sg. (No agreement? Pronounce it as 3sg.

No tense? pronounce it as present. No tense? pronounce it as present. Neither? Pronounce it as an infinitive.).Neither? Pronounce it as an infinitive.).

Page 15: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

French kid dataFrench kid data

This means if a kid uses 3sg or This means if a kid uses 3sg or present tense, we can’t tell if they present tense, we can’t tell if they are are reallyreally using 3sg (they using 3sg (they mightmight be) be) or if they are not using agreement at or if they are not using agreement at all and just pronouncing the default.all and just pronouncing the default.

So, we looked at non-present tense So, we looked at non-present tense forms and non-3sg forms only to forms and non-3sg forms only to avoid the question of the defaults.avoid the question of the defaults.

Page 16: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

French kids dataFrench kids data

We found that tense and agreement We found that tense and agreement develop differently—specifically, in develop differently—specifically, in the first stage we looked at, kids the first stage we looked at, kids were using tense fine, but then in were using tense fine, but then in the next stage, they got the next stage, they got worseworse as the as the agreement improved.agreement improved.

Middle stage: looks likeMiddle stage: looks likecompetitioncompetition between T between Tand Agr for a single node.and Agr for a single node.

Page 17: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

A detail about countingA detail about counting We counted non-3sg and non-present verbs.We counted non-3sg and non-present verbs. In order to see how close kids’ utterances were In order to see how close kids’ utterances were

to adult’s utterances, we need to know how often to adult’s utterances, we need to know how often adultsadults use non-3sg and non-present, and then see use non-3sg and non-present, and then see how close the kids are to matching that level.how close the kids are to matching that level.

So, adults use non-present tense around 31% of So, adults use non-present tense around 31% of the time—so when a kid uses 31% non-present the time—so when a kid uses 31% non-present tense, we take that to be “100% success”tense, we take that to be “100% success”

In the last stage we looked at, kids were basically In the last stage we looked at, kids were basically right at the “100% success” level for both tense right at the “100% success” level for both tense and agreement.and agreement.

Page 18: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Proportion of non-Proportion of non-present and non-3sg present and non-3sg

verbsverbs

0%

5%

10%

15%

20%

25%

30%

35%

40%

3b 4b 4c

non-presentnon-3sgadult non-presadult non-3sg

Page 19: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Proportion of non-finite Proportion of non-finite root formsroot forms

0%

5%

10%

15%

20%

25%

30%

35%

3b 4b 4c

NRFs

Page 20: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

A model to predict the A model to predict the percentagespercentages

Stage 3b (first stage)Stage 3b (first stage) no agreementno agreement about 1/3 NRFs, 2/3 tensed formsabout 1/3 NRFs, 2/3 tensed forms

*F*F22 *F*FParseTParseT

ParseAParseA

Page 21: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

A model to predict the A model to predict the percentagespercentages

Stage 4b (second stage)Stage 4b (second stage) non-3sg agreement and non-present non-3sg agreement and non-present

tense each about 15% (=about 40% tense each about 15% (=about 40% agreeing, 50% tensed)agreeing, 50% tensed)

about 20% NRFsabout 20% NRFs

*F*F22 *F*FParseTParseTParseAParseA

Page 22: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

A model to predict the A model to predict the percentagespercentages

Stage 4c (third stage)Stage 4c (third stage) everything appears to have tense everything appears to have tense

and agreement (adult-like levels)and agreement (adult-like levels)

*F*F22 *F*FParseTParseTParseAParseA

Page 23: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Predicted vs. observed—Predicted vs. observed—tensetense

0%

5%

10%

15%

20%

25%

30%

35%

40%

3b 4b 4c

non-presentpredicted non-pres

Page 24: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Predicted vs. observed—Predicted vs. observed—agr’tagr’t

0%

5%

10%

15%

20%

25%

30%

35%

40%

3b 4b 4c

non-3sgpredicted non-3sg

Page 25: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Predicted vs. observed—Predicted vs. observed—NRFsNRFs

0%

5%

10%

15%

20%

25%

30%

35%

3b 4b 4c

NRFspredicted NRFs

Page 26: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Various things Various things (homework)(homework)

Is the OT model just proposed a Is the OT model just proposed a structure-building or full structure-building or full competence model?competence model?

How does the OT model fit in the How does the OT model fit in the overall big picture with the ATOM overall big picture with the ATOM model?model?

Page 27: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Various things Various things (homework)(homework)

For French, we assumed that NRFs For French, we assumed that NRFs appear when appear when both both TP TP and and AgrP are AgrP are missing. Yet, Schütze & Wexler 1996 missing. Yet, Schütze & Wexler 1996 claimed the root infinitives appeared claimed the root infinitives appeared with with eithereither TP TP oror AgrP were missing. AgrP were missing.

Which one is it?Which one is it?

Page 28: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

French v. EnglishFrench v. English

English: T+Agr is pronounced likeEnglish: T+Agr is pronounced like //ss/ if we have features [3, sg, present]/ if we have features [3, sg, present] //eded/ if we have the feature [past]/ if we have the feature [past] //ØØ/ otherwise/ otherwise

French: T+Agr is pronounced like:French: T+Agr is pronounced like: danserdanser NRFNRF a danséa dansé (3sg) past(3sg) past je danseje danse 1sg (present)1sg (present) j’ai danséj’ai dansé 1sg past1sg past

Page 29: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics
Page 30: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

What we’re doingWhat we’re doing The driver who my neighbor who I trust The driver who my neighbor who I trust

suggested took me to the airport.suggested took me to the airport. The driver who my neighbor who my boss The driver who my neighbor who my boss

trusts suggested took me to the airport.trusts suggested took me to the airport.

Overarching hypothesis:Overarching hypothesis: Sentence Sentence difficulty has to do with holding onto difficulty has to do with holding onto several unsatisfied dependencies. Longer several unsatisfied dependencies. Longer ones are harder to hold.ones are harder to hold.

Question:Question: What measures length? What measures length? Hypothesis:Hypothesis: New referents. New referents.

Page 31: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

How do we see if that’s How do we see if that’s right?right?

Center-embedded sentences are the most Center-embedded sentences are the most taxing, several started dependencies, taxing, several started dependencies, center-most element triple-counted.center-most element triple-counted.

The driver whoThe driver who my neighbor whomy neighbor who II trust … trust …

That’s the most sensitive point, seems to That’s the most sensitive point, seems to be near critical point of processability.be near critical point of processability.

Page 32: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

ExperimentingExperimenting

Does it matter whether we have a known Does it matter whether we have a known referent (referent (II, , youyou) or a new referent () or a new referent (my my neighborneighbor)?)?

To know for sure, we try holding To know for sure, we try holding everything constant except the most everything constant except the most embedded subject and see if there are embedded subject and see if there are differences (which can then be attributed differences (which can then be attributed to the only thing that’s different, the to the only thing that’s different, the properties of the most embedded subject).properties of the most embedded subject).

Page 33: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Building the itemsBuilding the items

The driver who my neighbor who The driver who my neighbor who II trust suggested took me to the airport.trust suggested took me to the airport.

The driver who my neighbor who The driver who my neighbor who John John trusts suggested took me to the trusts suggested took me to the airport.airport.

The driver who my neighbor who The driver who my neighbor who the the housekeeper housekeeper trusts suggested took me trusts suggested took me to the airport.to the airport.

The driver who my neighbor who The driver who my neighbor who they they trust suggested took me to the airport.trust suggested took me to the airport.

Page 34: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Planning the experimentPlanning the experiment Each set of four sentences constitutes a Each set of four sentences constitutes a

token settoken set (a.k.a. (a.k.a. itemitem)) Each item are four Each item are four conditionsconditions (1/2 pronoun, (1/2 pronoun,

name, definite description, 3 pronoun).name, definite description, 3 pronoun). Counterbalancing rules:Counterbalancing rules:

Each subject will judge no more than one Each subject will judge no more than one sentence from each token set.sentence from each token set.

Each subject will judge all conditions and will Each subject will judge all conditions and will see equal numbers of sentences from each see equal numbers of sentences from each conditioncondition

Every sentence in every token set will be judged Every sentence in every token set will be judged by some subject.by some subject.

Page 35: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Trial listsTrial lists

We have four conditions, so we need:We have four conditions, so we need: Four different “scripts” (versions of the Four different “scripts” (versions of the

lists)lists) Some number of fourples of token sets.Some number of fourples of token sets.

E.g., items 1-4, each with conds a-dE.g., items 1-4, each with conds a-d Subj W: 1a, 2b, 3c, 4dSubj W: 1a, 2b, 3c, 4d (script 1)(script 1) Subj X: 1b, 2c, 3d, 4aSubj X: 1b, 2c, 3d, 4a (script 2)(script 2) Subj Y: 1c, 2d, 3a, 4bSubj Y: 1c, 2d, 3a, 4b (script 3)(script 3) Subj Z: 1d, 2a, 3b, 4cSubj Z: 1d, 2a, 3b, 4c (script 4)(script 4)

Page 36: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Our experimentOur experiment We will have 20 items (picked from the ones We will have 20 items (picked from the ones

you submitted) and 20 fillers.you submitted) and 20 fillers. (Note: That’s on the small side for a real (Note: That’s on the small side for a real

experiment)experiment)

Next steps:Next steps: Create the lists of test sentences for the four Create the lists of test sentences for the four

different scripts.different scripts. Spec out and pseudocode our experimentSpec out and pseudocode our experiment Investigate PsyScriptInvestigate PsyScript Run the experimentRun the experiment Deal with the dataDeal with the data

Page 37: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Creating the scriptsCreating the scripts

Our sentences are made of very Our sentences are made of very predictable components:predictable components: The X who/that the Y who/that Z VP1 The X who/that the Y who/that Z VP1

VP2 VP3VP2 VP3 The only thing that changes across The only thing that changes across

conditions is Z, while the rest conditions is Z, while the rest changes across token sets.changes across token sets.

We can use Excel to build these from We can use Excel to build these from their pieces, to avoid unnecessary their pieces, to avoid unnecessary errors.errors.

Page 38: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

WorksheetsWorksheets ComponentsComponents

Subj1Subj1 Rel1Rel1 Subj2Subj2 Rel2Rel2 Subj3aSubj3a Subj3bSubj3b Subj3cSubj3c VP3VP3 VP2VP2 VP1VP1 AnswerAnswer QuestionQuestion

FillersFillers QuestionQuestion AnswerAnswer Regions…Regions…

The way I’ve set it The way I’ve set it up, everything up, everything needs to be exactly needs to be exactly 8 regions long 8 regions long (even the fillers)(even the fillers)

Page 39: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

WorksheetsWorksheets

ConstructedConstructed Computes item Computes item

(token group) and (token group) and condition based on condition based on row number, comes row number, comes up with a code like up with a code like I5V2 (fifth token I5V2 (fifth token group, version 2). group, version 2). Builds the sentence Builds the sentence region by region region by region based on the based on the condition number.condition number.

TablesTables Keeps track of what Keeps track of what

will be on each script.will be on each script. Scripts are divided Scripts are divided

into “blocks”, and into “blocks”, and each block has one of each block has one of each condition and each condition and four fillers, four fillers, randomized.randomized.

Sort column is Sort column is 2*block plus a 2*block plus a random number (to random number (to order the blocks, but order the blocks, but randomly within)randomly within)

Page 40: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

WorksheetsWorksheets ScriptScript

The master script sheetThe master script sheet This generates a script This generates a script

based on the columns based on the columns you put into I1 and J1. you put into I1 and J1. (The column refer to (The column refer to the the tables tables sheet, where sheet, where the item and condition the item and condition numbers will be found)numbers will be found)

B and C for script 1B and C for script 1 D and E for script 2D and E for script 2 F and G for script 3F and G for script 3 H and I for script 4H and I for script 4

Script a, … script dScript a, … script d Actual scripts.Actual scripts. Select the part of Select the part of scriptscript

sheet that has data sheet that has data (A1:O41) and copy.(A1:O41) and copy.

Go to Go to script a script a sheetsheet Paste specialPaste special… and choose … and choose

ValueValue (so we don’t copy (so we don’t copy formulas, only results).formulas, only results).

Delete column B-D (item, Delete column B-D (item, cond, row), select rows 2-cond, row), select rows 2-41, hit 41, hit sortsort button, delete button, delete column A (sort), and row 1 column A (sort), and row 1 (labels)(labels)

Save as tab-delimited text.Save as tab-delimited text.

Page 41: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

The scripts are readyThe scripts are ready

So, we have the data that we’re So, we have the data that we’re going to use.going to use.

The next thing is to figure out how The next thing is to figure out how we’re going to test these.we’re going to test these.

The goal is to test reading time on The goal is to test reading time on each region of the sentence by each region of the sentence by presenting the sentence region by presenting the sentence region by region.region.

Page 42: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Thinking through the Thinking through the experimentexperiment

What do we want to have happen?What do we want to have happen? Display some instructionsDisplay some instructions Do some practice trialsDo some practice trials Display “practice is over” messageDisplay “practice is over” message Do some real trialsDo some real trials Display “thanks!”Display “thanks!”

The trials:The trials: Show fully obscured sentence, wait for a keyShow fully obscured sentence, wait for a key Reveal next word, wait for a key, until doneReveal next word, wait for a key, until done Ask question, wait for responseAsk question, wait for response Give sound feedback about correctnessGive sound feedback about correctness

Page 43: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

PsyScriptPsyScript

To do this, we’ll use PsyScript, an To do this, we’ll use PsyScript, an environment for creating psychology environment for creating psychology experiments on the Mac.experiments on the Mac.

(It’s basically the only freely available (It’s basically the only freely available software of this type that has promise software of this type that has promise for working in the future – if for working in the future – if PsyScope had not become PsyScope had not become commercial as E-Prime, we’d be commercial as E-Prime, we’d be learning that instead).learning that instead).

Page 44: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

AppleScriptAppleScript The underlying machinery behind The underlying machinery behind

PsyScript is something called PsyScript is something called AppleScriptAppleScript.. This has been part of the Mac OS for about the This has been part of the Mac OS for about the

past 10 years, although it is gaining power and past 10 years, although it is gaining power and popularity recently.popularity recently.

AppleScript is a means by which you can AppleScript is a means by which you can tell other programs what to do.tell other programs what to do. For example, tell Internet Explorer to go to a For example, tell Internet Explorer to go to a

particular web page, tell Word to create a new particular web page, tell Word to create a new document and type the date, …document and type the date, …

Until you have an actual need for this, it Until you have an actual need for this, it doesn’t seem very exciting…doesn’t seem very exciting…

Page 45: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

AppleScriptAppleScript

AppleScript is a sophisticated high-level AppleScript is a sophisticated high-level programming language designed to be programming language designed to be human readable (and kind of human human readable (and kind of human writable). It’s supposed to look a lot like writable). It’s supposed to look a lot like English.English.

PsyScript itself is an application that can be PsyScript itself is an application that can be bossed around by AppleScript, and has the bossed around by AppleScript, and has the features that are useful in psycholinguistic features that are useful in psycholinguistic experiments, such as timing, drawing, experiments, such as timing, drawing, input, data recording functions.input, data recording functions.

Page 46: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Getting startedGetting started

To write (and use) AppleScript, we To write (and use) AppleScript, we use use Script EditorScript Editor..

Easiest way to do this: Find the Easiest way to do this: Find the end end experiment experiment script and double-click on script and double-click on it.it.tell application “PsyScript”tell application “PsyScript”

end experimentend experiment

end tellend tell

Page 47: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Note about PsyScriptNote about PsyScript

PsyScript runs faster from the Script EditorPsyScript runs faster from the Script Editor If you run PsyScript from the Script Editor you If you run PsyScript from the Script Editor you

have to manually tell it where your script is.have to manually tell it where your script is. To do this, find the line that says To do this, find the line that says tell fileHelper to tell fileHelper to

setContainer setContainer and change the thing in parentheses and change the thing in parentheses to what you see when you Command-click on the to what you see when you Command-click on the name of the script in the title bar of the Script name of the script in the title bar of the Script Editor Window, bottom to top, each separated by : Editor Window, bottom to top, each separated by : and not including the actual name of the script. and not including the actual name of the script. E.g.,E.g.,

setContainer(“Station 5:Desktop Folder:PsyScript:”)setContainer(“Station 5:Desktop Folder:PsyScript:”)

Page 48: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

MovingwindowMovingwindow I wrote a script called I wrote a script called movingwindow movingwindow to to

do what we’re going to do today.do what we’re going to do today. The stimuli and instructions files are in a The stimuli and instructions files are in a

folder called “resources” in the same folder as folder called “resources” in the same folder as the script is. The names of these files are set the script is. The names of these files are set at the top of the script, in mine, they are:at the top of the script, in mine, they are:

Mwstimuli.txt : sentence list as exported from Excel Mwstimuli.txt : sentence list as exported from Excel (tab-delimited text, exporting e.g., (tab-delimited text, exporting e.g., script ascript a))

Mwpractice.txt : sentence list for the practice itemsMwpractice.txt : sentence list for the practice items Mwinstruc.txt : initial instructionsMwinstruc.txt : initial instructions Mwready.txt : post-practice instructionsMwready.txt : post-practice instructions Mwthanks.txt : end of experiment debriefing.Mwthanks.txt : end of experiment debriefing.

Results are stored in “results” folder.Results are stored in “results” folder.

Page 49: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics

Sentence listsSentence lists

To generate the sentence lists in the right To generate the sentence lists in the right format for format for movingwindowmovingwindow, go to one of the , go to one of the script a-d pages, do Save As… from Excel, script a-d pages, do Save As… from Excel, and choose tab-delimited text.and choose tab-delimited text. Columns should be code, question, answer, Columns should be code, question, answer,

sentence (in eight columns)sentence (in eight columns) The end results will come out in a file that The end results will come out in a file that

you can load back into Excel (a tab-you can load back into Excel (a tab-delimited file):delimited file): Columns are: code, region number, time for Columns are: code, region number, time for

region, correct answer 1/0, text of regionregion, correct answer 1/0, text of region

Page 50: Week 6. Optimality Theory and acquisition. GRS LX 865 Topics in Linguistics