Tradutor em Life

15
Tradutor em Life Leonardo Lemos Paulo Borges Reginaldo Valadares

description

Tradutor em Life. Leonardo Lemos Paulo Borges Reginaldo Valadares. Interpretador. interp(phraseUk => PhraseUk, interpUk=>constUk(syntrUk => SyntrUk, semr => Semr)) :- toDown(PhraseUk, PhraseUkm), tokenizer(PhraseUkm, WordlistUk), - PowerPoint PPT Presentation

Transcript of Tradutor em Life

Page 1: Tradutor em Life

Tradutor em Life

Leonardo Lemos

Paulo Borges

Reginaldo Valadares

Page 2: Tradutor em Life

Interpretador

interp(phraseUk => PhraseUk,

interpUk=>constUk(syntrUk => SyntrUk, semr => Semr)) :-

toDown(PhraseUk, PhraseUkm),

tokenizer(PhraseUkm, WordlistUk),

constUk(syntrUk => SyntrUk,

semr => Semr,

in_dcg => WordlistUk,

out_dcg => []).

Page 3: Tradutor em Life

Discrepâncias sintáticasInglês - Português

• Ordem dos modificadores– “smelly wumpus” = wumpus fedorento

• Interrogativo/Auxiliares– “Do you smell a stench?” = “Você sente um

fedor?”

• Imperativo– “Shoot the wumpus!” = “Atire no wumpus!”

– “He shoots the wumpus” = “Ele atira no wumpus”

Page 4: Tradutor em Life

Discrepâncias de lexicalização Inglês - Português

• Conjugação dos Verbos– Inglês (Presente)

• smell, smells

– Português (Presente)• cheiro, cheiras, cheira, cheiramos, cheirais, cheiram

• Alinhamento– Verbo + Prep. => Verbo (“Go up” = “Suba”)

Page 5: Tradutor em Life

Discrepâncias de lexicalização Inglês - Português

• Ambiguidade– Ser, estar, ficar

• “The gold is (ser) mine” (Posse)

• “The wumpus is (estar) at 1 2” (Localidade)

– a, algum• “Do you smell a (algum) stench?” (Interrogativo)

• “I smell a (um) stench.” (Afirmativo)

Page 6: Tradutor em Life

Arquitetura do Tradutor

translate (X, Z) :- interp(phraseUk => X, interpUk => _I),

transfer(interpUk => _I, interpPt => _P),

gener(interpPt => _P, phrasePt => Z).

Page 7: Tradutor em Life

Regras de transferência sintáticastransfer(interpUk => constUk(syntrUk => syntr(syntcat => vg,

present => yes,

conjug => ConjugUk,

agreeFt => AgreeFtUk,

head => HeadUk)),

interpPt => constPt(syntrPt => syntr(syntcat => vg,

present => yes,

conjug => ConjugUk,

agreeFt => AgreeFtUk,

head => HeadPt))) :-

transfer(interpUk => HeadUk, interpPt => HeadPt).

Page 8: Tradutor em Life

Regras de transferência lexicais (léxico bilíngüe)

transfer(interpUk => constUk(syntrUk => syntr(syntcat => adv,

present => yes,

lex => X)),

interpPt => constPt(syntrPt => syntr(syntcat => adv,

present => yes,

lex => changeAdv(X)))).

changeAdv("left") -> "esquerda".

changeAdv("right") -> "direita".

Page 9: Tradutor em Life

Regras de transferêncialexico-sintática

• Ver Arquivo Life

Page 10: Tradutor em Life

Usar gramáticas de cláusulas definidas para geração

• Gramática Inglês– interp(“the wumpus is dead”,X)?

• X é um psi-term

• Transformação de Inglês para Português utilizando DCG– transf(X,Y)?

• Gramática Português– gener(Y,Z)?

Page 11: Tradutor em Life

Usar gramáticas de cláusulas definidas para geração

• Exemplo Life> constUk(syntrUk => X, in_dcg => ["the"], out_dcg => [])?

*** Yes

X = syntr(lex => "the", num => sing, present => yes, ref => def,

syntcat => article).

--1> constUk(syntrUk => X, in_dcg => Y, out_dcg => [])?

*** Yes

X = syntr(lex => "the", num => sing, present => yes, ref => def,

syntcat => article),

Y = ["the"].

Page 12: Tradutor em Life

Regras estruturais/concordância da sintaxe do português

• Determinantes– Inglês (Não depende do gênero do substantivo)

• the car, the house

– Português (Depende do gênero do substantivo)• o carro, a casa

Page 13: Tradutor em Life

Regras de escolha das palavras de classe fechada do português

constPt (syntrPt=>syntr(syntcat=>article,

present=>yes,

mood=>{declar;imper},

gen=>masc,

ref=>indef,

num=>sing)) --> ["um"]?

constPt (syntrPt=>syntr(syntcat=>article,

present=>yes,

mood=>inter,

gen=>masc,

ref=>indef,

num=>sing)) --> ["algum"]?

Page 14: Tradutor em Life

Regras morfológica do português

• Plural (Verbo)– Inglês

• Só altera a terceira pessoa do singular

– Português• Todas as pessoas podem variar

Page 15: Tradutor em Life

Demo ao vivo