dicewitch + syntax   32

PEP 274 -- Dict Comprehensions | Python.org
>>> print {i : chr(65+i) for i in range(4)}
{0 : 'A', 1 : 'B', 2 : 'C', 3 : 'D'}
>>> print {k : v for k, v in someDict.iteritems()} == someDict.copy()
1
>>> print {x.lower() : 1 for x in list_of_email_addrs}
{'barry@zope.com' : 1, 'barry@python.org' : 1, 'guido@python.org' : 1}
>>> def invert(d):
... return {v : k for k, v in d.iteritems()}
...
>>> d = {0 : 'A', 1 : 'B', 2 : 'C', 3 : 'D'}
>>> print invert(d)
{'A' : 0, 'B' : 1, 'C' : 2, 'D' : 3}
>>> {(k, v): k+v for k in range(4) for v in range(4)}
... {(3, 3): 6, (3, 2): 5, (3, 1): 4, (0, 1): 1, (2, 1): 3,
(0, 2): 2, (3, 0): 3, (0, 3): 3, (1, 1): 2, (1, 0): 1,
(0, 0): 0, (1, 2): 3, (2, 0): 2, (1, 3): 4, (2, 2): 4, (
2, 3): 5}
python  syntax  documentation
october 2018 by dicewitch
list - Haskell (:) and (++) differences - Stack Overflow
The : operator is known as the "cons" operator and is used to prepend a head element to a list. So [] is a list and x:[] is prepending x to the empty list making a the list [x]. If you then cons y:[x] you end up with the list [y, x] which is the same as y:x:[].

The ++ operator is the list concatenation operator which takes two lists as operands and "combine" them into a single list. So if you have the list [x] and the list [y] then you can concatenate them like this: [x]++[y] to get [x, y].

Notice that : takes an element and a list while ++ takes two lists.
haskell  operators  syntax  stack_overflow  lists
february 2018 by dicewitch
Welcome! — Pygments
Pygments is a syntax highlighting engine written in Python. That means, it will take source code (or other markup) in a supported language and output a processed version (in different formats) containing syntax highlighting markup.

Its features include:

a wide range of common languages and markup formats is supported
new languages and formats are added easily
a number of output formats is available, including:
HTML
ANSI sequences (console output)
LaTeX
RTF
it is usable as a command-line tool and as a library
parsing and formatting is fast
Pygments is licensed under the BSD license.
programming  syntax  library  python
september 2017 by dicewitch
satwikkansal/wtfPython: A collection of subtle and tricky Python examples
Python, being awesome by design high-level and interpreter-based programming language, provides us with many features for the programmer's comfort. But sometimes, the outcomes of a Python snippet may not seem obvious to a regular user at first sight.

Here is a fun project attempting to collect such classic and tricky examples of unexpected behaviors in Python and discuss what exactly is happening under the hood!

While some of the examples you see below may not be WTFs in the truest sense, but they'll reveal some of the interesting parts of Python that you might be unaware of. I find it a nice way to learn the internals of a programming language, and I think you'll find them interesting as well!

If you're an experienced Python programmer, you might be familiar with most of these examples, and I might be able to revive some sweet old memories of yours being bitten by these gotchas 😅

So, here ya go...
python  tips  syntax
september 2017 by dicewitch
Conlang Syntax Test Cases
The Purpose of this List
There are several collections of specimen sentences to translate into a conlang, including 1200 sentences on this web site. As a general rule the sources for these sentences have been elementary-level educational publications meant to provide a student with rote practise exercises. This means that the same sentence structure will appear many times with only slight variations in the nouns and verbs used. For example, these sentences from 1200 Graded Sentences for Analysis:
A cheerful fire is blazing on the hearth.
Seven little sisters were walking in a row.
Some beautiful roses are blooming in our garden.
The boys are playing in the lot.
The little girl was playing with her kitten.
Granted, these sentences may use different conjugations of a verb, and different declensions of the various nouns and pronouns, but aside from those trivial difference [sic], these sentences are essentially identical with respect to the syntactical features they are meant to test or demonstrate. That kind of repetition is fine for rote training, but it is not really necessary for testing a conlang. To serve that purpose there needs to be only one sentence of the type: "Roses are red."
What is necessary is a variety of unique sentences each of which tests some different aspect of the conlang. This collection was constructed by putting together several more repetative lists and culling out that larger collection, those sentences which duplicate syntactic principle already present earlier in the list.
Below are 218 sentences selected from a collection of 1200 sentences, with all those that are essentially duplicates removed.
Some sentences have been slightly modified to remove references to a specific culture or time, to make the sentence more "universal" for conlangs of any era or culture. For example "We went to London..." has been changed to "We went to the village..". In other sentences allowances will have to made [sic] for conlangs from cultures that don't have Mondays, windows, or snow. The important thing is whether the conlang being tested can handle the meaning of sentences of that general structure.
conlang  resources  sentences  translation  syntax
july 2017 by dicewitch
Gramáticas
PALABRAS
Nombres o Sustantivos
Pronombres
Adjetivos
Verbos
Adverbios
Preposiciones
Determinantes
Conjunciones o Nexos
Interjecciones

