4
$\begingroup$

In a paper I am writing I want to make distinction between (1) string consisting of any characters and (2) string consisting of a chain of words from known language, with possible delimiters. My intuitive idea is to simply use string for meaning (1) and text for meaning (2). It sounds a bit naive, but this terminology could work, given that I define it properly in my paper.

Yet I have an uneasy feeling that meaning (2) has fancier name in fields of computer science or computational linguistics. So, what are the precise terms to make distinction between the two types of strings?

UPDATE

Suppose we have an alphabet Σ = {a, b, c, ~}, where ~ is a delimiter symbol, and language L = {aaa, bbb, abc}.

Now, the following strings satisfy definition (1), but not (2):

  • cba
  • a
  • aaaa
  • a~b~~

And the following strings would satisfy both definitions (because they are made of the words of language L).

  • aaabbbabc
  • abc
  • aaa~bbb~aaa~~~aaa
  • ~
  • (an empty string)

In some applications my strings could be actual text in a human language like English, Lithuanian or Esperanto. But this is not required. It could also be a DNA chain, a binary file, or anything else. Also keep in mind, that in practical applications the strings would most likely be long (like a journal article, or entire corpus for that matter), so calling it a "sentence" would be a bit of understatement. Meaning of the text is entirely irrelevant here.

So, regarding definition (1) all is clear - I just call it a string on alphabet Σ. Now the core question is this: what do I call the strings from the second example to make them distinct from the first example. My initial idea is to call it a "text". One of the answers proposed "word string", which I like even better. Maybe you have seen other terms being used for such purpose in the literature?

It might seem that I'm in extreme hair splitting mode here. Yet that term will be all over my PhD thesis, very likely including the title. Therefore I really want to get my terminology straight.

$\endgroup$
5
  • $\begingroup$ Seems to me that both are strings over two different alphabets. The first being characters; the second being words. So you can use the same definition and change the alphabet. $\endgroup$
    – mrk
    Jun 26, 2014 at 9:02
  • $\begingroup$ Let us assume that the same alphabet is used in both cases. $\endgroup$ Jun 26, 2014 at 10:22
  • 1
    $\begingroup$ Perhaps a "sentence?" $\endgroup$
    – jmite
    Jun 26, 2014 at 18:54
  • $\begingroup$ @jmite I remember reading "sentential form" somewhere. $\endgroup$
    – mrk
    Jun 26, 2014 at 23:04
  • $\begingroup$ My string could potentially be very long, so "sentence" would sound a bit strange. And "sentential form" seems to be something entirely different. $\endgroup$ Jun 29, 2014 at 16:52

3 Answers 3

4
$\begingroup$

If definition (1) is intended for any sequence of characters, I would simply call it string as you suggest, but I would call it word or lexeme if it is intended to be words of a language.

Regarding definition (2), it depends again on what you are expecting to consider. If it is any sequence of words, usually meaningless, with a variety of separators, the name text would do fine, and I would not worry too much about computational linguistic since the only meaningless piece of text that matters in CL is "Colorless green ideas sleep furiously".

If it is actually intended to be a sentence of a language, then you might call it sentence. I feel that text would rather be used for larger pieces of discourse. You should be careful though that is is not confused with sentence meaning a string of words. Speech processing people may speak of utterance, but it may be inappropriate for your use. They use also sentence, which they structure into word lattice when the separators are not clearly identified, which amounts to a word sequence or word string if they are clearly identified.

This disctinction may also depend on whether your separators are one or many, and whether they have a role.

In other words, it is hard to give you a precise answer without more details on what you are doing. I first tried, and then realized that it led me to make unwarranted assumptions about what you are doing.

The one thing that is really important is that you are very clear about your definitions. And if you can motivate your terminology choices, that may help the reader. I am still wondering why the borogoves had to be so mimsy.

$\endgroup$
3
  • $\begingroup$ I like "word string", I might use it, or stay with "text". Well, as usually my professor will have the final say on this one. I am going to illustrate my question with some examples, maybe that will help to clarify. $\endgroup$ Jun 29, 2014 at 16:56
  • $\begingroup$ @ViliusNormantas As I said, "word string" runs the risk of ambiguity, since I would personally understand it as a string on an alphabet consisting of words, i.e. a string of strings, rather than a string in which separator symbols delimit substrings (which seems to be what you are after). But short of knowing more precisely what you are doing, I cannot be much more help. But choosing names and their meanings is the author's privilege, within reason (and supervision :). $\endgroup$
    – babou
    Jun 29, 2014 at 17:35
  • $\begingroup$ Dictionary defines "word string" as "a linear sequence of words as spoken or written" (thefreedictionary.com/word+string). Almost what I want. Yet in my case the words are concatenated into one big string (with possible delimiters). $\endgroup$ Jun 29, 2014 at 17:54
0
$\begingroup$

Lets assume you are defining sets using your definition. It is obvious that the set defined by (2) is a subset of the set you are defining by (1) right now. But that is offtopic.

I am quite sure that there is no fancy word for what you are calling a text, since your definition is very vague. As a text you are defining a list of words contained in a dictionary, separated by delimiters. I would certainly not call this a text. If your "text" has a meaning which is based on an under-laying grammar you can call it a sentence, a statement or a paragraph.

$\endgroup$
1
  • $\begingroup$ Yes, string by definition (2) is also a string by definition (1), assuming that both consist of symbols from the same alphabet. My strings could be very long, so it would be a bit bizarre to call them a sentence, or a paragraph. Yes, in some applications the text could be actual human readable text with meaning, etc. But that is not relevant to my algorithm. $\endgroup$ Jun 29, 2014 at 16:44
0
$\begingroup$

What you're looking for is a bag of words. It has a Machine Learning connotation as it is where the concept is used, though.

$\endgroup$
4
  • $\begingroup$ This doesn't seem to quite answer the question, since a bag of words is explicitly a multiset, whereas the objects being manipulated here is a string. On the other hand, perhaps it suggests "string of words" as a good choice for the object under consideration, by analogy with "bag of words". $\endgroup$ Jun 26, 2014 at 18:53
  • $\begingroup$ @DavidRicherby The problem is that string of words may also be more naturally understood as a string on an alphabet composed of words, which is actually closer to the concept of bag of words, but is not what the OP is considering, namely a unique string with words as substrings, rather than a string of strings. This is precisely the confusion I am worried about in my own answer. It is not too much of a problem if only one of the two concepts is actually used by the OP, which I doubt, though the analogy with bag of words does not seem really adequate. $\endgroup$
    – babou
    Jun 26, 2014 at 19:18
  • $\begingroup$ My bad, indeed bag of words is not correct. Maybe word n-gram would be what the OP wants? Though again this'd normally mean a sequence that does exist in a given reference text or corpus. $\endgroup$ Jun 26, 2014 at 20:48
  • $\begingroup$ No, as you have said yourself, what I want is not a bag of words. $\endgroup$ Jun 29, 2014 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.