Finite Computer-Readable Sequence
A Finite Computer-Readable Sequence is a machine-readable item that is a finite sequence of computer characters.
- AKA: String Item.
- Context:
- It can (often) be represented by a String Data Structure.
- It can range from being an Empty String to being a Non-Empty String (such as a short string or a long string).
- It can be an input to a String Item Operation (such as string length, string item probability).
- It can range from being a Text String, a Molecule String, ..., depending on what each computer character, represents.
- It can range from being a Python String, Java String, ..., depending on the programming language.
- ...
- Example(s):
- a String Literal,
- a Character String.
- a Byte String,
- a tuple of items (string members) from a finite alphabet.
- a Text String, such as:
- a Character String, such as a unicode string,
- a Terminal Word String, such as:
[I] [bought] [a] [real time] [operating system]
or[日文] [章魚] [怎麼] [說]
. - aa Language Character String, (where the alphabet is a character set), such as:
[1 milllllion monkeys typing in hexadecimal.]
- a Linguistic Expression? (if it can be understood by a linguistic agent).
- ...
- an Organic Molecule String, such as a DNA string, protein string.
- a Formal String (if it satisfies a formal language).
- …
- Counter-Example(s):
- a Structured Data Object.
- a Data Stream (is an infinite sequence).
- a Partially Ordered Set.
- See: String Function, String Processing Algorithm, List, String Kernel, Abstract Entity, String Search Algorithm, String-Level Text Error Correction System, Text Encoding-Decoding System, Pattern Recognition Task, Sequence-to-Sequence Network.
References
2020a
- (Wikipedia, 2020a) ⇒ https://en.wikipedia.org/wiki/String_(computer_science) Retrieved:2020-2-23.
- In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is generally considered as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. String may also denote more general arrays or other sequence (or list) data types and structures.
Depending on the programming language and precise data type used, a variable declared to be a string may either cause storage in memory to be statically allocated for a predetermined maximum length or employ dynamic allocation to allow it to hold a variable number of elements.
When a string appears literally in source code, it is known as a string literal or an anonymous string.
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set called an alphabet.
- In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is generally considered as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. String may also denote more general arrays or other sequence (or list) data types and structures.
2020b
- (Wikipedia, 2020b) ⇒ https://en.wikipedia.org/wiki/String_(computer_science)#Literal_strings Retrieved:2020-2-23.
- Sometimes, strings need to be embedded inside a text file that is both human-readable and intended for consumption by a machine. This is needed in, for example, source code of programming languages, or in configuration files. In this case, the NUL character doesn't work well as a terminator since it is normally invisible (non-printable) and is difficult to input via a keyboard. Storing the string length would also be inconvenient as manual computation and tracking of the length is tedious and error-prone.
Two common representations are:
- Surrounded by quotation marks (ASCII 0x22 double quote or ASCII 0x27 single quote), used by most programming languages. To be able to include special characters such as the quotation mark itself, newline characters, or non-printable characters, escape sequences are often available, usually prefixed with the backslash character (ASCII 0x5C).
- Terminated by a newline sequence, for example in Windows INI files.
- Sometimes, strings need to be embedded inside a text file that is both human-readable and intended for consumption by a machine. This is needed in, for example, source code of programming languages, or in configuration files. In this case, the NUL character doesn't work well as a terminator since it is normally invisible (non-printable) and is difficult to input via a keyboard. Storing the string length would also be inconvenient as manual computation and tracking of the length is tedious and error-prone.
2020c
- (Wikipedia, 2020c) ⇒ https://en.wikipedia.org/wiki/C_string_handling Retrieved:2020-2-23.
- The C programming language has a set of functions implementing operations on strings (character strings and byte strings) in its standard library. Various operations, such as copying, concatenation, tokenization and searching are supported. For character strings, the standard library uses the convention that strings are null-terminated: a string of characters is represented as an array of n + 1 elements, the last of which is a "NUL" character.
The only support for strings in the programming language proper is that the compiler translates quoted string constants into null-terminated strings.
- The C programming language has a set of functions implementing operations on strings (character strings and byte strings) in its standard library. Various operations, such as copying, concatenation, tokenization and searching are supported. For character strings, the standard library uses the convention that strings are null-terminated: a string of characters is represented as an array of n + 1 elements, the last of which is a "NUL" character.
2020d
- (Racket, 2020) ⇒ https://docs.racket-lang.org/reference/strings.html Retrieved:2020-2-23.
- QUOTE: A string is a fixed-length array of characters.
A string can be mutable or immutable. When an immutable string is provided to a procedure like
string-set!
, theexn:fail:contract
exception is raised (...)
- QUOTE: A string is a fixed-length array of characters.
2020e
- (Python Doc., 2020) ⇒ "5.6. Sequence Types". In: Python Documentation Content. Retrieved:2020-2-23.
- QUOTE: There are seven sequence types: strings, Unicode strings, lists, tuples, bytearrays, buffers, and xrange objects (...)
String literals are written in single or double quotes:
'xyzzy'
,"frobozz"
. See String literals for more about string literals. Unicode strings are much like strings, but are specified in the syntax using a preceding'u'
character:u'abc'
,u"def"
. In addition to the functionality described here, there are also string-specific methods described in the String Methods section.
- QUOTE: There are seven sequence types: strings, Unicode strings, lists, tuples, bytearrays, buffers, and xrange objects (...)
2020f
- (GeeksforGeeks, 2020) ⇒ https://www.geeksforgeeks.org/strings-in-c-2/ Retrieved:2020-2-23.
- QUOTE: Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character
‘\0’
.
- QUOTE: Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character
2007
- (Kakkonen, 2007) ⇒ Tuomo Kakkonen. (2007). “Framework and Resources for Natural Language Evaluation." Academic Dissertation. University of Joensuu.
- Let [math]\displaystyle{ \Sigma }[/math] be an alphabet.
- A finite sequence of symbols [math]\displaystyle{ S=(x_1 x_2 … x_n), n≥0, x \in \Sigma }[/math] is called a string in alphabet [math]\displaystyle{ \Sigma }[/math].
- The length |S| of string S is n.
- The empty string is the sequence of length 0; written [math]\displaystyle{ \varepsilon }[/math].
- [math]\displaystyle{ \Sigma^* }[/math] is the set of all strings in [math]\displaystyle{ \Sigma }[/math].
2004
- (CSEE-UMBC, 2009) ⇒ University of Maryland Baltimore County Computer - Science and Electrical Engineering Department (2009). "Formal Language Definitions". Last updated: 2004-01-24.
- QUOTE: String also called a Word.
- A finite sequence of symbols from an alphabet.
- 01110 and 111 are strings from the alphabet B above.
- aaabccc and b are strings from the alphabet C above.
- A null string is a string with no symbols, usually denoted by epsilon.
- The null string has length zero.
- The null string is usually denoted epsilon.
- Vertical bars around a string indicate the length of a string expressed as a natural number. For example |00100| = 5, |aab| = 3, | epsilon | = 0
- QUOTE: String also called a Word.