Questions tagged [lexical]

The "Lexical" tag is used to denote a connection with words of a language, its grammar or the dictionary. Alternatively, it is also used in the context of "lexical scope," the context in which certain values are valid.

Broadly, Lexical is used to refer to words of a language. (The terms in applicable to natural (human) languages, as well as to computer programming languages. Lexical is derived from "Lexicon" and therefore the tag is also applied to questions relating to the dictionary for a language.

Finally, the tag is used in a computer programming context: Lexical Scoping. A lexical scope is the "context" within with certain rules/values apply (Example the "scope" of a local variable.)

204 questions
2
votes
0 answers

Dynamic generation of Lexical Analyzers in Java

I want to match regular expressions very fast, low overhead. And I want to be able to choose between multiple expressions. E.g. AB* -> case A XXX -> case B etc So I want to name all of which cases matched. The problem is very similar to a lexical…
tdugan
  • 121
  • 8
2
votes
1 answer

Lexical error in Haskell when concatenating strings

I am trying to insert a character ('A') into a string in Haskell my code is as follows: split :: Int -> String -> String split n s |s == [] = s |otherwise = let (a,b) = splitAt n s in “A” ++ split n b However, it keeps throwing up "…
BenJacob
  • 957
  • 10
  • 31
2
votes
4 answers

Is `1 < 2` a `not_test` in Boolean operation even without the keyword `not`?

I'm reading the Python documentation 2.76 This is the lexical syntax of the 3 kinds of boolean operations : or_test ::= and_test | or_test "or" and_test and_test ::= not_test | and_test "and" not_test not_test ::= comparison | "not"…
du369
  • 821
  • 8
  • 22
2
votes
3 answers

Library for identifying lexical features of a string in Java

currently I need to find some special lexical characteristics of a string in Java such as Total number of characters Total number of alphabetic characters Total number of uppercase characters .... I wonder that is there a library can do that? It…
Xitrum
  • 7,765
  • 26
  • 90
  • 126
2
votes
1 answer

Distinguishing between signed number and operation in context free grammars

I'm in the midst of writing a lexical scanner, and I'm wondering how I would distinguish between an operation (eg. -) and a signed number (eg. -14). For example, both of the following lines are valid: +12 12 +12 Currently, my lexical scanner would…
Kyle
  • 374
  • 1
  • 11
2
votes
1 answer

MIT Java WordNet Interface: Getting WordNet lexicographer classes or super-senses

I have a project where I need to get the lexical meaning of a word. I am thinking of using WordNet because it has its own lexicographer classes also called super-senses. I just downloaded MIT JWI and trying to see if this JWI does support it. The…
Cryssie
  • 3,047
  • 10
  • 54
  • 81
2
votes
3 answers

Xcode 4 - renamed/deleted file, yet get 'file not found' error

I just used Xcode's refactoring tool to rename a core data class from Player to Person. After fixing about 100 errors resulting from using dot notation that Xcode missed in the rename, I got to the last one: Player.m - Lexical or Preprocessor issue…
arsenius
  • 12,090
  • 7
  • 58
  • 76
2
votes
1 answer

Can I change the sort sequence of a SOLR search at query time? Make SOLR use 52734 instead of 12345?

I have documents in an index which have a category attribute. There are priorities assigned to each category, like so: Category | Priority 1 | 1 2 | 2 3 | 3 4 | 4 I wish to be able to change how SOLR…
jakeonrails
  • 1,885
  • 15
  • 37
1
vote
3 answers

Javascript or Python: Newline after each sentence

I'm curious if there's a library for python OR javascript to tokenize sentences of a string of sentences and put new line at each sentence? IE: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum aliquet leo in urna hendrerit…
Hellnar
  • 62,315
  • 79
  • 204
  • 279
1
vote
0 answers

In Lexical how to change default node from paragraph to bullet list?

I'm new to lexical and I find the documentation to be poor. I've been researching for a while but haven't found a way to change the default rich text editor node from paragraph to bullet list. Basically, I want the editor to create bulleted lists on…
1
vote
1 answer

How to check if the editor is empty?

I have two editor instances. One is editable Second one is read only for preview what user is typed I'm copied editor state beetwen those editors - wtih no problems But i want to hide second editor when first one is empty. I'm trying something like…
lucio
  • 17
  • 3
1
vote
0 answers

Creating grammars for lexical analyzer

I am trying to create a lexical analyzer for a given language. Can't write grammar rules correctly. My task is The input language contains conditional statements if ... then ... else and if ... then, separated by a symbol ; (semicolon). Condition…
1
vote
1 answer

Lexical Errors: misspelling of identifiers

In the dragon book it is mentioned that "Lexical errors include misspelling of identifiers. e.g. misspelling ellispeSize as elipseSize" I cannot understand how is it true (that lexical analyzer can indentify misspelled identifiers and cause error).…
Abhishek Ghosh
  • 597
  • 7
  • 18
1
vote
2 answers

Swift: enum names with special characters (like .) in them

how can I create an enum with "." or "-" in their names? I want something like: enum Options: String { case option1, option2, option2.1, option3 } Using backticks (``) doesn't work. Is there some work-around I can do?
User2021
  • 31
  • 1
1
vote
0 answers

Wu-palmer Semantic Similarity for Node.js

I’ve been searching for wu-palmer Semantic Similarity implementation for node js, but no luck. Could you please point me Where I could get it.