Skip to content

Instantly share code, notes, and snippets.

View Mike-Honey's full-sized avatar

Mike Honey Mike-Honey

View GitHub Profile
let func =
(Table as table, optional Step as number, optional SelectedColumns, optional GroupByColumns, optional Suffix as text, optional Buffer as any) =>
let
// Steps to prepare the (optional) parameters for the nested function "fnFetchNextRow"
Source = if Buffer = null then Table else Table.Buffer(Table),
Step0 = if Step = null then -1 else Step,
Step_ = if Step = null then 1 else Number.Abs(Step),
Suffix = if Suffix = null then ".Prev" else Suffix,
GroupByColumns = if GroupByColumns = null then null else GroupByColumns,
@Seddryck
Seddryck / Character.FromHtmlEntity.pq
Created March 28, 2018 04:04
Function to translate en html entity (such as ♣ or À) to the equivalent character
shared Character.FromHtmlEntity = (entity as text) =>
let
list =
{
[Name="Agrave", Number=192]
, [Name="Aacute", Number=193]
, [Name="Acirc", Number=194]
, [Name="Atilde", Number=195]
, [Name="Auml", Number=196]
, [Name="Aring", Number=197]
@anup50695
anup50695 / extract_chunks.r
Last active May 16, 2019 10:04
Key Phrase Extraction from Tweets
extractChunks <- function(x) {
x <- as.String(x)
wordAnnotation <- annotate(x, list(Maxent_Sent_Token_Annotator(), Maxent_Word_Token_Annotator()))
POSAnnotation <- annotate(x, Maxent_POS_Tag_Annotator(), wordAnnotation)
POSwords <- subset(POSAnnotation, type == "word")
tags <- sapply(POSwords$features, '[[', "POS")
tokenizedAndTagged <- data.frame(Tokens = x[POSwords], Tags = tags)
tokenizedAndTagged$Tags_mod = grepl("NN|JJ", tokenizedAndTagged$Tags)