Skip to main content

An Algorithm for Detecting Sentence Validity

  • Conference paper
  • First Online:
Intelligent Computing (SAI 2024)

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 1016))

Included in the following conference series:

  • 302 Accesses

Abstract

In this paper, we introduce an algorithm for determining the grammatical validity of a sentence in polynomial time. The algorithm works 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 \(\mathcal {O}(n^2)\) along with a Python implementation. This paper is part of a bigger project 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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Preller, A.: Toward discourse representation via pregroup grammars. J. Logic Lang. Inf. 16(2), 173–194 (2007)

    Google Scholar 

  2. Coecke, B., Sadrzadeh, M., Clarky, S.: Mathematical foundations for a compositional distributional model of meaning. CoRR arXiv:1003.4394 (2010)

  3. Lambek, J.: From word to sentence: a computational algebraic approach to grammar (2008)

    Google Scholar 

  4. GitHub for the code. https://github.com/ItBeCharlie/SentenceValidity

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ashley Suchy .

Editor information

Editors and Affiliations

Appendix A: Code

Appendix A: Code

figure c
figure d
figure e

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

DeGennaro, C., McDonald, A., Suchy, A. (2024). An Algorithm for Detecting Sentence Validity. In: Arai, K. (eds) Intelligent Computing. SAI 2024. Lecture Notes in Networks and Systems, vol 1016. Springer, Cham. https://doi.org/10.1007/978-3-031-62281-6_40

Download citation

Publish with us

Policies and ethics