VerbNet v0.3.1 VerbNet View Source

This module provides a lookup interface into the VerbNet semantic mapping dataset.

Link to this section Summary

Functions

Return complete raw map of an entire VerbNet class

Return semantic frame from VerbNet that matches the provided primary POS pattern and class member

Return list of semantic frames for VerbNet class, keyed by primary POS pattern

Return list of member maps for VerbNet class, keyed by member name

Return list of thematic role maps for VerbNet class, keyed by role type

Link to this section Functions

Link to this function

class(class_id) View Source
class(class_id :: binary()) :: map()

Return complete raw map of an entire VerbNet class.

On failed lookup, returns :invalid_class.

Link to this function

find_frames(primary, member) View Source
find_frames(primary :: binary(), member :: binary()) :: list()
find_frames(primary :: list(), member :: binary()) :: list()

Return semantic frame from VerbNet that matches the provided primary POS pattern and class member.

On failed lookup, returns an empty list.

Examples

iex> VerbNet.find_frames("NP V NP", "wish")
[%{class_id: "wish-62",
   description: %{descriptionnumber: "8.1", primary: "NP V NP", secondary: "NP",
     xtag: "0.2"}, examples: [["I wished it."]],
   semantics: [{:pred, %{value: "desire"},
     [{:args, %{},
       [{:arg, %{type: "Event", value: "E"}, []},
        {:arg, %{type: "ThemRole", value: "Experiencer"}, []},
        {:arg, %{type: "ThemRole", value: "Stimulus"}, []}]}]}],
   syntax: [{:np, %{value: "Experiencer"}, [{:synrestrs, %{}, []}]},
    {:verb, %{}, []},
    {:np, %{value: "Stimulus"},
     [{:synrestrs, %{},
       [{:synrestr, %{type: "sentential", value: "-"}, []}]}]}]}]

iex> VerbNet.find_frames(["NP", "V", "NP"], "wish")
[%{class_id: "wish-62",
   description: %{descriptionnumber: "8.1", primary: "NP V NP", secondary: "NP",
     xtag: "0.2"}, examples: [["I wished it."]],
   semantics: [{:pred, %{value: "desire"},
     [{:args, %{},
       [{:arg, %{type: "Event", value: "E"}, []},
        {:arg, %{type: "ThemRole", value: "Experiencer"}, []},
        {:arg, %{type: "ThemRole", value: "Stimulus"}, []}]}]}],
   syntax: [{:np, %{value: "Experiencer"}, [{:synrestrs, %{}, []}]},
    {:verb, %{}, []},
    {:np, %{value: "Stimulus"},
     [{:synrestrs, %{},
       [{:synrestr, %{type: "sentential", value: "-"}, []}]}]}]}]

iex> VerbNet.find_frames("NP V NP", "foo")
[]
Link to this function

frames(class_id) View Source
frames(class_id :: binary()) :: list()

Return list of semantic frames for VerbNet class, keyed by primary POS pattern.

On failed lookup, returns :invalid_class.

Examples

iex> VerbNet.frames("wish-62") |> Map.keys()
["NP V NP", "NP V NP ADJ", "NP V NP to be ADJ", "NP V S_INF",
 "NP V for NP S_INF", "NP V that S"]

iex> VerbNet.frames("foo")
:invalid_class
Link to this function

members(class_id) View Source
members(class_id :: binary()) :: map()

Return list of member maps for VerbNet class, keyed by member name.

On failed lookup, returns :invalid_class.

Examples

iex> VerbNet.members("wish-62")
%{"aim" => %{grouping: "aim.02", wn: "aim%2:31:01"},
  "dream" => %{grouping: "dream.01", wn: "dream%2:36:00"},
  "expect" => %{grouping: "expect.01", wn: "expect%2:32:00"},
  "imagine" => %{grouping: "imagine.02", wn: "imagine%2:31:01"},
  "intend" => %{grouping: "intend.01", wn: "intend%2:31:00"},
  "mean" => %{grouping: "mean.02", wn: "mean%2:31:00"},
  "plan" => %{grouping: "plan.01", wn: "plan%2:31:01"},
  "propose" => %{grouping: "propose.02", wn: "propose%2:31:01"},
  "think" => %{grouping: "think.05", wn: "think%2:31:03"},
  "wish" => %{grouping: "wish.02", wn: "wish%2:37:02"},
  "yen" => %{grouping: "", wn: "yen%2:37:00"}}

iex> VerbNet.members("foo")
:invalid_class
Link to this function

roles(class_id) View Source
roles(class_id :: binary()) :: map()

Return list of thematic role maps for VerbNet class, keyed by role type.

On failed lookup, returns :invalid_class.

Examples

iex> VerbNet.roles("wish-62")
%{"Experiencer" => [{:selrestrs, %{logic: "or"},
    [{:selrestr, %{type: "animate", value: "+"}, []},
     {:selrestr, %{type: "organization", value: "+"}, []}]}],
  "Stimulus" => [{:selrestrs, %{}, []}]}

iex> VerbNet.roles("foo")
:invalid_class