SINTAGMAS
Sintagma Nominal - SN
Sintagma Preposicional - SPrep
Sintagma Adjetival - SAdj
Sintagma Adverbial - SAdv
Sintagma Verbal - SV

FUNCIONES SINTÁCTICAS
Complemento del Nombre - CN
Complemento del Adjetivo - CAdj
Complemento del Adverbio - CAdv
Complemento Directo - CD
Complemento Indirecto - CI
Complemento Circunstancial - CC
Complemento Agente - CAg
Complemento Predicativo - CPvo
C. de Régimen (Suplemento)
Atributo
Sujeto
Predicado

ORACIONES
Enunciado
Frase y Oración
Oración Personal / Impersonal
Oración Simple / Compuesta
Oración Activa / Pasiva
Oración Unimembre / Bimemembre
Oración Transitiva / Intransitiva
Oración Copulativa / Predicativa
Oración Aseverativa
Oración Interrogativa
Oración Exclamativa
Oración Imperativa
Oración Dubitativa
Oración Desiderativa
Oración Subordinada
Subordinada Sustantiva
Subordinada Adverbial
Subordinada Adjetiva (de Relativo)
Oración Coordinada
Oración Yuxtapuesta
MORFOLOGÍA
Lexema o Raíz
Prefijos
Sufijos
Interfijos
Morfemas de Número
Morfemas de Género
Desinencias Verbales
Accidentes Gramaticales
Análisis Morfológico
FONÉTICA Y FONOLOGÍA
Fonemas
Punto de Articulación
Modo de Articulación
Diptongos
Hiatos
SEMÁNTICA
Campo Semántico
Sinónimos y Antónimos
Familia L�%
words  grammar  linguistics  Spanish  reference  morphology  phonetics  phonology  syntax  semantics
august 2016 by dicewitch
Gramáticas: Ejemplos de Sintagma
Definición de Sintagma:

Un Sintagma (también Frase o Grupo Sintáctico) es una combinación de palabras que desempeña alguna función sintáctica dentro de la oración.

Un Sintagma está formado por un Núcleo Sintáctico que le aporta las características básicas y al que se le pueden añadir otras palabras.
syntax  span252  reference  Spanish
august 2016 by dicewitch
SSWL: directory: homepage
SSWL is a searchable database that allows users to discover which properties (morphological, syntactic, and semantic) characterize a language, as well as how these properties relate across languages. This system is designed to be free to the public and open-ended. Anyone can use the database to perform queries.
To learn more about the objectives of SSWL, please visit the original workshop site or watch our tutorial video.
To read about early updates, please visit our Google Group, (which is no longer actively used).
This site hosts the original prototype SSWL, launched June 1 2009. In the near feature, the database will migrate to Terraling, the next generation of the linguistic explorer project. (same database, different code, faster and more powerful search functions). A new user interface is in development.
syntax  linguistics  reference  database
april 2016 by dicewitch
What is Yoda's syntax in foreign dubs/subtitles in Star Wars?
What does Yoda's syntax look like in non-English versions of Star Wars? For those who aren't familiar with Star Wars (all two of you), Yoda is an alien who, when speaking English, uses what seems to be an OSV syntax instead of the traditional SVO syntax.
So how do foreign translations of the script handle this? I am particularly interested in what it looks like in non-SVO languages. Are there any translations where Yoda's incorrect syntax is emulated by using an English-like syntax? Or are other languages' syntax so free that mistakes in the use of case or verb conjugations must instead be used to emulate Yoda's "alien" speech?
Does anyone have any information about how Yoda speaks in non-English versions of Star Wars?
language  translation  star_wars  syntax  reddit  linguistics
april 2015 by dicewitch
Glottopedia
Glottopedia is a freely editable encyclopedia for linguists by linguists that is currently being built up. It will contain dictionary articles on all technical terms of linguistics and is multilingual. In addition, there are survey articles, biographical articles and language articles, potentially on all linguists and all languages.
Glottopedia articles also exist in German, Spanish, Italian, French, Russian, Danish, Swedish, Chinese, Japanese, Norwegian (Nynorsk), and in the future hopefully also in many other languages.
Glottopedia needs your contribution!
Contents [hide]
1 Glottopedia Team
1.1 Editors
1.2 Scientific Advisory Council
2 Sample dictionary articles
2.1 Syntax
2.2 Morphology
2.3 Phonetics and Phonology
2.4 Semantics
2.5 Diachrony
2.6 Computational Linguistics
2.7 Quantitative Linguistics
3 Sample biographical articles
4 Other Languages
Glottopedia Team

Editors
Editors-in-Chief: Sven Naumann, Jan Wohlgemuth
Technical Editors: Hans-Jörg Bibiko, Götz Burger
Scientific Advisory Council
Gabriel Altmann, Pier Marco Bertinetto, Greville G. Corbett, Östen Dahl, Martin ((((Haase)))), Martin Haspelmath, Reinhard Köhler, John McWhorter, Eva Schoenke, Jürgen Wedekind
Sample dictionary articles

Syntax
(see also Portal:Syntax)
adjective, alliterative agreement, applicative, apposition, argument structure, attribute, case, complement, contact clause, coordinand, core argument, c-structure, dative transformation, dependency grammar, ellipsis, ergativity, free state, full verb, gapping, infinitive, internal argument, lexical category, negative concord, nonconfigurationality, noun, part of speech, phrase structure grammar, pied piping, prepositional phrase, pro, PRO, promotion, rich agreement, semantic macrorole, subject, subordinator, subcomparative construction, syntactic function, X-bar theory, Θ-role
Morphology
(see also Portal:Morphology)
accusative case, adfix, affix, allocutive, base, category-system, deadjectival, derivation, dimension, Distributed Morphology, expletive infixation, fission, flag, impoverishment, infinitive, inflection, lexeme, macroparadigm, morpheme, morphophonemics, morphosyntactic category, oblique case, plurale tantum, prefix, reduplicant, simplex, supine, suspended affixation, syncretism
Phonetics and Phonology
(see also Portal:Phonetics and phonology)
affricate, apocope, apicodental, appendix (in syllable structure), approximant, breathy voice, coda, compensatory lengthening, Contrastive Specification Theory, dactyl, declarative phonology, degenerate foot, dependency phonology, extrametricality, fricative, labiodental, laryngeal, lateral, liquid, manner of articulation, Maximal Onset Principle, metrical phonology, minimal word constraint, nasal, natural class, pitch accent (lexical), prependix, stop, stress, stress-timed and syllable-timed, uvular, velar, velarization, vowel
Semantics
(see also Portal:Semantics)
agent, ambiguity, antonym, aspect, commissive, collective noun, connotation, de dicto and de re, denotation, directive, echo question, face, hedge, holonym, hyperonym, hyponym, idiom, illocution, implicature, indirect speech act, internally caused situation, meaning, modality, Natural Semantic Metalanguage, performative verb, perlocutionary act, proposition, protasis, semantic marker, semantic role, sense, specificity, speech act, thetic vs. categorical, vagueness
Diachrony
(see also Portal:Diachrony)
antigrammaticalization, borrowing, genus, haplology, hyperanalysis, innovation, language family, loanword, normal transmission, propagation, push chain, reanalysis, sound law, syntacticization, xenism
Computational Linguistics
(see also Portal:Computational Linguistics)
Brill-Tagger, feature logic, finite-state automata, GPSG, HPSG, LFG, ID/LP rules, KWIC concordance, parser, shallow parsing, subsumption, tagger, Two-level morphology, unification, unification-based grammars, machine translation, chunking
Quantitative Linguistics
(see also Portal:Quantitative Linguistics)
aims and methods of quantitative linguistics, history of quantitative linguistics , property, unit, entropy, frequency, function, law, graph theory, hypothesis, index, information, information theory, numeric classification, length, measure, metrics, model (building), economy, process, scale, language law, statistics, structure, synergetic linguistics, system, system requirement, text, text statistics, theory, distribution, repetition, properties of the word, interrelation, polysemy, polytextuality, neighbours, Ngram frequency
Sample biographical articles

(see also: Portal:Biography)
Karl Ferdinand Becker · Johannes Benzing · Simon C. Dik · Dionysius Thrax · Stefan Elders · H. Allan Gleason Jr. · Einar Haugen · Marco Haverkort · Karl Erich Heidolph · Boris Isaakovič Jarcho · Georg Friedrich Meier · Harry L. Shorto · John Sinclair · Sergej A. Starostin · Jost Winteler
Other Languages

Chinese 欢迎，新来者
Danish Velkommen
German Hauptseite
Norwegian (Nynorsk) Velkomen
Spanish Bienvenidos
linguistics  reference  wiki  German  Spanish  Italian  French  Russian  Danish  Swedish  Chinese  Japanese  Norwegian  Nynorsk  syntax  morphology  Phonetics  Phonology  Semantics  Diachrony
april 2015 by dicewitch
LTAG!
LTAG! is an absurd, irreverent card game based on Lexicalized Tree Adjoining Grammar
Compete and co-operate to generate offensive yet grammatical English sentences made of partial syntactic trees.
The first player to use up all of their cards wins!

Every Lexical Card in LTAG! is designed to successfully generate hilarious, deplorable, grammatical sentences by way of substitution, conjunction, adjunction, and more!

A printable version of LTAG! is free to download under a Creative Commons license.

Like it? Hate it? Tweet us @LTAGgame or e-mail us at LTAGgame@gmail.com

Any and all names of any and all real people, fictional, alive, dying, or dead, are used in a purely parodic and fictional manner. Please don't attack us in the street about it.
linguistics  syntax  card_games  print_and_play
march 2015 by dicewitch

Copy this bookmark:

description:

tags: