Did I find the right examples for you? yes no

# other_functions.number

All Samples(17)  |  Call(17)  |  Derive(0)  |  Import(0)
```Function return 1 if the word is a number and 2 if it is a adjective-number
Input=word          Output=flag(0 if no number or 1 if number or 2 adjective-number)
```

```        def number(word):
"""
Function return 1 if the word is a number and 2 if it is a adjective-number
Input=word          Output=flag(0 if no number or 1 if number or 2 adjective-number)
"""

for n in ResourcePool().numbers:
if word.startswith(n[1]):
return 1

if word.startswith(n[0]):
if word.endswith('th'):
return 2
else:
if word in ResourcePool().special_nouns:
return 0
return 1
return 0
```

```
while i < len(sentence):
if sentence[i] == 'and' and other_functions.number(sentence[i - 1]) == 1 and other_functions.number(
sentence[i + 1]) == 1:
sentence = sentence[:i] + sentence[i + 1:]
```
```    while i < len(sentence):
#There is a number
if other_functions.number(sentence[i]) == 1:
begin_pos = i

while i < len(sentence) and other_functions.number(sentence[i]) == 1:
```
```
#We have to concatenate the last number if it is superlative
if i < len(sentence) and other_functions.number(sentence[i]) == 2:
end_pos += 1
if i < len(sentence) and sentence[i] in ResourcePool().adjective_numbers:
```

```
#For adjectives created from numbers
if word.endswith('th') and other_functions.number(word) == 2:
return True

```
```
#For adjectives created from numbers
if sentence[word_pos].endswith('th') and other_functions.number(sentence[word_pos]) == 2:
return 1 + adjective_pos(sentence, word_pos + 1)

```
```
#If there is a number, it will be the same with determinant
if other_functions.number(sentence[begin_pos]) == 1:
end_pos += adjective_pos(sentence, begin_pos + 1)
return sentence[begin_pos: end_pos + begin_pos]
```
```
#If there is a number, it will be the same with determinant
if other_functions.number(x) == 1:
nb_position += adjective_pos(sentence, sentence.index(x) + 1)
return sentence[sentence.index(x): sentence.index(x) + nb_position]
```
```
#It is a number the word is not a plural
if other_functions.number(sentence[position]) == 1:
return -1

```

```