## Orthography

Orthography.php : 24

Utility functions for checking the orthography of arbitrary text strings.

> An orthography is a set of conventions for writing a language. It includes norms of spelling, hyphenation, capitalization, word breaks, emphasis, and punctuation. Source: https://en.wikipedia.org/wiki/Orthography

##### Tags

since
  1.0.0

### Table of Contents

TERMINAL_POINTS = '.?!'
  Characters which are considered terminal points for a sentence.
isFirstCharCapitalized() : bool
  Check if the first character of an arbitrary text string is a capital letter.
isFirstCharLowercase() : bool
  Check if the first character of an arbitrary text string is a lowercase letter.
isLastCharPunctuation() : bool
  Check if the last character of an arbitrary text string is a valid punctuation character.

### Constants

#### TERMINAL_POINTS

Orthography.php : 36

Characters which are considered terminal points for a sentence.

`public string TERMINAL_POINTS = '.?!'`

##### Tags

link
  https://www.thepunctuationguide.com/terminal-points.html

  Punctuation guide on terminal points.

since
  1.0.0

### Methods

#### isFirstCharCapitalized()

Orthography.php : 57

Check if the first character of an arbitrary text string is a capital letter.

`public static isFirstCharCapitalized(string $string) : bool`

Letter characters which do not have a concept of lower/uppercase will be accepted as correctly capitalized.

##### Parameters

$string : string

  The text string to examine. This can be the contents of a text string token, but also, for instance, a comment text. Potential text delimiter quotes should be stripped off a text string before passing it to this method. Also see: {@see \PHPCSUtils\Utils\TextStrings::stripQuotes()}.

##### Tags

since
  1.0.0

##### Return values

bool —

`TRUE` when the first character is a capital letter or a letter which doesn't have a concept of capitalization. `FALSE` otherwise, including for non-letter characters.

#### isFirstCharLowercase()

Orthography.php : 79

Check if the first character of an arbitrary text string is a lowercase letter.

`public static isFirstCharLowercase(string $string) : bool`

##### Parameters

$string : string

  The text string to examine. This can be the contents of a text string token, but also, for instance, a comment text. Potential text delimiter quotes should be stripped off a text string before passing it to this method. Also see: {@see \PHPCSUtils\Utils\TextStrings::stripQuotes()}.

##### Tags

since
  1.0.0

##### Return values

bool —

`TRUE` when the first character is a lowercase letter. `FALSE` otherwise, including for letters which don't have a concept of capitalization and for non-letter characters.

#### isLastCharPunctuation()

Orthography.php : 103

Check if the last character of an arbitrary text string is a valid punctuation character.

`public static isLastCharPunctuation(string $string[, string $allowedChars = self::TERMINAL_POINTS ]) : bool`

##### Parameters

$string : string

  The text string to examine. This can be the contents of a text string token, but also, for instance, a comment text. Potential text delimiter quotes should be stripped off a text string before passing it to this method. Also see: {@see \PHPCSUtils\Utils\TextStrings::stripQuotes()}.

$allowedChars : string = self::TERMINAL_POINTS

  Characters which are considered valid punctuation to end the text string. Defaults to `'.?!'`, i.e. a full stop, question mark or exclamation mark.

##### Tags

since
  1.0.0

##### Return values

bool —

## Search results