An Algorithm for Detecting Sentence Validity
DOI:
https://doi.org/10.46328/ijonest.208Keywords:
Algorithm, Language processing, Pregroup grammarAbstract
In this paper, we introduce an algorithm for determining the grammatical validity of a sentence. We take a similar approach as in (Preller, 2007) and (Lambek, Type Grammar Revisited, 1999) (Lambek, From word to sentence: a computational algebraic approach to grammar, 2008) by encoding the English words based on word type which we call components. A sentence can be described both algebraically and geometrically. Our algorithm generates the geometric portion called underlinks from the generalized reductions of the algebraic portion. Underlinks uniquely determine the reduction of the components leading to the empty string. This is the mathematical basis for determining if a sentence is valid. We also provide a proof for the algorithm’s time complexity of O(n2) along with a Python implementation. This paper is part of a bigger project based on (Coecke, Mehrnoosh, & Clarky, 2010) where we explore the combination of a sentence’s grammar and meaning. This is done by combining two compact closed categories; pregroups represent the grammar of a sentence, and finite dimensional vector spaces describe the meaning of a sentence. Together one compact closed category is created, representing both aspects of the sentence.References
Coecke, B., Mehrnoosh, S., & Clarky, S. (2010). Mathematical Foundations for a Compositional Distributional Model of Meaning. CoRR.
DeGennaro, C. (2023). GitHub code. https://github.com/ItBeCharlie/SentenceValidity.
Lambek, J. (2008). From word to sentence: a computational algebraic approach to grammar.
Preller, A. (2007). Toward Discourse Representation via Pregroup Grammars. Journal of Logic, Langauge, and Information, 173-194.
Downloads
Additional Files
Published
Issue
Section
License
Articles may be used for research, teaching, and private study purposes. Authors alone are responsible for the contents of their articles. The journal owns the copyright of the articles. The publisher shall not be liable for any loss, actions, claims, proceedings, demand, or costs or damages whatsoever or howsoever caused arising directly or indirectly in connection with or arising out of the use of the research material.
The author(s) of a manuscript agree that if the manuscript is accepted for publication in the International Journal on Engineering, Science and Technology (IJonEST), the published article will be copyrighted using a Creative Commons “Attribution 4.0 International” license. This license allows others to freely copy, distribute, and display the copyrighted work, and derivative works based upon it, under certain specified conditions.
Authors are responsible for obtaining written permission to include any images or artwork for which they do not hold copyright in their articles, or to adapt any such images or artwork for inclusion in their articles. The copyright holder must be made explicitly aware that the image(s) or artwork will be made freely available online as part of the article under a Creative Commons “Attribution 4.0 International” license.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.