dependency

Назначение

Функция позволяет определить синтаксические отношения между аргументами.

Синтаксис

dependency([deptype], [syntrel1], …​ [syntreln-1], term1 …​ termn)

Аргументы

Функция принимает несколько аргументов.

Первый необязательный параметр описывает структуру синтаксических отношений (зависимостей).

Значение параметра deptype

Структура зависимостей

bidirectional/bidir

term1 ↔ term2 ↔ term3

forward

term1 → term2 → term3

tree

term1 → term2
↓ term3

По умолчанию deptype устанавливается в bidir.

Следующий необязательный параметр syntrel позволяет дополнительно указывать тип синтаксического отношения между аргументами.

Типы синтаксических отношений

Синтаксическое отношение

Значения параметра_syntrel_

Описание

subject

subject, sbj

Отношение сказуемое→подлежащее:

  • She will leave tomorrow.

  • Danny speaks Spanish fluently.

adverbial

adverbial, adv

Отношение сказуемое→обстоятельство:

  • She will leave tomorrow.

  • Danny speaks Spanish fluently.

object

object, obj

Отношение сказуемое→дополнение:

  • I don’t know his phone number.

  • Don’t forget to call me.

modifier

modifier, mod

Отношение подлежащее→определение, дополнение→определение:

  • Political news influence currency markets.

agent

agent

Отношение сказуемое→агент:

  • The contract is signed by vice-president.

Аргументы используются следующим образом:

Запрос

Структура зависимостей

Пример

dependency(forward, obj, mod, term1, term2, term3)

term1 → (obj) term2 → (mod) term3

sign important tender

correct previous mistakes

dependency(tree, mod, mod, term1, term2, term3)

term2 ← (mod) term1 → (mod) term3

definitive agreement on price,

American business magnate

Возвращаемое значение

Документы, соответствующие запросу.

Примеры

Возьмем таблицу данных с 4-мя документами:

#документа

Текст

0

The company’s board cancelled a previously announced agreement.

1

Company’s board expects to announce a definitive agreement on the sale this week.

2

The agreement was announced this week.

3

Company announced the termination of the agreement.

В следующей таблице представлены возвращаемые значения (см. колонку Результат) для примеров запроса (см. Запрос):

Запрос

Структура зависимостей

Результат

#документа

Позиции

dependency(announce, agreement)

announce→agreement or agreement→announce

0

The company’s board cancelled a previously announced agreement.

1

Company’s board expects to announce a definitive agreement on the sale this week.

2

The agreement was announced this week.

dependency(obj, announce, agreement)

announce→(obj)agreement or agreement→(obj)announce

1

Company’s board expects to announce a definitive agreement on the sale this week.

dependency(sbj, announce, agreement)

announce→(sbj)agreement or agreement→(sbj)announce

2

The agreement was announced this week.

dependency(tree, sbj, obj, announce, board, agreement)

announce → (sbj) board

(obj) agreement

1

Company’s board expects to announce a definitive agreement on the sale this week.

dependency(tree, sbj, obj, announce, company, agreement)

announce → (sbj) company

(obj) agreement

--------

--------

dependency(sentpart(object), sentpart(predicate))

object → predicate or predicate → object

0

The company’s board cancelled a previously announced agreement.

1

Company’s board expects to announce a definitive agreement on the sale this week.

2

Company announced the termination of the agreement.

dependency(forward, sentpart(object), sentpart(predicate))

object → predicate

--------

--------

dependency(forward, sentpart(predicate), sentpart(object))

predicate → object

0

The company’s board cancelled a previously announced agreement.

1

Company’s board expects to announce a definitive agreement on the sale this week.

3

Company announced the termination of the agreement.