Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View maxgr0's full-sized avatar
🎯
Focusing

Max Grollmann maxgr0

🎯
Focusing
View GitHub Profile
@maxgr0
maxgr0 / generate-iso-contract-id-checksum.ts
Created June 29, 2021 12:45
generate-iso-contract-id-checksum
const P1 = [
[0, 1, 1, 1],
[1, 1, 1, 0],
[1, 0, 0, 1],
[0, 1, 1, 1],
[1, 1, 1, 0],
[1, 0, 0, 1],
[0, 1, 1, 1],
[1, 1, 1, 0],
[1, 0, 0, 1],
resources:
Resources:
DataLakeBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.dataLakeBucketName}
GlueDataLake:
Type: AWS::Glue::Database
Properties:
CatalogId: ${self:provider.environment.AWS_ACCOUNT_ID}
import { ComprehendClient, DetectDominantLanguageCommand, DetectEntitiesCommand } from '@aws-sdk/client-comprehend';
import { Comprehend } from 'aws-sdk';
const comprehendClientv3 = new ComprehendClient(Container.get(ConfigurationProviderService).comprehend);
const comprehendClientv2 = new Comprehend(Container.get(ConfigurationProviderService).comprehend);
const text = 'Bob lives in Seattle. He is a software engineer at Amazon.'; //the example text from aws docs
try{
const result = await this.comprehendClientv2.detectDominantLanguage({Text: text}).promise();
console.log('result v2', result);