Spanish Present Tense Searcher
This is a program designed to scan a document in .txt format and find all of the sentences which contain a present tense in Spanish. It was developed to speed up sociolinguistic research related to morphology and syntax at the University of Málaga.
How to use it?
- Select the text type. (NORMAL for standard raw text; PRESEEA for PRESEEA codified interviews)
- Upload a file in .txt format
You can try with example.txt included in the GitHub repository, which is just a copy-pasted text from the Spanish Wikipedia article on Sociolinguistics.
How does it work on the inside?
The program works in two stages: First, an HMM tagger trained on the AnCora corpus tags the sentences using the Universal Dependencies PoS tags. It achieves 94.74% overall accuracy and f1 score for the VERB tag of 0.9185. In the second stage, a complex regex pattern (below) is used to separate present tenses from all the other tenses. The sentences determined to contain at least one present tense are then saved and printed.
The regex pattern: [a-záéíóúñA-ZÁÉÍÓÚÑ]+((?<!(ad)|(id)|(and))o|(?<!(ab)|(í)|(ar))as|(?<!(ab)|(í)|(ar))a|(?<!(ab)|(í)|(ár))amos|áis|(?<!(ab)|(í)|(ar))an|[^s]es|[^s]e|[^rs]emos|[^r]éis|[^s]en|imos|ís|y){1}$