Did I find the right examples for you? yes no

# other_functions.recover_end_pos_sub

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)
```Function to find the end position of the subsentence
Input=sentence starts with relative proposal, the subsentence proposal's list
Output=end position of the subsentence
```

```        def recover_end_pos_sub(phrase, propo_sub_list):
"""
Function to find the end position of the subsentence
Input=sentence starts with relative proposal, the subsentence proposal's list
Output=end position of the subsentence
"""

#init
nb_sub = 0
position = 0

#We loop after the first proposal
for y in phrase:

position += 1

#If there is a proposal we increment nb_sub
if y in propo_sub_list:
nb_sub += 1

#If there is a ';' we decrement nb_sub
if y == ';':
nb_sub -= 1
if nb_sub == 0:
#The of the processing is here, when there is no 'sub'
return position

if y == '.' or y == '!' or y == '?':
return position

#Default case
return 0
```

```
if begin_pos_rel != -1:
end_pos_rel = other_functions.recover_end_pos_sub(phrase, ResourcePool().relatives)
#We remove the relative part of the phrase
phrase = phrase[:begin_pos_rel] + phrase[end_pos_rel:]
```
```
if begin_pos_rel != -1:
end_pos_rel = other_functions.recover_end_pos_sub(phrase, ResourcePool().relatives)
#We remove the relative part of the phrase
phrase = phrase[:begin_pos_rel] + phrase[end_pos_rel:]
```
```
#We include the relative's proposal if there are relatives in the subsentence
end_pos = other_functions.recover_end_pos_sub(phrase[begin_pos:],
ResourcePool().subsentences + ResourcePool().relatives)

```
```        #We include the relative's and subsentence's proposal if there are relatives or subsentences in this subsentence
phrase = [phrase[0]] + preprocessing.remerge_sentences(phrase[1:])
end_pos = other_functions.recover_end_pos_sub(phrase[begin_pos:],
['that'] + ResourcePool().subsentences + ResourcePool().relatives)

```
```                begin_pos_rel = analyse_nominal_group.find_relative(object, sentence, i + 1, ResourcePool().relatives)
if begin_pos_rel != -1:
end_pos_rel = other_functions.recover_end_pos_sub(sentence, ResourcePool().relatives)
#We remove the relative part of the sentence
sentence = sentence[:begin_pos_rel] + sentence[end_pos_rel:]
```

```    #We process the relative
begin_pos_rel = analyse_nominal_group.find_relative(nom_gr, phrase, pos_nom_gr, ResourcePool().relatives)
end_pos_rel = other_functions.recover_end_pos_sub(phrase[begin_pos_rel:], ResourcePool().relatives)

#There is a relative
```
```
if phrase[0] in ResourcePool().relatives:
end_pos_rel = other_functions.recover_end_pos_sub(phrase, ResourcePool().relatives)
#We remove the relative part of the phrase
phrase = phrase[end_pos_rel:]
```