Questions tagged [linguistics]

Linguistics is the scientific study of language and its structure, including the study of morphology, syntax, phonetics, and semantics.

Linguistics is the scientific study of language and its structure, including the study of morphology, syntax, phonetics, and semantics.

Specific branches of linguistics include sociolinguistics, dialectology, psycholinguistics, computational linguistics, historical-comparative linguistics, and applied linguistics.

323 questions
102
votes
25 answers

How can I correctly prefix a word with "a" and "an"?

I have a .NET application where, given a noun, I want it to correctly prefix that word with "a" or "an". How would I do that? Before you think the answer is to simply check if the first letter is a vowel, consider phrases like: an honest mistake a…
ryeguy
  • 65,519
  • 58
  • 198
  • 260
76
votes
1 answer

Linguistic meaning of 'let' variable in programming

So, I'm a javascript programmer and the new version of JavaScript (ES6) has a new keyword for declaring variables: let, next to the old one var. I know the difference between these two, but I was asking myself: what does let stand for? var…
ngstschr
  • 2,119
  • 2
  • 22
  • 38
37
votes
4 answers

How can I programmatically generate Heroku-like subdomain names?

We've all seen the interesting subdomains that you get automatically assigned when you deploy an app to Heroku with a bare "heroku create". Some examples: blazing-mist-4652, electric-night-4641, morning-frost-5543, radiant-river-7322, and so on. It…
dkulchenko
  • 640
  • 7
  • 12
30
votes
3 answers

Selecting the most fluent text from a set of possibilities via grammar checking (Python)

Some background I am a literature student at New College of Florida, currently working on an overly ambitious creative project. The project is geared towards the algorithmic generation of poetry. It's written in Python. My Python knowledge and…
floer32
  • 2,190
  • 4
  • 29
  • 50
23
votes
13 answers

How do I determine if a random string sounds like English?

I have an algorithm that generates strings based on a list of input words. How do I separate only the strings that sounds like English words? ie. discard RDLO while keeping LORD. EDIT: To clarify, they do not need to be actual words in the…
Ozgur Ozcitak
  • 10,409
  • 8
  • 46
  • 56
20
votes
1 answer

How do I identify the part of speech of a word within a NSString?

The app I'm currently working on requires me to determine the part of speech of a word in NSString. So basically is there a library/database/class which you can access in Objective C which allows one to check if a single word (in the form of a…
Charles
  • 493
  • 7
  • 14
20
votes
7 answers

Algorithm for Negating Sentences

I was wondering if anyone was familiar with any attempts at algorithmic sentence negation. For example, given a sentence like "This book is good" provide any number of alternative sentences meaning the opposite like "This book is not good" or even…
Kevin Dolan
  • 421
  • 1
  • 4
  • 7
18
votes
6 answers

Finding the "best" combination for a set

I have a set, sentences, which contains sentences from the English language in the form of strings. I wish to create a subset of sentences, sentences2, which contains sentences containing only 20 unique words. Of course, there are many, many such…
Baz
  • 12,713
  • 38
  • 145
  • 268
16
votes
1 answer

Spacy custom tokenizer to include only hyphen words as tokens using Infix regex

I want to include hyphenated words for example: long-term, self-esteem, etc. as a single token in Spacy. After looking at some similar posts on StackOverflow, Github, its documentation and elsewhere, I also wrote a custom tokenizer as below: import…
Vishal
  • 227
  • 1
  • 2
  • 8
14
votes
1 answer

English Language Dictionary api

Is there a public API which would let me lookup definitions for words ? I've been searching for this for a bit but it's getting mixed up with the dictionary datastructure. I'm planing on using it in a c# app. Thanks
Bala R
  • 107,317
  • 23
  • 199
  • 210
14
votes
7 answers

Algorithm to choose random letters for word search game that allows many words to be spelled

I'm making a boggle-like word game. The user is given a grid of letters like this: O V Z W X S T A C K Y R F L Q The user picks out a word using any adjacent chains of letters, like the word "STACK" across the middle line. The letters used are then…
BobbyJim
  • 707
  • 1
  • 7
  • 13
14
votes
5 answers

Translating human languages in Python

Is there a Python module for the translation of texts from one human language to another? I'm planning to work with texts that are to be pre and post processed with Python scripts. What other Python-integrated approaches can be used?
Alex
  • 43,191
  • 44
  • 96
  • 127
13
votes
2 answers

Find words and combinations of words that can be spoken the quickest

I'm a big fan of discovering sentences that can be rapped very quickly. For example, "gotta read a little bit of Wikipedia" or "don't wanna wind up in the gutter with a bottle of malt." (George Watsky) I wanted to write a program in Python that…
Parseltongue
  • 11,157
  • 30
  • 95
  • 160
13
votes
3 answers

Thesaurus class or API for PHP [edited]

TL;DR Summary: I need a single command-line application which I can use to get synonyms and other related words. It needs to be multi-lingual and works cross platform. Can anyone suggest a suitable program for me, or help me with the ones I've…
Spudley
  • 166,037
  • 39
  • 233
  • 307
13
votes
2 answers

Calculating a relative Levenshtein distance - make sense?

I am using both Daitch-Mokotoff soundexing and Damerau-Levenshtein to find out if a user entry and a value in the application are "the same". Is Levenshtein distance supposed to be used as an absolute value? If I have a 20 letter word, a distance of…
Joseph Tura
  • 6,290
  • 8
  • 47
  • 73
1
2 3
21 22