# Noun Phrases

## Overview

A **noun phrase** is a group of words centered around a noun. It consists of:

* **Head:** The main noun representing the fact.
* **Modifiers:** Optional words providing additional context to the head noun.

The `NounPhase` class can be used to represent a noun phrase.

## Modifiers

A **modifier** is an optional part of a noun phrase that provides additional detail about the **head** noun. It appears before the head and refines the fact being referenced.

#### Example: Creating a Noun Phrase with Modifiers

```python
# Create a noun phrase with a head and modifiers
np = NounPhrase("dog", ["big", "white"])
print(np)  # Outputs: big white dog
```

In this example:

* **Head:** "dog"
* **Modifiers:** "big", "white"

The resulting noun phrase is "big white dog".

***

## Parameters as Noun Phrases

Parameters can be defined as `NounPhrase` types to tell the system to use a fact's **name** instead of its **value**.

### Example: Defining a Parameter as a Noun Phrase

Consider the following procedure method definition, where the `city` parameter is defined as a `NounPhrase`:

```python
@procedure("to get the (current temperature) at a city")
def current_temperature(
  self, city: NounPhrase, unit: Optional[NounPhrase] = NounPhrase("metric")
) -> float:
```

This procedure can be called in an automation where **London** is a fact with a specific value:

```
London is "windy"
get the current temperature at London
```

In this example, when **London** is specified as the city parameter, the system uses the name of the fact (London) instead of its value ("windy").


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kognitos.com/legacy/legacy-experience/books/custom-books/api-reference/noun-phrases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
