# Extraction Functions

### Table of Contents

* [extractNumberPhrases](#extractnumberphrases)
* [extractNumberContext](#extractnumbercontext)

### extractNumberPhrases

**Syntax**

```javascript
extractNumberPhrases(text)
```

**Description**

Extracts all Arabic number phrases from the input text. The input should be a string containing Arabic text.

**Parameters**

* `text` (string) - The input Arabic text to extract number phrases from.

**Returns**

* `array` - An array of strings containing all Arabic number phrases extracted from the input text.

**Example**

```javascript
const text = "أنا أملك اثنين سيارات وثلاثة منازل";
const phrases = extractNumberPhrases(text);
console.log(phrases); // [ 'اثنين', 'وثلاثة' ]
```

### extractNumberContext

**Syntax**

```javascript
extractNumberContext(text)
```

**Description**

Extracts all Arabic number phrases from the input text, along with their surrounding context (the preceding and following words). The input should be a string containing Arabic text.

**Parameters**

* `text` (string) - The input Arabic text to extract number phrases and their context from.

**Returns**

* `array` - An array of arrays containing the preceding word, the number phrase, and the following word for each extracted number phrase.

**Example**

```javascript
const text = "أنا أملك اثنين سيارات وثلاثة منازل";
const phrases = extractNumberContext(text);
console.log(phrases); // [[ 'أملك', 'اثنين', 'سيارات' ], [ 'سيارات', 'وثلاثة', 'منازل' ]]
```
