Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Major Project Handcrafted
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
jonathan.poalses
Major Project Handcrafted
Commits
392704d1
Commit
392704d1
authored
May 03, 2023
by
Jonathan Poalses
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed tokens to token-text as I just extracted the text from the tokens anyway
parent
578ed012
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
dialect_nlp.clj
src/poalses/jonathan/dialect/dialect_nlp.clj
+5
-5
No files found.
src/poalses/jonathan/dialect/dialect_nlp.clj
View file @
392704d1
...
@@ -69,11 +69,11 @@
...
@@ -69,11 +69,11 @@
;; Take a sentence and figure out its dialect
;; Take a sentence and figure out its dialect
(
defn
detect-sentence-dialect
[
sentence
]
(
defn
detect-sentence-dialect
[
sentence
]
(
let
[
token
s
(
dl/tokens
sentence
)
(
let
[
token
-text
(
dl/text
(
dl/tokens
sentence
)
)
dialects1
(
if
(
some
australian-words
(
dl/text
tokens
)
)
:australian
(
when
((
apply
some-fn
australian-predicates
)
sentence
)
:australian
))
dialects1
(
if
(
some
australian-words
token-text
)
:australian
(
when
((
apply
some-fn
australian-predicates
)
sentence
)
:australian
))
dialects2
(
if
(
some
scottish-words
(
dl/text
tokens
)
)
:scottish
(
when
((
apply
some-fn
scottish-predicates
)
sentence
)
:scottish
))
dialects2
(
if
(
some
scottish-words
token-text
)
:scottish
(
when
((
apply
some-fn
scottish-predicates
)
sentence
)
:scottish
))
dialects3
(
if
(
some
american-words
(
dl/text
tokens
)
)
:american
(
when
((
apply
some-fn
american-predicates
)
sentence
)
:american
))
dialects3
(
if
(
some
american-words
token-text
)
:american
(
when
((
apply
some-fn
american-predicates
)
sentence
)
:american
))
dialects
(
remove
nil?
[
dialects1
dialects2
dialects3
])]
dialects
(
remove
nil?
[
dialects1
dialects2
dialects3
])]
(
if
(
empty?
dialects
)
[
:standard
]
dialects
)))
(
if
(
empty?
dialects
)
[
:standard
]
dialects
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment